I have an image and I want to remove the black pixels that are on large white objects. I use the function bwareaopen(BW,P), but only removes hole objects, not black pixels. I tried different values P, but failed again.
Why bwareopencan't remove black pixels on white objects and how to remove them?
Picture:

source
share