I am working on 3d image reconstrcution using stereo camera. I started with opencv 3.2 and visual studio. I was unable to correctly register two point clouds from two scenes with an overlap correctly. So, I have my doubt on the Q matrix obtained from camera calibration process. So I did the camera calibration using the matlab calibrator app. I want to manually create the Q matrix from the calibration parameters obtained from matlab and then use it in opencv. I found from this post how to create a Q matrix. Now the problem is i don't know the focal length i should use in this matrix. Matlab provides the calibration parameters in a stereoparam object which contains camera parameters for both camera sensors separately. So i have fx and fy from camera1 and fx and fy from camera2. So how do i obtain a single focal length for the stereo camera?
Asked
Active
Viewed 467 times
2 Answers
0
As reported here, fx and fy are expressed in pixels.
F, the focal length in world unit (typically in millimeters) can be computed as
F = fx * px or F = fy * py,
where px and py are the size of the pixel along x and y, respectively.
In particular,
px = image width [pixel] / image sensor width [mm]
py = image height [pixel] / image sensor height [mm].

Paolo Ferraiuoli
- 122
- 12
0
This is the Q matrix aka reprojection matrix
Since you have the camera intrinsic matrix and extrinsic matrix, then just fill it in accordingly.
Take note the Tx should be in mm.

Dr Yuan Shenghai
- 1,849
- 1
- 6
- 19