Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5998575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:25:33+00:00 2026-05-23T00:25:33+00:00

All, I need to know how to stretch an image for further work. for

  • 0

All,

I need to know how to stretch an image for further work.

for example, I have the next two images:

enter image description here enter image description here

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

enter image description here enter image description here

any help will be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T00:25:33+00:00Added an answer on May 23, 2026 at 12:25 am

    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:

    colsWithImg = find(any(abs(diff(img)))); % idxs of cols with any img in it.
    rowsWithImg = find(any(abs(diff(img'))));
    imgWithNoBG = img(min(rowsWithImg):max(rowsWithImg),min(colsWithImg):max(colsWithImg));
    % this will also work: but you will lose any constant rows / cols
    % imgWithNoBG = img(rowsWithImg,colsWithImg);
    

    Now that you have an image with no background it is easy to stretch it using imresize, assuming you have the imageprocessing toolbox.

    resizedImg = imrezize(imgWithNoBG,newSize);
    

    To remove the artifact, first descritize the extracted character:

    descImg = floor((nDescLevels*imgWithNoBg)/max(max(imgWithNoBg)))
    colsNoArtifact = find(any(abs(diff(descImg))));
    rowsNoArtifact = find(any(abs(diff(descImg'))));
    

    And then extract the correct rows from the non descritized image

    img3 = imgWithNoBG(min(rowsNoArtifact):max(rowsNoArtifact),min(colsNoArtifact):max(colsNoArtifact));
    

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to know if all the client-side validator checks have succeeded, or if
Hallo all. if i have week number 42 and i need to know what
I just have the array of 15 values that all need to be inserted
I have about 45 decently large images (about 680x1000) that need to be loaded
All you need to know is in the question. I have a search query
I'm making an iphone app. All you need to know is that there is
Hai all i need to know how i can make next page in jQuery.
I would like to compare two DataTables. All I need to know is are
i need all permutation from N lists, i dont know N until the program
I am doing a project, for which I need to know all the wikipedia

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.