I want to remove small spots from a greyscale image without affecting the rest of the image
Show older comments
See the attached image for reference. I want to remove the white spot encircled in the image without affecting much the rest of the image. I dont mind losing the dot smaller than the one in the circle but nothing bigger.
I tried bwareaopen but it converts my image to binary which I do not want! I want to keep it in grayscale but remove the dots. thanks for any help!
2 Comments
Julian Hapke
on 15 Jun 2017
I'd suggest you use a binary array of that image as a mask. look for areas in the binary image that are connected and determine the size of those connected regions. if the region in below a threshold, remove it. use
imbinarize
Julian Hapke
on 15 Jun 2017
Edited: Julian Hapke
on 15 Jun 2017
had to read about bwareaopen, seems exactly what you need. you can then use the cleaned binary image as an index to set the pixels of your original image to black or whatever grey you want there.
Accepted Answer
More Answers (0)
Categories
Find more on Red 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!