Why images dimensions goes up when cropping it

조회 수: 2 (최근 30일)
Stelios Fanourakis
Stelios Fanourakis 2019년 1월 21일
댓글: Jan 2019년 1월 28일
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?

채택된 답변

Image Analyst
Image Analyst 2019년 1월 21일
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
Image Analyst
Image Analyst 2019년 1월 28일
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 2019년 1월 28일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by