How to use Imresize without changing physical size?

3 ビュー (過去 30 日間)
Yun Inn
Yun Inn 2012 年 11 月 8 日
'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).

回答 (1 件)

Jan
Jan 2012 年 11 月 8 日
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.

カテゴリ

Help Center および File ExchangeImport, Export, and Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by