RSS

Tag Archives: pnp

Problems with solvePnP

scrapped from : http://tech.groups.yahoo.com/group/OpenCV/message/72678

Re: Problems with solvePnP

I have tried using both “cvFindExtrinsicCameraParams2()” from the C interface
and “solvePnP()” from the C++ interface, because I wasn’t sure of the
difference. I found out that they are exactly the same (it would be good if this
was mentioned in the documentation!), but if you use floating-point values for
the outputs of solvePnP instead of doubles, then it gives extremely large or
extremely small results, just like you guys noticed.

Can someone please update the official C++ documentation to say that
cv::solvePnP() is the C++ equivalent to cvFindExtrinsicCameraParams2(), and that
the rotation & translation outputs should be doubles instead of floats?
(Assuming this is not considered a bug).

The outputs I get on OpenCV 2.0.0 with VS2008 on 32-bit WinXP is shown below.
Notice that the results are all identical between tests (give or take 0.0001%)
except for the last test of solvePnP() with floats.

###### Using <double> cvFindExtrinsicCameraParams2(): ####
Rotation Axis: 0.717367, 0.954479, 0.198497.
Angle: 1.21039 radians (69.3503 deg).
Translation Vector: 324.518, 52.6191, 591.712

###### Using <double> cv::solvePnP(): #####################
Rotation Axis: 0.717367, 0.954479, 0.198497.
Angle: 1.21039 radians (69.3503 deg).
Translation Vector: 324.518, 52.6191, 591.712

###### Using <float> cvFindExtrinsicCameraParams2(): ######
Rotation Axis: 0.717366, 0.954479, 0.198497.
Angle: 1.21039 radians (69.3503 deg).
Translation Vector: 324.518, 52.6191, 591.712

###### Using <float> cv::solvePnP(): ######################
Rotation Axis: -2.1e-032, 1.804, 2.6e+008.
Angle: 2.6e+008 radians (1.5e+010 deg).
Translation Vector: -1.09e-010, 3.81691, -2.82e-039

Cheers,
Shervin Emami.

Advertisements
 
Leave a comment

Posted by on July 23, 2010 in Computer Vision, OpenCV, Programming

 

Tags: