if you want to create the Q matrix directly:
cv::Mat Q; Q.at<double>(0,0)=1.0; Q.at<double>(0,1)=0.0; Q.at<double>(0,2)=0.0; Q.at<double>(0,3)=-160; //cx Q.at<double>(1,0)=0.0; Q.at<double>(1,1)=1.0; Q.at<double>(1,2)=0.0; Q.at<double>(1,3)=-120; //cy Q.at<double>(2,0)=0.0; Q.at<double>(2,1)=0.0; Q.at<double>(2,2)=0.0; Q.at<double>(2,3)=348.087; //Focal Q.at<double>(3,0)=0.0; Q.at<double>(3,1)=0.0; Q.at<double>(3,2)=1.0/95; //1.0/BaseLine Q.at<double>(3,3)=0.0; //cx - cx'
But you have to calibrate both cameras, and then get the Q matrix from cv :: stereoRectify. Be careful, read the Q-matrix as double values.
source share