OpenCV's Pinhole calibration model reduces FOV, should i use Fisheye?
cv::getOptimalNewCameraMatrix can do the job.
OpenCV undistorts only a central part of fisheye image
I analyzed a lot of papers in the last 2 weeks. I think I found the source of the problem. OpenCV 3.4.0 fisheye undistortion method is based on a pin-hole camera model. We have an angle between the optical axis of the camera and the ray of light from some object. We also have an angle between the direction to an undistorted point of this object and the camera optical axis. If the fisheye image was undistorted correctly, these two angles would be equal. FOV of my fisheye camera is 180 degrees. It means that distance fromthe undistorted image center and the point corresponding to the edge of the undistorted image is equal to infinity.
In other words if we have a fisheye camera with FOV around 180 degrees, undistortion (via OpenCV) of 100% of fisheye image surface is impossible.
OpenCV - Calibrate fisheye lens error (Ill-conditioned matrix)
I think it is because your variable calibration_flags has CALIB_CHECK_COND set.
Try disabling this flag. Without it I was able to undistort your images (see links below).
I am not sure what this check is for (the documentation is not very explicit). This flag reject some images¹ of my gopro hero 3 even when the chessboard is visible and detected. In my case one image among 20 is not passing this test. This image has the chessboard close to the left border.
- https://i.stack.imgur.com/m2WF6.jpg
- https://i.stack.imgur.com/KiTRz.jpg
- https://i.stack.imgur.com/MhHyN.jpg
- https://i.stack.imgur.com/pSiyG.jpg
- https://i.stack.imgur.com/drXSL.jpg
- https://i.stack.imgur.com/DDze1.jpg
- https://i.stack.imgur.com/b6l8f.jpg
- https://i.stack.imgur.com/9MrAk.jpg
- https://i.stack.imgur.com/WYmg5.jpg
- https://i.stack.imgur.com/rmJ5Q.jpg
- https://i.stack.imgur.com/K8k8Y.jpg
- https://i.stack.imgur.com/MiBER.jpg
¹ in OpenCV versions >= 3.4.1 the error message tells you which image is not passing the test
Related Topics
What's the Standard/Official Name for Universal References
How to Get the Address of the Std::Vector Buffer Start Most Elegantly
Calling Erase with Iterator VS Const_Iterator
How to Decide If a Template Specialization Exist
C++: Calling Member Function via Pointer
C++11 'Native_Handle' Is Not a Member of 'Std::This_Thread'
Why Does C++11 Not Support Anonymous Structs, While C11 Does
String Comparison with the Most Similar String
Create Shared_Ptr to Stack Object
How Is Floating Point Conversion Actually Done in C++(Double to Float or Float to Double)
C++ Sqrt Function Precision for Full Squares
Clang-Omp in Xcode Under El Capitan
Mapping Elements in 2D Upper Triangle and Lower Triangle to Linear Structure