Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

openCV 3.0 recoverPose wrong results

Does anyone can using openCV 3.0 recoverPose function with good results? I've got:

Mat r;
cv::Mat t;
cv::Mat E = cv::findEssentialMat(features1, features2);
cv::recoverPose(E, features1, features1, r, t);

float xAngle = radToDeg(atan2f(r.at<float>(2, 1), r.at<float>(2, 2)));
float yAngle = radToDeg(atan2f(-r.at<float>(2, 0), sqrtf(r.at<float>(2, 1) * r.at<float>(2, 1) + r.at<float>(2, 2) * r.at<float>(2, 2))));
float zAngle = radToDeg(atan2f(r.at<float>(1, 0), r.at<float>(0, 0)));

As input I use one image 1836x1836 dimensions and another image 1836x1836 which is just rotated 90 degrees to the left. I have rotated it using computer program so it is exactly rotate 90 degrees.

I expect result:

xAngle: 0
yAngle: 0
zAngle: 90 (or -90 depending on Z direction)

Unfortunately my results are:

xAngle: 90
yAngle: 0.113659
zAngle: 180

Can anyone help me with it?