I'm working with a set of stereo cameras and having trouble with the math for the rotation calibration in openCV. Each set of cameras comes with a set of calibration data that includes three Euler angles to describe rotation between the left camera to the right camera. (It also includes translation data and distortion parameters). The angles are described as using passive rotation where you rotate about the first axis, then from the new position you rotate around the next axis if I understand that correctly. Finally the coordinate system's axis are defined like this: If you stood in a t-pose and could shoot lasers out of your eyes they would go in the positive z direction, your legs would be the positive y direction, and right arm the positive x direction.
edit: I forgot to add that I know the order of rotations is x, y, z.
I tried the following approach. I define the R_x, R_y, and R_z matrix like this:
R_x << 1, 0, 0,
0, cos(E_x[0]), -sin(E_x[0]),
0, sin(E_x[0]), cos(E_x[0]);
R_y << cos(E_y[0]), 0, sin(E_y[0]),
0, 1, 0
-sin(E_y[0]), 0, cos(E_y[0]);
R_z << cos(E_z[0]), -sin(E_z[0]), 0,
sin(E_z[0]), cos(E_z[0]), 0,
0, 0, 1;
Then I multiply them like this:
R = R_x * R_y * R_z;
And I also tried every possible ordering of that multiplication. Still my results are either a blurred mess or rotated 90 degrees. So I'm missing something about how to do this.