Why images dimensions goes up when cropping it

1 visualización (últimos 30 días)
Stelios Fanourakis
Stelios Fanourakis el 21 de En. de 2019
Comentada: Jan el 28 de En. de 2019
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?

Respuesta aceptada

Image Analyst
Image Analyst el 21 de En. de 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 comentarios
Image Analyst
Image Analyst el 28 de En. de 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 el 28 de En. de 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.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Image Data Workflows en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by