From 476094ad5af304375bb557e447b129a6bb615cb4 Mon Sep 17 00:00:00 2001 From: jsxyhelu Date: Tue, 23 Jun 2020 20:39:55 +0800 Subject: [PATCH] =?UTF-8?q?Use=E2=80=9C=20moms=E2=80=9D=20replace=20"conto?= =?UTF-8?q?urArea"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit double area = moms.m00; is same as double area = contourArea(contours[contourIdx]); Not to mention "moms" already calculated here,"contourArea" should not apply --- modules/features2d/src/blobdetector.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/features2d/src/blobdetector.cpp b/modules/features2d/src/blobdetector.cpp index c973b09764..d07e8bae83 100644 --- a/modules/features2d/src/blobdetector.cpp +++ b/modules/features2d/src/blobdetector.cpp @@ -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;