How to use Imresize without changing physical size?
3 次查看(过去 30 天)
显示 更早的评论
'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).
0 个评论
回答(1 个)
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Import, Export, and Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!