|
|
@ -239,13 +239,6 @@ void SimpleBlobDetector::findBlobs(const cv::Mat &image, const cv::Mat &binaryIm |
|
|
|
if (ratio < params.minConvexity || ratio >= params.maxConvexity) |
|
|
|
if (ratio < params.minConvexity || ratio >= params.maxConvexity) |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool blob_valid = true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (moms.m00 == 0.0) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
blob_valid = false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
center.location = Point2d(moms.m10 / moms.m00, moms.m01 / moms.m00); |
|
|
|
center.location = Point2d(moms.m10 / moms.m00, moms.m01 / moms.m00); |
|
|
|
|
|
|
|
|
|
|
@ -267,10 +260,10 @@ void SimpleBlobDetector::findBlobs(const cv::Mat &image, const cv::Mat &binaryIm |
|
|
|
center.radius = (dists[(dists.size() - 1) / 2] + dists[dists.size() / 2]) / 2.; |
|
|
|
center.radius = (dists[(dists.size() - 1) / 2] + dists[dists.size() / 2]) / 2.; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (blob_valid) |
|
|
|
if(moms.m00 == 0.0) |
|
|
|
{ |
|
|
|
continue; |
|
|
|
centers.push_back(center); |
|
|
|
centers.push_back(center); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef DEBUG_BLOB_DETECTOR |
|
|
|
#ifdef DEBUG_BLOB_DETECTOR |
|
|
|
// circle( keypointsImage, center.location, 1, Scalar(0,0,255), 1 );
|
|
|
|
// circle( keypointsImage, center.location, 1, Scalar(0,0,255), 1 );
|
|
|
|