MATLAB >> How to remove small objects from binary images

by Peter Bone » Thu, 27 Oct 2005 19:20:04 GMT

I have a binary image containing many disconnected objects. What's the fastest way to remove objects whose pixel count is less than some threshold?
At the moment I'm doing it by labeling the regions using bwlabel (image processing toolbox) and then looping through all the label values and finding out the pixel count of each one and then removing it if it's less than the threshold. This is slow and I need it to be fast because I'm doing this on each frame of a video.
I thought about using an erosion technique but I don't want to erode the edges of any of the big objects.

Thanks

Peter Bone

Similar Threads

1. Remove small objects from binary image without erode. - MATLAB

2. removing large objects from a binary image

All, I'm wondering if anyone knows of a function or method 
to remove large objects from a binary image...what I want 
is something similar to bwareaopen, which removes images 
will less than a specified number of pixels, but in reverse.

Thanks in advance for any help

3. Remove small objects - MATLAB

4. How to remove the small circle from Image?

5. removing an object from an image - MATLAB

6. help me to remove unwanted object from image

after using canny algo. for edge detection I found there are many
other unwanted objects, so what can i do to live only the wanted
object in the image.

7. Removing Unwanted objects from a image - MATLAB

8. Convexity or concavity of binary image object

How do you define a convexity of 0? Would that be a circle or a straight line? You should probably calculate the polar signature of the object and do some analysis on it.