mirror of
https://github.com/opencv/opencv.git
synced 2025-06-11 11:45:30 +08:00
Use“ moms” replace "contourArea"
double area = moms.m00; is same as double area = contourArea(contours[contourIdx]); Not to mention "moms" already calculated here,"contourArea" should not apply
This commit is contained in:
parent
daa88c6b9e
commit
476094ad5a
@ -257,7 +257,7 @@ void SimpleBlobDetectorImpl::findBlobs(InputArray _image, InputArray _binaryImag
|
||||
{
|
||||
std::vector < Point > hull;
|
||||
convexHull(contours[contourIdx], hull);
|
||||
double area = contourArea(contours[contourIdx]);
|
||||
double area = moms.m00;
|
||||
double hullArea = contourArea(hull);
|
||||
if (fabs(hullArea) < DBL_EPSILON)
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user