Why does the IMPIXEL command in the Image Processing Toolbox 3.2 (R13SP1) fail to work after I have zoomed into my image?

6 views (last 30 days)
I use the following code to display an image:
figure;
imshow('rice.png');
I then zoom in the image by clicking on the "Zoom In" button on the figure toolbar. After zooming in, I use the IMPIXEL function to obtain the pixel RGB values, using the following syntax:
val = impixel;
However, the cursor does not change into the expected crosshair shape, and I cannot select any pixels on the image. I have to use Ctrl+C to exit the IMPIXEL environment.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
In Image Processing Toolbox 3.2 (R13SP1), the IMPIXEL command does not work when preceded by interactively zooming into the image.
As a workaround, you can use the ZOOM command to zoom in noninteractively. For example,
figure
imshow(imread('rice.png'))
zoom(2)
val = impixel;
Alternately, call the ZOOM function before performing the interactive zooming and then call the ZOOM function again after you are finishing zooming to exit the zooming environment. You can then call IMPIXEL. For example,
figure
imshow(imread('rice.png'))
zoom on
%Do some zooming things here
zoom off
val = impixel;

More Answers (0)

Categories

Find more on Visual Exploration in Help Center and File Exchange

Products


Release

R13SP1

Community Treasure Hunt

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

Start Hunting!