Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a few images in default.aspx,
and some of the images are having phone numbers like
1-1234-22222.
now, I want to change the phone numbers dynamically without effecting the quality of
the image.

any help would be thankful and really appreciated.


Thanks & Regards,
Pawan
Posted

There could not be perfect universal automatic solution to this problem in principle, as you're dealing with insufficient information. Some part of your background image is hidden behind the images of the digits. You should change the digit; and then you need to expose some part of the background image which was hidden by the digit. What is supposed to be in the exposed area is completely unknown to you.

All you can do is to make a guesswork and mimic missing information based on general pattern of the background image. This task cannot have a general solution; there can be multiple different solutions of different "subjective quality"; the notion of "quality" itself is not defined and can be estimated using different criteria, so your requirement "without effecting the quality of the image" simply does not have strict sense.

You can suggest a special solution, but your single sample is not enough; one needs to see all possible cases of backgrounds. For example, the red background under the telephone number in the image you reference is restored using the following operation: copy a small rectangular area left (or right) of telephone number and clone it horizontally to cover all the area occupied by the number. You could find a "common denominator" algorithm for a complete set of all possible image and automatically recognize the area of the telephone number, but only based on precise and comprehensive description of a general case of the image.

—SA
 
Share this answer
 
v2
Comments
thatraja 3-Aug-11 2:23am    
Nice answer SA, 5!

Any link(s) please, Thanks.
Sergey Alexandrovich Kryukov 3-Aug-11 2:32am    
Thank you, Raja, but... what links? This is pure logic.
--SA
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.
 
Share this answer
 
v2
Comments
Pawan Kiran 2-Aug-11 12:21pm    
yes, i need to erase automatically and the background in not much complex.
let me know further on this please..
YvesDaoust 2-Aug-11 12:31pm    
Then I assume your problem is to find the phone number in the image. Can you predict this position ? Are the characters well contrasted ? Is there other text nearby ? Do you know the size ?

Showing a few samples would be very helpful.
Pawan Kiran 2-Aug-11 13:38pm    
please find the sample image in the below url http://www.screencast.com/t/TnapOsNOr
and i don't know the exact size and also position may vary some times.
1- Rent a Photosoft guy that can render a copy of your images without Numbers!
2- Use any Image editing program to add any thing you like to the image.
3- Do not forget to keep a copy of the images in step #1 :)

==> if the numbers are verying or you need to produce several copies I can help you by writing a very small peice of software that helps you to generate billions of copies of the same image with different numbers on each ...

if so I can attach the solution here :)
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900