Merge pull request #4022 from LaurentBerger:ExampleBLOB_MSER

This commit is contained in:
Vadim Pisarevsky
2015-05-28 15:00:36 +00:00
2 changed files with 537 additions and 2 deletions

View File

@@ -266,6 +266,8 @@ void SimpleBlobDetectorImpl::findBlobs(InputArray _image, InputArray _binaryImag
continue;
}
if(moms.m00 == 0.0)
continue;
center.location = Point2d(moms.m10 / moms.m00, moms.m01 / moms.m00);
if (params.filterByColor)
@@ -286,8 +288,6 @@ void SimpleBlobDetectorImpl::findBlobs(InputArray _image, InputArray _binaryImag
center.radius = (dists[(dists.size() - 1) / 2] + dists[dists.size() / 2]) / 2.;
}
if(moms.m00 == 0.0)
continue;
centers.push_back(center);