I feel like the answer is right there for me to grasp it, but I can’t.
I would like to erase small pixels in an binary image. Like, everything composed of fewer than e.g. 4 pixels must go (form does not matter too much).
I am analyzing trabeculae and trabecula can not be so small, ergo those small pixels must go to do a correct analysis.
I know I am already using the median filter, but it also erases pixels at the borders of the trabecula (since if there are more black pixels than white, the median will be black).
I know with analyze particles you can select such small bodies, but I do not really know how to do something with them, I just can mark them individually.
My goal is to be able to do this in a macro for many many images.
Thank you very much.
PS: I have posed another question here, but I got no answers. Maybe you can help?