Skip to content

Commit 5ca7dcc

Browse files
author
Alexander Duda
committed
Fix error message fisheye CALIB_CHECK_COND
The old error message was not giving any hint which input array (image) led to an ill conditioned matrix. This made it near impossible to identify poor images in a larger set. A better approach would be to implement a checker function which gives each image a rating before the real calibration is performed. This could also include some image properties like sharpness, etc.
1 parent e5aa213 commit 5ca7dcc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/calib3d/src/fisheye.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1401,7 +1401,8 @@ void cv::internal::CalibrateExtrinsics(InputArrayOfArrays objectPoints, InputArr
14011401
if (check_cond)
14021402
{
14031403
SVD svd(JJ_kk, SVD::NO_UV);
1404-
CV_Assert(svd.w.at<double>(0) / svd.w.at<double>((int)svd.w.total() - 1) < thresh_cond);
1404+
if(svd.w.at<double>(0) / svd.w.at<double>((int)svd.w.total() - 1) > thresh_cond )
1405+
CV_Error( cv::Error::StsInternal, format("CALIB_CHECK_COND - Ill-conditioned matrix for input array %d",image_idx));
14051406
}
14061407
omckk.reshape(3,1).copyTo(omc.getMat().col(image_idx));
14071408
Tckk.reshape(3,1).copyTo(Tc.getMat().col(image_idx));

0 commit comments

Comments
 (0)