Ask Your Question

Revision history [back]

Distance between Camera and Marker (calculate with Tvec)

So i got a marker of known size and set the world coordinate origin to the center of the marker. With solvePnP i calculated the corresponding rotation vector as well as the translation vector. Camera calibration is done in advance. When i project points given in world coordinates it shows them correctly on the display in pixel coordinates. Now i want to calculated the distance between the camera and the marker. If i understood everything correctly, the shift between the world coordinate system and the camera coordinate system is given by the translation vector. Accordingly, the distance between the marker and the camera should be the norm of the vector, given by -Rvec(inverse)*Tvec. but if i do that the distance is way too high (about 2,5x). Am i missing something here? How can i get the right distance between the camera and the marker?

Thanks in advance