opencvcamera-calibrationpose-estimationopencv-solvepnp

How can I solvePnP with fisheye camera parameters?


I saw that OpenCV's solvePnP() function assume that your camera parameters are from a pinhole model. But I calibrated my camera using cv.fisheye module, so I wanted to know how to use solvePnP with parameters obtained from that fisheye module.

How can I use my fisheye camera parameters with solvePnP()?


Solution

  • According to docs.opencv.org, you have {K, D, rvecs, tvecs} from cv::fisheye::calibrate().

    You can remove the effect of K and D from the input coordinates distorted using cv.fisheye.undistortPoints() See here.

    So the routine must be:

    1. undistorted = cv.fisheye.undistortPoints(distorted, K, D)
    2. cv.solvePnP(objPoints, undistorted, I, D) where I=np.eye(3), D=np.zeros((1,5))

    good luck