Q:

How to remove stamps/watermarks from masked images?

I have an image that I'm masking, but even the text gets thresholded. Here's a thresdholded image below:

As you can see, the time, letters and such are also a part of the mask. I want to get rid of them. How do I go about it?

A:

If the images follow that kind of pattern, you could try to apply a morphological closing.
Whith a mask the right size for the closing and opening, it will get rid of the text in the image, leaving it black.
Note that applying a closing may also slightly modify the rest of the image (for instance, a circular mask may smooth the edges of the circle in the center of the mask).

