Python Opencv SolvePnP yields wrong translation vector

前端 未结 1 528
温柔的废话
温柔的废话 2020-11-30 00:38

I am attempting to calibrate and find the location and rotation of a single virtual camera in Blender 3d using homography. I am using Blender so that I can double check my r

相关标签:
1条回答
  • 2020-11-30 01:27

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

    0 讨论(0)
提交回复
热议问题