Updated by Alexander Shishkov about 13 years ago

I have been testing cvStereoRectify to obtain matrices R, P and Q and then compute 3D triangulation in the rectified cameras. Finally, using the transposed R matrices I get the 3D points in the original camera frames.

I have noticed that triangulation accuracy is not good enough even if simulated cameras and simulated 3D points are used. I think that the problem appears in the result given in the P matrix corresponding to the right camera. According to OpenCV's [[OpenCV]]'s documentation, this matrix looks like:

P' = [ f 0 Cx' Tx*f ]
[ 0 f Cy 0 ]
[ 0 0 1 0 ]

being Cx' the principal point x coordinate in the right camera and Cy the y coordinate of the principal point in both the left and right cameras. Then, it is stated that Tx is "the horizontal shift" between both cameras. As far as I have understood, rectification implies rotating the cameras so that they get aligned and both images planes are the same and the focal lengths are also equal. Nevertheless, the cameras' focal points are not moved, so that the distance between the camera focal points is the same before and after rectification. Then, this distance is Tx.

I have checked the value of Tx in P' matrix and it is slightly different to the distance between the focal points of the cameras before rectification. Furthermore, by setting Tx to the exact value and then recomputing matrix Q by hand, the triangulation accuracy obtained is much better.

Could anybody check this point?

Thanks in advance

Back