Skip to content

Commit 476094a

Browse files
committed
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
1 parent daa88c6 commit 476094a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/features2d/src/blobdetector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ void SimpleBlobDetectorImpl::findBlobs(InputArray _image, InputArray _binaryImag
257257
{
258258
std::vector < Point > hull;
259259
convexHull(contours[contourIdx], hull);
260-
double area = contourArea(contours[contourIdx]);
260+
double area = moms.m00;
261261
double hullArea = contourArea(hull);
262262
if (fabs(hullArea) < DBL_EPSILON)
263263
continue;

0 commit comments

Comments
 (0)