简体   繁体   中英

how to detect blobs in an image using emgu?

The older version of EMGU ( < 4.5.2) we could find blobs easily using the blobdetector and cvblobs methods like this :

     Emgu.CV.Cvb.CvBlobs resultingImgBlobs = new Emgu.CV.Cvb.CvBlobs();
     Emgu.CV.Cvb.CvBlobDetector bDetect = new Emgu.CV.Cvb.CvBlobDetector();
     uint numWebcamBlobsFound = bDetect.Detect(greyThreshImg, resultingImgBlobs);

But in the latest version, there is no CVblobs and BlobDetector, there is a simpleblobdetector class but its useless.

Does anyone knows or can point me to some documentation on how to find blobs in the new version (4.5.5) ?

You can use the SimpleBlobDetector , it is what you are looking for.
You find it "useless" beacuase you didn't set it up correctly according to your usecase.
To set its parameters you need to use SimpleBlobDetectorParams .

Here is an example:

SimpleBlobDetector simpleBlobDetector = new SimpleBlobDetector(new SimpleBlobDetectorParams()
                {
                    FilterByCircularity = true,
                    FilterByArea = true,
                    MinCircularity = 0.7f,
                    MaxCircularity = 1.0f,
                    MinArea = 500,
                    MaxArea = 10000
                });

Here are just some parameters, you can find more about them in Emgu Documentation

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM