Why does the ZOOM icon in the Figure toolbar not zoom into a region in the image properly in MATLAB 7.4 (R2007a)?

2 views (last 30 days)
I display an image using a general image display function such as IMSHOW. Now, if I try to zoom in on a region in this image using the zoom icon in the figure toolbar by clicking and dragging the cursor, I expect MATLAB to zoom in to that region in the image.
Instead I observe that the resultant image includes regions of the image that were outside the region I had selected.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This is an expected behavior of the ZOOM function in MATLAB 7.4 (R2007a).
When an image is displayed using a function like IMSHOW, the axis property 'DataAspectRatioMode' is set to 'manual' and the 'DataAspectRatio' to [1 1 1]. This is done to maintain the aspect ratio of the image, which is generally intended.
When the 'DataAspectRatioMode' property is set to 'manual' and then you select a region in the image, the ZOOM function rescales the region to fit the aspect ratio set in the 'DataAspectRatio' property. Hence, when you select a region, the ZOOM function will select the longer side of the region and recompute the shorter side of the region as per the aspect ratio. This recomputed rectangle now becomes the new region to zoom in to.
If you change the 'DataAspectRatioMode' property to 'auto', then the ZOOM function does not rescale the region and simply zooms in to the region selected.

More Answers (0)

Categories

Find more on Visual Exploration in Help Center and File Exchange

Products


Release

R2007a

Community Treasure Hunt

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

Start Hunting!