I have this matched pair of stereo cameras that come with calibration data including rotation and translation between the left and right cameras. The left to right rotation is given as a set of 3 euler angles, and I'm told the rotation is passive in the order x->y->z. The coordinate system they use would have the z axis shooting out away from you, the y axis headed down to your feet, and the x axis shooting off from your right shoulder. I'm trying to convert these three angles into a matrix that I can use in stereoRectify. If I don't set the rotation matrix everything seems to work okay, but when I try to create my own rotation matrix the image is barely recognizable.
I tried the following:
//next we need to compose the 3 rotations into their matrix forms
cv::Mat_<double> R_x(3,3);
R_x << 1, 0, 0,
0, cos(E_x[0]), -sin(E_x[0]),
0, sin(E_x[0]), cos(E_x[0]);
cv::Mat_<double> R_y(3,3);
R_y << cos(E_y[0]), 0, sin(E_y[0]),
0, 1, 0
-sin(E_y[0]), 0, cos(E_y[0]);
cv::Mat_<double> R_z(3,3);
R_z << cos(E_z[0]), -sin(E_z[0]), 0,
sin(E_z[0]), cos(E_z[0]), 0,
0, 0, 1;
R = R_x * R_y * R_z;
And also tried re-ording the last multiplication step which gives me different rotations but nothing that looks correct. How should I be doing this?
Thank you