Python Opencv SolvePnP yields wrong translation vector

妖精的绣舞 提交于 2019-11-27 00:42:43
fraxel

I think you may be thinking of tvecs_new as the camera position. Slightly confusingly that is not the case! In fact its 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 do:

-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...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!