OpenCV SolvePnP strange values

asked 2017-10-25 09:18:24 -0600


I experiment on a project. I use SolvePnP to find rotation vector on an object. Since the values are hard to understand, I used 3D software to define specific values that I am trying to find with OpenCV.

I've got a plane in the center on my scene. I apply rotations on X, Y or Z. In example bellow, rotations are defined on :

I've got good values for focalLength, fov, etc.

image description

As you can see, the cv2.projectPoints works perfectly on my image.

When I call SolvePnP, the rvecs returns strange values.
For rotation X, I've got 28.939°
For rotation X, I've got 7.916°
For rotation Z, I've got 29.02031°

So when I try to map a plane with WebGL, I've got the result on image bellow (red plane)

image description

So here is my question.
Why SolvePnP doesn't return x:30°, y:0° and z:30° !
It's very strange no ???

Do I have to use Rodrigues somewhere? If yes, how ?
Is there a lack of precision somewhere?

Thanks Loïc

edit retag flag offensive close merge delete


How many points do you have, and what options do you use with SolvePnP?

Tetragramm gravatar imageTetragramm ( 2017-10-25 20:15:29 -0600 )edit