How to use Imresize without changing physical size?

1 visualización (últimos 30 días)
Yun Inn
Yun Inn el 8 de Nov. de 2012
'A' is a 300X300 matrix with the central 200X200 pixels occupied by a value of 15 (surrounded by remaining pixels value of 0). In the physical world, this area of 200x200 pixels is equivalent to field area of 200mmX200mm. Therefore, pixel resolution is 1mm/pixel.
I need to increase the number of pixels from 300X300 to 1024x1024 without changing the physical size of that area. Imresize can increase number of pixels but because the resolution remains unchanged at 1mm/pixel, the physical size of that area of interest will become bigger as well. How do I keep the physical size to be the same? (effectively changing the pixel resolution).

Respuestas (1)

Jan
Jan el 8 de Nov. de 2012
The information about the pixels/inch is not stored in the image itself. You have to store the resolution in an extra variable, set this to 1024 / 300 and the units "pixels per mm" must be considered also.
Images are simply pixel arrays in Matlab. In consequence they do not have a "physical size". Do you mean the display on the screen or do you want to write the resoltion when you create a TIFF or JPEG? In addition consider a photo stored as JPEG: Then "mm/pixel" is at first meaningless, e.g. when the sky is show with stars, the moon and some clouds.
Please explain, what you actually want to achieve.

Categorías

Más información sobre Get Started with Image Processing Toolbox 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