You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Runtime assertions of calib3d cv::calibrateCamera() in some cases misleading. #6002
The runtime assertions of calibrateCamera() from the calib3d module may state misleading exception messages if one of the vectors given to calibrateCamera in the parameter imagePoints is empty.
The exception is thrown in collectCalibrationData() Line 3055 and will look like this
OpenCV Error: Unsupported format or combination of formats (imagePoints1 should contain vector of vectors of points of type Point2f) in collectCalibrationData,
file D:/dev/MINGW-packages/mingw-w64-opencv/src/opencv-3.1.0/modules/calib3d/src/calibration.cpp, line 3063
terminate called after throwing an instance of 'cv::Exception'
what(): D:/dev/MINGW-packages/mingw-w64-opencv/src/opencv-3.1.0/modules/calib3d/src/calibration.cpp:3063:
error: (-210) imagePoints1 should contain vector of vectors of points of type Point2f in function collectCalibrationData
stating that the types/content of the vector is in an invalid format, while the real problem is that one of the vectors inside imagePoints is empty, causing the checkVector in Line 3053 to fail.
Please add a separate error case and message that states that the vector is empty, before throwing wrong assertions about its contained type. The same case may also apply to the objectPoints Parameter.
A more helpfull ( and less missleading ) error message may save someone else some precious debugging time.
changed the title [-]Runtime assertions of calib3d cv::calibrateCamera() misleading.[/-][+]Runtime assertions of calib3d cv::calibrateCamera() in some cases misleading.[/+]on Jan 20, 2016
Activity
[-]Runtime assertions of calib3d cv::calibrateCamera() misleading.[/-][+]Runtime assertions of calib3d cv::calibrateCamera() in some cases misleading.[/+]Adamwgoh commentedon May 19, 2017
+1 On this. Experienced the same situation. Thanks for putting this issue out.
Cpicon commentedon Feb 9, 2019
+1. Please, I wasted 2 hours trying to find the error. Maybe, other users could save time not searching for the type Vector.
thangktran commentedon Feb 10, 2019
I'm working on a fix for this.
calib3d: Fix calibrateCamera() misleading error.
calib3d: Fix calibrateCamera() misleading error
calib3d: Fix calibrateCamera() misleading error