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

Computing x,y coordinate (3D) from image point

Given your configuration, errors of 20-40mm at the edges are average. It looks like you’ve done everything well. Without modifying camera/system configuration, doing better will be hard. You can try to redo camera calibration and hope for better results, but this will not improve them alot (and you may eventually get worse results, so don’t … Read more