CameraCalibration example computes NAN
I am using OpenCV 3.2.0's example project for achieving CameraCalibration. I have a chessboard checker printed which I use to check for a 4 x 6 pattern of checkers.
For the sample image, I use the following: C:\fakepath\pattern.png
The sample project is provided with the OpenCV Android SDK libraries directly from the OpenCV page: https://opencv.org/releases.html or simply download the version (3.2.0) that I am using: https://sourceforge.net/projects/open...
To locate the sample project, select: opencv-3.2.0-android-sdk.zip > OpenCV-android-sdk > samples > camera-calibration import the project camera-calibration. I have also attached the checkerboard sample images that I used with the project.
When I run the project, it computes NAN for (fx and fy) of the CameraMatrix as well as (k1 and k2) of the DistortionCoefficients.
first: please update to a more recent 3.4 or such. problems with 4 year old 3.0 no more matter to anyone.
still the same problem. if you want ppl to reproduce it, you need a RECENT codebase
I have tested with OpenCV 3.2.0 Library and the problem still persists.
In the meantime I also downloaded OpenCV 3.4.3 Library (released earlier this year) and will try also that CameraCalibration example code.
Please let me know if you have any idea why some variables of the CameraMatrix and DistortionCoefficients could be producing NAN.
Please include sample image(s) and the code in your question. Thanks!
@opalmirror thank you for the suggestion. I have uploaded the project and the library that generate the issue. @berak I hear you. Working on debugging and upgrading my hardware to be able to test the sample project with the 3.4.0 library.
@hayley, no. 3.4.0 is still an outdated release (you seem to confuse it with the current 3.4 github) branch
btw, where is the upload ? (link ?)
@berak, OpenCV site says that 3.4.3 was updated on 2018-08-29: https://opencv.org/releases.html The later versions (4.xx) are beta versions that I rather steer clear off for the moment. By the way, I just updated the note with my links. The attachment option did not like zipped files.
yea, good enough ;)
The CameraCalibrationActivity.java source file has a header comment:
This makes me wonder if you should try with an 11x4 asymmetric circles grid pattern?
Probably best to read the entire header comment on that source file (too large to copy here)
Thanks @opalmirror, that is a good point. In CameraCalibrator.java (line 126), I have tried both options: Calib3d.findCirclesGrid() and showed the circle grid pattern, but also tried Calib3d.findChessboardCorners() and showed the checkerboard grid pattern. In both cases, I can see that I end up with the same NAN result. In CameraCalibrator.java (line 66), I can see that mCameraMatrix and mDistortionCoefficients are not updated. Any ideas why the OpenCV calibrateCamera() does not update these output arrays?