Q matrix for the reprojectImageTo3D function in opencv

The form of the Q matrix is given as follows:

Q Matrix Image

In that image, cx and cy are the coordinates of the principal point in the left camera (if you did stereo matching with the left camera dominant), c’x is the x-coordinate of the principal point in the right camera (cx and c’x will be the same if you specified the CV_CALIB_ZERO_DISPARITY flag for stereoRectify()), f is the focal length and Tx is the baseline length (possibly the negative of the baseline length, it’s the translation from one optical centre to the other I think).

I would suggest having a look at the book Learning OpenCV for more information. It’s still based on the older C interface, but does a good job of explaining the underlying theory, and is where I sourced the form of the Q matrix from.

Leave a Comment