Can you use OpenCV solvePNP with a equirectangular image?

At first, you should compute the intrinsic parameters of the camera, that is the focal length, the optical center and the distortion parameters, so afterwards you can compute the pose of your camera. Since your image seems to be somehow wide lens, you should use cv.calibrateCamera() as described here. You should enable the CV_CALIB_RATIONAL_MODEL flag … 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

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

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)