# What represents the output of SolvePnP?

Hi there, Im working on object tracking, for this i used SURF for keypoints detection and matching, findHomography(), which gave me the corners of the object im tracking in the video frame, and finally, i am using solvePnP to get the 3d position of the object from the camera. The code i've got is working perfectly, but I dont understand the results.

I mean, the tvector from solvePnp() got the x,y,z coordinates of the object in which frame, to what origin? I dont know, but when im facing the object directly, two of the three coordinates of the tvector show me negative values. I cant understand why.

Maybe someone can help me, or give me a link where this is explained

Thanks

edit retag close merge delete

Sort by ยป oldest newest most voted

The function solvePnP will return the rotation and translation vectors such as we have:

[X Y Z] are the 3D coordinates in the object frame and [u v] the 2D coordinates in the image frame.

So rvec (see Rodrigues to transform a rotation vector to a rotation matrix and vice versa) and tvec are the rotation and translation vectors that express the camera pose. With these information, you can pass from an object frame coordinate to a camera frame coordinate.

Another thing is that the when we change the coordinate from one frame to another frame, the rotation operation operates first. That means the translation vector operates in the camera frame in our case.

You should draw the different frames to get a better view of the problem.

more

Official site

GitHub

Wiki

Documentation