fix bug #3277 (findCirclesGrid failures):
authorVladislav Vinogradov <vlad.vinogradov@itseez.com>
Tue, 24 Sep 2013 10:45:13 +0000 (14:45 +0400)
committerVladislav Vinogradov <vlad.vinogradov@itseez.com>
Tue, 24 Sep 2013 10:45:13 +0000 (14:45 +0400)
findHomagraphy can return empty Mat in master branch

modules/calib3d/src/circlesgrid.cpp

index 969611f..f44807e 100644 (file)
@@ -836,6 +836,9 @@ Mat CirclesGridFinder::rectifyGrid(Size detectedGridSize, const std::vector<Poin
   Mat H = findHomography(Mat(centers), Mat(dstPoints), RANSAC);
   //Mat H = findHomography( Mat( corners ), Mat( dstPoints ) );
 
+  if (H.empty())
+      H = Mat::zeros(3, 3, CV_64FC1);
+
   std::vector<Point2f> srcKeypoints;
   for (size_t i = 0; i < keypoints.size(); i++)
   {