Ask Your Question
0

How do I call SimpleBlobDetector::create from C++ in opencv 4.3.0?

asked 2020-05-17 17:19:35 -0500

dslate1 gravatar image

updated 2020-05-18 12:45:40 -0500

supra56 gravatar image

I am trying to update a C++ program that uses OpenCV from version 3.1.0 to 4.3.0. The following code used to work:

SimpleBlobDetector::Params Params;      // set up parameters for blob detector
Params.thresholdStep        = T.Pars[  1];
Params.minThreshold     = T.Pars[  2];
Params.maxThreshold     = T.Pars[  3];
Params.minRepeatability     = T.Pars[  4];
Params.minDistBetweenBlobs  = T.Pars[  5] * Diag;
Params.filterByColor        = T.Pars[  6];
Params.blobColor        = T.Pars[  7];
Params.filterByArea     = T.Pars[  8];
Params.minArea          = T.Pars[  9] * Area;
Params.maxArea          = T.Pars[ 10] * Area;
Params.filterByCircularity  = T.Pars[ 11];
Params.minCircularity       = T.Pars[ 12];
Params.maxCircularity       = T.Pars[ 13];
Params.filterByInertia      = T.Pars[ 14];
Params.minInertiaRatio      = T.Pars[ 15];
Params.maxInertiaRatio      = T.Pars[ 16];
Params.filterByConvexity    = T.Pars[ 17];
Params.minConvexity     = T.Pars[ 18];
Params.maxConvexity     = T.Pars[ 19];
cv::Ptr<cv::SimpleBlobDetector> Detector = cv::SimpleBlobDetector::create( Params);  // create blob detector

But in 4.3.0 I get the error:

error: no matching function for call to 'cv::SimpleBlobDetector::create(cv::SimpleBlobDetector::Params&)'

Despite searching around the Web, I remain clueless about how to feed my parameters to SimpleBlobDetector. Can anyone enlighten me with a simple example? Thanks.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
-1

answered 2020-05-17 22:19:33 -0500

dslate1 gravatar image

My mistake: I didn't have the correct include for opencv-4.3.0.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-05-17 17:19:35 -0500

Seen: 66 times

Last updated: May 18