Camera pose estimation (OpenCV PnP)

I solved this a while ago, apologies for the year delay. In the python OpenCV 2.1 I was using, and the newer version 3.0.0-dev, I have verified that to get the pose of the camera in the global frame you must: _, rVec, tVec = cv2.solvePnP(objectPoints, imagePoints, cameraMatrix, distCoeffs) Rt = cv2.Rodrigues(rvec) R = Rt.transpose() … Read more

Camera position in world coordinate from cv::solvePnP

If with “world coordinates” you mean “object coordinates”, you have to get the inverse transformation of the result given by the pnp algorithm. There is a trick to invert transformation matrices that allows you to save the inversion operation, which is usually expensive, and that explains the code in Python. Given a transformation [R|t], we … Read more

Get 3D coordinates from 2D image pixel if extrinsic and intrinsic parameters are known

If you got extrinsic parameters then you got everything. That means that you can have Homography from the extrinsics (also called CameraPose). Pose is a 3×4 matrix, homography is a 3×3 matrix, H defined as H = K*[r1, r2, t], //eqn 8.1, Hartley and Zisserman with K being the camera intrinsic matrix, r1 and r2 … Read more