Rotation of the world coordinate system given by Matlab Stereo Camera Calibrator
The default coordinate system when using the Matlab stereo camera calibrator should have a Z magnification 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, but with z = 0 for the calibration target and + z facing the camera. I can plot 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 see how this can rotate the coordinates of any point in the world, for example
P_new_coordinates= R*[Px; Py; Pz];
But I'm not sure how to explain this coordinate system rotation when converting from pixel coordinates to world coordinates and vice versa. Is there a way to incorporate this directly into the camera matrix? I am using the 3x4 matrix matrix convention:
[su; sv; s]= M*[X; Y; Z; 1]
source to share
You can 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 transposition of the internal matrix specified by the stereo camera calibrator, R is the rotation matrix, t is the translation as a column vector. For camera 1 of your stereo, R is the identity matrix and t is vector 0 because camera 1 is at the origin pointing down the z-axis. If you want to use any other world coordinate system, you just need to adjust R and t accordingly.
source to share