1 | initial version |
Well, my impression so far is that translation is computed rather well, but rotation is almost always bullshit, unless there is none between the two frames. But rotation around the z axis like in your case seems to work occasionally. I'm not sure about the equations, but you can use the RQdecomp3x3
function to decompose the matrix to euler angles
Mat mtxR, mtxQ;
Vec3d angles = RQDecomp3x3(R, mtxR, mtxQ);
cout << "Translation: " << t.t() << endl;
cout << "Euler angles [x y z] in degrees: " << angles.t() << endl;`
I'm not sure though if x, y, z is really the order of axes here.
Also, you need to pay attention to whether feature coordinates are normalised or not, and possibly try various combination of input parameters when performing undistortion and then finding E (I've outlined the issue here), so something like this may be requires depending on your specific case.
Mat E = findEssentialMat(imgpts1, imgpts2, 1.0, Point2d(0,0), RANSAC, 0.999, 3, mask);
correctMatches(E, imgpts1, imgpts2, imgpts1, imgpts2);
recoverPose(E, imgpts1, imgpts2, R, t, 1.0, Point2d(0,0), mask);