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 at the cv.calibrateCamera() method, which computes for distortion parameters since your image has big distortions.

Now the tricky part
In order to obtain high-quality undistorted images, after you have calibrated your camera, you should use a chess pattern that covers your entire image, in order for the distortion parameters to be computed accurately, since the biggest radial distortions reside on the edge of the image.
Also, in order to compute accurately the solvePnp parameters, you should pick your red dots all over your image.

Leave a Comment