Ask Your Question
1

how to remove blobs with SimpleBlobDetector

asked 2013-04-13 12:29:23 -0600

djou gravatar image

updated 2013-04-13 12:37:00 -0600

Hello,

Im trying to use SimpleBlobDetector to remove small object from my binary image,

first I creat an object of type SimpleBlobDetector, and then detect blobs like this code below

    SimpleBlobDetector blobDetector( params );
    blobDetector.create("SimpleBlob");      
    blobDetector.detect( src, keyPoints );

This code detect for example 2 blobs from 3 according to the parameters. Now my question is how to delete the unwanted blob from the mage...?

I have two other questions, how to get the coordinates of blobs, and can we frame a blob in a rectangle?

thanks :)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2013-04-14 03:26:10 -0600

If the objects you want to remove are literally only several pixels large, than simply apply erosion and dilation morphological operators. The will yield better results if a far simpler way.

  • By erosion you cut of 1 layer of pixels of all blobs
  • Dilation then adds again 1 layer of pixels onto all blobs

If you perform enough erosion for small blobs to disappear, you can easily reconstruct the larger ones with a followed dilation operator.

edit flag offensive delete link more

Comments

1

Thanks for replying me :) ... Ive tried erosion and dilation but didn't work, look to the image I linked here http://answers.opencv.org/question/10415/remove-small-objetc-from-image-after-segmentation/ ....

djou gravatar imagedjou ( 2013-04-14 07:02:42 -0600 )edit
1

Morphological operations will change shape of tumore area. I think, you can use contours detection and left only contour with area in some range. If range of area is not enough u can use percent of wight pixels in bounding rect or convex hull, ellipticity and other features.

fedor gravatar imagefedor ( 2015-04-22 09:58:26 -0600 )edit

Question Tools

Stats

Asked: 2013-04-13 12:29:23 -0600

Seen: 4,311 times

Last updated: Apr 14 '13