imshow does not work in 2014a
Show older comments
simple tif file, I try to display but Matlab 2014a throws an error and says
Undefined function 'imshow' for input arguments of type 'char'
imshow('test.tif');
that's my command that I try and I've got all the possible toolboxes installed and licensed on my machine. Any inputs will help. Its a straight rip-off from the online help section for imshow.
Answers (7)
Image Analyst
on 26 Aug 2014
Poorna, run this code and tell me what you see:
% 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.');
uiwait(warndlg(message));
end
2 Comments
Image Analyst
on 30 Jan 2015
Suraj's reply moved here since it's not an answer to the original question.
I think i have gone through the list of toolboxes installed and licensed. I have possibly got all the available toolboxes supplied by Mathworks. If I can do an imread, i must possibly be able to do an imshow.
Is there a possibility that these two simple functions will be part of two different toolboxes.
Image Analyst
on 30 Jan 2015
Edited: Image Analyst
on 30 Jan 2015
Suraj, do you still have the problem?
Note that in R2014a imread() was in base MATLAB but imshow() was not. imshow() became part of base MATLAB with the R2014b release. Have you upgraded to R2014b yet? You should not have the problem if you do.
Mikhail
on 26 Aug 2014
1 vote
That is because you don't have Image Processing Toolbox required for imshow
4 Comments
Mikhail
on 26 Aug 2014
Also try to enter ver in command line and check if you have Image Processing Toolbox
Mohammad Abouali
on 28 Jan 2015
Edited: Mohammad Abouali
on 28 Jan 2015
imshow() is also part of regular/basic MATLAB. You don't need image processing Toolbox.
Mohammad Abouali
on 28 Jan 2015
Yes, you are right. It wasn't part of 2014a MATLAB.
Mikhail
on 26 Aug 2014
0 votes
No! Imread doesn't require Image Processing Toolbox.
Once again: type ver in command line and check if you have Image Processing Toolbox.
Suraj Nagaraj
on 27 Aug 2014
0 votes
1 Comment
Eric
on 28 Jan 2015
This is old, but in case anybody else is reading this thread:
The code that Image Analyst supplied for hasIPT only checks that a license is available for the Image Processing Toolbox, not that the software has been installed.
One needs to also do what Mikhail suggested: Type ver at the command line and see what is actually installed.
It is entirely possible to be licensed for a product but to not have the software installed for use.
-Eric
Bhavna Rajasekaran
on 28 Jan 2015
0 votes
I have the same problem, it seems imshow() is shifted from image processing toolbox to general matlab commands, but is apparently not installed?? I am using R2014b.. Any clues??
3 Comments
I can confirm that inshow() does not require the Image Processing Toolbox for Matlab R2014b. I ran the following:
data = imread('moon.tif');
imshow(data)
license('inuse')
and the only license reported was Matlab.
which imshow
returns C:\Program Files\MATLAB\R2014b\toolbox\matlab\images\imshow.m. You can look to see if that file exists and if that directory is on your path.
Good luck,
Eric
John D'Errico
on 28 Jan 2015
As Eric says, imshow is now in MATLAB, since I lack the IPT, but I do have imshow.
Eric
on 28 Jan 2015
imshow appeared in Matlab with Release R2014b. This is mentioned in the release notes.
Muhammad Zaigham Zaheer
on 14 May 2015
Edited: Muhammad Zaigham Zaheer
on 14 May 2015
I am also having this same problem in 2014b. This code below works fine when I remove the imshow command. But gives error when I imshow command is included.
[imgs labels] = readMNIST('t10k-images-idx3-ubyte', 't10k-labels-idx1-ubyte', 50, 10);
for i=1:50
im=imgs(:,:,i);
name = ['image',num2str(i),'.jpeg'];
imwrite (im,['image',num2str(i),'.jpeg']);
end
imshow(im);
2 Comments
Image Analyst
on 14 May 2015
You forgot to include your error. And did you try the code I posted above. Also try
which -all imshow
ver
and tell us what it says
Muhammad Zaigham Zaheer
on 20 May 2015
Thanks for the reply. But it was may be some corrupted file problem. I have re-installed matlab and everything is working fine now.
vasanthkumar
on 8 Feb 2023
0 votes
Hi, i am using MATLAB R2014a, i have been facing the same issue of "Undefined function 'imshow' for input arguments" ...i can't upgrade to R2014b right now, any possible solution or alternaties instred of "imshow" any other command to repalce it and Run?
4 Comments
Image Analyst
on 8 Feb 2023
@vasanthkumar you wouldn't "upgrade" to a 8 year old version anyway. You'd upgrade to R2022b. Can you do that? If not replace imshow() with image which is in base MATLAB and you definitely have that.
We'd need to know how you're using imshow(), the actual full error message, and whether you have Image Processing Toolbox installed. In versions prior to R2014b, imshow() is not in the base toolbox, but in IPT.
If you don't have IPT, but want to replicate imshow() behavior instead of dealing directly with the behavior of image(), you could start with:
inpict = imread('peppers.png');
myimshow(inpict)
function varargout = myimshow(varargin)
% use image(), but ...
himg = image(varargin{:});
% preserve image aspect ratio
% get rid of ticks and labels
% get rid of excess padding around axes
hax = get(himg,'parent');
axis(hax,'off','tight','image')
set(hax,'position',[0 0 1 1])
% return handle to image object if requested
if nargout == 1
varargout{1} = himg;
end
end
imshow() does have some other features, but again, we'd have to know how you intend to use it.
Walter Roberson
on 8 Feb 2023
The main other feature for imshow is if ndims is 2 and isinteger then colormap(grey)
Ugh. I forgot about that. To be fair, I'm also ignoring a lot of other things too.
There user would still have to basically use image() syntax, considering I'm just shoveling varargin straight into image(). It'd probably be easier to just shove everything into image(), let it do its input parsing, and then check CData than trying to figure out which argument is the image.
Also, consider that something like imshow(indexedimage,map) sets the cdatamapping to 'direct' instead of 'scaled'. Also, imshow() supports a displayrange parameter.
The more completely the behavior is supposed to match, the fewer crude simplifications are available. I'd rather give a narrow-purpose workaround than a full-fledged replacement, but it's up to the user to say what they need.
Categories
Find more on Image Processing Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!