I'm trying to perform fisheye camera calibration via OpenCV 3.4.0 (C++, MS Windows).
I used cv::fisheye::calibrate to make K and D (camera matrix and radial distortion coeffitients matrix). Then I used cv::fisheye::initUndistortRectifyMap to produce maps for X and Y coordinates. And finally I used cv::remap to undistort image from fisheye camera via maps from initUndistortRectifyMap. Everything looks right, but OpenCV dewarps only a central part of fisheye image. Edges are moved outside. I'd like to dewarp the whole image. I tried to change focal length in K matrix manually, and got undistorted edges, but they became very very blurry. I found some results in this task. For example
https://www.youtube.com/watch?v=Ll8KCnCw4iU
and
https://www.youtube.com/watch?v=p1kCR1i2nF0
As far as you can see these results are very similar with my results. Does anybody have a solution of this problem?
I analyzed a lot of papers last 2 weeks. I think I found the source of problem. OpenCV 3.4.0 fisheye undistortion method is based on pin-hole camera model.We have angle between optical axis of camera and ray of light from some object. We also have angle between direction to undistorted point of this object and camera optical axis. If fisheye image was undistorted correctly, these two angles should be equal. FOV of my fisheye camera is 180 degrees. It means that distance from undistorted image center and point corresponding to edge of undistorted image is equal to infinity. In other words if we have a fisheye camera with FOV about 180 degrees, undistortion (via OpenCV) of 100% of fisheye image surface is impossible.
It can be achieved, only that using a projection instead of trying to undistort it.
More info here OpenCV fisheye calibration cuts too much of the resulting image
Example result:
来源:https://stackoverflow.com/questions/48990136/opencv-undistorts-only-a-central-part-of-fisheye-image