I am currently trying to edit this image to remove the bubbled parts of the image, the white areas, turning them black. So that when I create a binary image of this, the white bubbles will be considered under the black area. I have tried imareaopen but would like to get rid of the large sized white marks only. This option removes my smaller black spots which I would like to keep. The gray portion is the surface and I would like to have that appear as white in the binary image but everything else black.
This is my sample code that I have used.
and this is the masked result. However, the bubbles appear white as the surface did and I want the bubbled areas to be black.