3
votes

The default coordinate system when using the Matlab stereo camera calibrator is to have Z increasing away from the camera (see the bottom image of this page: http://www.mathworks.com/help/vision/gs/coordinate-systems.html)

I would like to rotate my coordinate system so that it is still right-handed, but with z=0 at the calibration target and +z directed towards the camera. I can construct a rotation matrix R that will rotate any coordinate 180 degrees about the x-axis:

RotMatrix= [1    0    0;
            0   -1    0;     % 0  cos(pi)  -sin(pi)
            0    0   -1];    % 0  sin(pi)  cos(pi)

I can see how this could rotate the coordinates of any world point, e.g.

P_new_coordinates= R*[Px; Py; Pz];

But I'm not sure how to account for this rotation of coordinate system in the conversion from pixel coordinates to world coordinates and vice versa. Is there a way I can incorporate this directly into my camera matrix? I'm using the 3x4 camera matrix convention:

[su; sv; s]= M*[X; Y; Z; 1]
1

1 Answers

1
votes

You can certainly choose any world coordinate system you like, and you can create the corresponding camera matrix. In your notation the camera matrix M can be decomposed as follows:

M = K' * [R t]

where K' is the transpose of the intrinsic matrix given by the Stereo Camera Calibrator, R is the rotation matrix, and t is the translation as a column vector. For camera 1 of your stereo system R is the identity matrix, and t is a 0 vector, because camera 1 is at the origin pointing down the z-axis. If you want to use some other world coordinate system, you would simply need to adjust R and t appropriately.