why won't imshow display an image?

11 views (last 30 days)
N/A
N/A on 13 Sep 2015
Commented: Image Analyst on 13 Sep 2015
In following a demonstration I typed
>> I=imread('pout.tif');
>> imshow(I)
To which MATLAB (my version is R2014a) responded:
Attempt to call constructor image with incorrect letter case.
Error in basicImageDisplay (line 24)
hh = image(cdata, ...
Error in imshow (line 266)
hh = basicImageDisplay(fig_handle,ax_handle,...
I have tried nothing and it still won't work! Does anyone know how I can appease MATLAB?

Answers (1)

Image Analyst
Image Analyst on 13 Sep 2015
Run this code:
% Check that user has the Image Processing Toolbox installed.
hasIPT = license('test', 'image_toolbox');
if ~hasIPT
% User does not have the toolbox installed.
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
See if it tells you that you don't have the Image Processing Toolbox. I believe imshow() wasn't added to base MATLAB until after the version you have.
  2 Comments
N/A
N/A on 13 Sep 2015
Ok I ran that code (in the editor) to which MATLAB returns:
>> ihmo %which is what I named it
Warning: Function image has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.
Ok... I may have done something wrong there, but I still found the concept of me-not-having-the-toolbox a logical explanation. So I've downloaded a trial version of the toolbox and set the path name so MATLAB could find it. Yet it still can't successfully execute my earlier code.
Furthermore, just as a test, before I got the new toolbox I asked MATLAB >>help imshow
and it did indeed give an extensive description of the function leading me to believe it recognizes imshow as an old friend.
...then again I am quite the beginner and so I'm starting to suspect I have overlooked something more
Image Analyst
Image Analyst on 13 Sep 2015
Yes you did something wrong. My code does not even call the function "image()". Anyway, that is just a warning and the code should still run, or produce an actual error message.
What does this say:
>> which -all image
You may have your own function called image.m. If you do, you should rename it because it's trying to use that instead of the built-in function.
Otherwise, you should call technical support. They are always willing to help you get a trial toolbox to work.

Sign in to comment.

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!