Ask Your Question

how to remove blobs with SimpleBlobDetector

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

djou gravatar image

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


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.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

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

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



Thanks for replying me :) ... Ive tried erosion and dilation but didn't work, look to the image I linked here ....

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

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 -0500 )edit
Login/Signup to Answer

Question Tools


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

Seen: 2,732 times

Last updated: Apr 14 '13