All,
I need to know how to stretch an image for further work.
for example, I have the next two images:

I want that the numbers will fill the entire square like this:

any help will be greatly appreciated.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming that the background is a constant value, and that the image doesn’t have any constant rows, cols, and that the useful image is a rectangle in the middle of the larger image with background:
Now that you have an image with no background it is easy to stretch it using imresize, assuming you have the imageprocessing toolbox.
To remove the artifact, first descritize the extracted character:
And then extract the correct rows from the non descritized image
Lowering the number of descritization levels will help to remove more of the artifact, but will make it more likely to mistakenly remove part of the character. I also forsee some problems with numbers like 1 or 7 where part of the character can be mistaken for artifact.