Why images dimensions goes up when cropping it

2 views (last 30 days)
I enclose two images. Both are the same image.
The original ('A1b.jpg') has the beggining point of the imaging window at [136,120] and end point at [548,120].
The ('A1b(al).jpg') is the same image cropped but the imaging window length is outrageous enlarged with starting point at [180,96] and end point at [1237,96].
Why this difference? I only cropped the image under certain dimensions. Why it took that scaling and stretching?

Accepted Answer

Image Analyst
Image Analyst on 21 Jan 2019
Looks like you're saving the figure window itself instead of the image in the axes. When you save the figure window, you get all that white padding, and the image is screen pixels, which may not be the same as the underlying image pixels because the image may have been zoomed or subsampled to fit your figure window.
  15 Comments
Image Analyst
Image Analyst on 28 Jan 2019
If you did something to the image, like drew things into the overlay above it, then you'll need to use getframe() to get the image "as you see it".
Jan
Jan on 28 Jan 2019
What a pity that evolution_LGD does not contain a useful help text, which explains, what the output is. Using getframe has the drawback, that you work with screen resolution. If the processed image is displayed with a scaling, the data are resampled. Therefore it might be more useful to obtain the output of the contour as a matrix with the original dimensions as the image and use it as overlay to join it with the image.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!