How to remove small CLUTTER from images?
Show older comments
Hi.
How can I remove small clutters in an image? For example in the following image (this is a binary one obtained from the original gray scale image):
I want to remove the sections specified by red regions in this image:
I tried "bwareaopen", but it fills the holes, while I do not want to fill the holes, but want to remove small clutters.
By removing, I mean make those regions WHITE!
P.S., I can do filtering either in grayscale or binary image. Which one is better?
Thanks so much.
Steven
Accepted Answer
More Answers (1)
Spandan Tiwari
on 8 Feb 2014
1 vote
BWAREAOPEN assumes that the objects are white. In your case the objects (regions that you want to remove) are black. So first complement the image using IMCOMPLEMENT, then use BWAREAOPEN to remove the regions, and then use IMCOMPLEMENT to go back to the original polarity.
5 Comments
Steven
on 8 Feb 2014
Image Analyst
on 8 Feb 2014
That should work, so you did something wrong. Share your code. And, to me, removing small black clutter does mean filling holes. Those small black holes will get filled in. Isn't that what you want? If it's filling all the holes, even big ones, then you have either specified a bad size in bwareaopen, or your image is bounded by a white border all the way around.
Anand
on 8 Feb 2014
Did this not work for you?
>> out = imcomplement(bwareaopen(imcomplement(bw),70));
Steven
on 9 Feb 2014
Image Analyst
on 9 Feb 2014
No, you shouldn't have to remove any manually. Please attach photos showing before and after and indicate which clutter remained that you want to get rid of and think you need to do it manually.
Categories
Find more on Object Analysis in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!