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
pull/17635/head
jsxyhelu 4 years ago
parent daa88c6b9e
commit 476094ad5a
  1. 2
      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;

Loading…
Cancel
Save