If you can erase the existing phone numbers from the images, than it is no big deal to write new text over these images.
Do you need to erase automatically ? Is the background complex ?
Given the image, here is what I can add:
- detection of the text will require a good OCR function (
http://en.wikipedia.org/wiki/Optical_character_recognition[
^]). You should try a commercial package which has multi-font capability and accepts color images. After getting the text strings, you'll have to analyze to recognize the structure of a phone number. At the same time, you can record the text location, color, font and size.
- erasing the text is more challenging. In the given picture you can wholly fill the red rectangle with solid color, or with the same red gradient by replicating one column over the full width. This cannot be done automatically because you need to recognize that there is a rectangle with a color gradient; and for other images, you may need different solutions. An automatic approach would require state-of-the-art inpainting (
http://en.wikipedia.org/wiki/Inpainting[
^]).
Both processes will be complex to implement and won't give perfect results (say 95% reliability). In your case, I would recommend a semi-automatic approach where for every sample an operator would drag a rectangle around the phone number to be replaced. Simple background reconstruction would work by replicating the horizontal or vertical edges, or interpolating between them.