Python Opencv SolvePnP yields wrong translation vector

I think you may be thinking of tvecs_new as the camera position. Slightly confusingly that is not the case! In fact it is the position of the world origin in camera co-ords. To get the camera pose in the object/world co-ords, I believe you need to

-np.matrix(rotation_matrix).T * np.matrix(tvecs_new)

And you can get the Euler angles using cv2.decomposeProjectionMatrix(P)[-1] where P is the [r|t] 3 by 4 extrinsic matrix.

I found this to be a pretty good article about the intrinsics and extrinsics…

Leave a Comment