Commit b1caa4f4 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #13803 from…

Merge pull request #13803 from thangktran:thangktran/fix-misleading-runtime-assertion-calibrateCamera
parents 9e7014b5 a1f4e65d
...@@ -3141,10 +3141,17 @@ static void collectCalibrationData( InputArrayOfArrays objectPoints, ...@@ -3141,10 +3141,17 @@ static void collectCalibrationData( InputArrayOfArrays objectPoints,
for( i = 0; i < nimages; i++ ) for( i = 0; i < nimages; i++ )
{ {
ni = objectPoints.getMat(i).checkVector(3, CV_32F); Mat objectPoint = objectPoints.getMat(i);
if (objectPoint.empty())
CV_Error(CV_StsBadSize, "objectPoints should not contain empty vector of vectors of points");
ni = objectPoint.checkVector(3, CV_32F);
if( ni <= 0 ) if( ni <= 0 )
CV_Error(CV_StsUnsupportedFormat, "objectPoints should contain vector of vectors of points of type Point3f"); CV_Error(CV_StsUnsupportedFormat, "objectPoints should contain vector of vectors of points of type Point3f");
int ni1 = imagePoints1.getMat(i).checkVector(2, CV_32F);
Mat imagePoint1 = imagePoints1.getMat(i);
if (imagePoint1.empty())
CV_Error(CV_StsBadSize, "imagePoints1 should not contain empty vector of vectors of points");
int ni1 = imagePoint1.checkVector(2, CV_32F);
if( ni1 <= 0 ) if( ni1 <= 0 )
CV_Error(CV_StsUnsupportedFormat, "imagePoints1 should contain vector of vectors of points of type Point2f"); CV_Error(CV_StsUnsupportedFormat, "imagePoints1 should contain vector of vectors of points of type Point2f");
CV_Assert( ni == ni1 ); CV_Assert( ni == ni1 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment