Page 1 of 1

Removing text from image

Posted: 2007-10-08T12:50:43-07:00
by mzorova
I have a map that has a bunch of streets and names on it that I am trying to remove - to be replaced by some averaging of the background. Some text is large (so the averaging diameter has to be large) and some text is small (so averaging diameter needs to be small)

I am currently doing this via a Java program and would like to see if there is anyway to use IM to do the same. The background only uses about 4-5 colors - so I need to replace ANY pixel that is not one of those 4 colors with the above kind of averaging (to effectively remove the text)..

I can upload the images, but they are pretty large images (and hence the research into IM)..

Re: Removing text from image

Posted: 2007-10-09T12:48:39-07:00
by Bonzo
Could you just paste a section of an image if they are large?

Re: Removing text from image

Posted: 2007-10-15T23:11:54-07:00
by anthony
Sounds like a masked mean filter.

generate a second image that replaces each pixel with the most common surrounding color.

Now generate a mask from the original, and make all the test black, and all the other background colors white (or visa-versa if that is easier).

Not you can compose a masked copy of the second image on top of the the first to remove the text.
http://imagemagick.org/Usage/compose/#mask

If you have a small 'cropped' example I am sure either myself or bonzo, or someone can generate the exact commands you need.

Re: Removing text from image

Posted: 2007-10-16T11:49:13-07:00
by mzorova
Image