MATLAB Answers

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

9 ビュー (過去 30 日間)
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.

採用された回答

MathWorks Support Team
MathWorks Support Team 2009 年 6 月 27 日
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;

  0 件のコメント

Sign in to comment.

その他の回答 (1 件)

Abdullah Abdulrahem
Abdullah Abdulrahem 2020 年 4 月 18 日
It says there is an error of a function when i use impixel, why is that? i need to use the function

  5 件のコメント

表示 2 件の古いコメント
Walter Roberson
Walter Roberson 2020 年 4 月 18 日
What shows up if you execute the commands
ver('images')
license('test', 'Image_Toolbox')
which -all impixel
Image Analyst
Image Analyst 2020 年 4 月 18 日
You forgot to show us what ver() and license() displayed in the command window. You most likely don't have the toolbox. Try this and what do you see:
% Check that user has the specified Toolbox installed and licensed.
hasLicenseForToolbox = license('test', 'image_toolbox'); % Check for Image Processing Toolbox.
% hasLicenseForToolbox = license('test','Statistics_toolbox'); % Check for Statistics and Machine Learning Toolbox.
% hasLicenseForToolbox = license('test','Signal_toolbox'); % Check for Signal Processing Toolbox.
% hasLicenseForToolbox = license('test', 'video_and_image_blockset'); % Check for Computer Vision System Toolbox.
if ~hasLicenseForToolbox
% User does not have the toolbox installed, or if it is, there is no available license for it.
% For example, there is a pool of 10 licenses and all 10 have been checked out by other people already.
ver % List what toolboxes the user has licenses available for.
message = sprintf('Sorry, but you do not seem to have the Image Processing Toolbox.\nDo you want to try to continue anyway?');
reply = questdlg(message, 'Toolbox missing', 'Yes', 'No', 'Yes');
if strcmpi(reply, 'No')
% User said No, so exit.
return;
end
end

Sign in to comment.

Categories

製品


リリース

R13SP1

Translated by