Why I get error using fspecial in R2015b student use?
9 次查看(过去 30 天)
显示 更早的评论
h=imread('C:\Users\USER\Desktop\bio imaging\pic.jpg');
h2=fspecial('gaussian',[3,3],1);
h3=filter2(h2,h);
imshow(h3/256)
Undefined function 'fspecial' for input arguments of type 'char'.
Is there something wrong with the code? I've tried so many methods to write 'fspecial' but failed.
0 个评论
回答(2 个)
Image Analyst
2016-2-3
This worked for me:
h=imread('cameraman.tif');
h2=fspecial('gaussian',[3,3],1);
h3=filter2(h2,h);
imshow(h3/256)
I don't know what your image is, but I got a different error than you when I tried a color image. What does this say:
which -all fspecial
and if you type ver, does it show the Image processing Toolbox listed?
3 个评论
Walter Roberson
2016-2-3
What did
which -all fspecial
say? If it said that it was not found then the problem is that you have not installed Image Processing Toolkit. You need to go back to your MATLAB installer and request that all the toolboxes you want to use be installed.
Image Analyst
2016-2-3
What does this say:
% 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
which -all fspecial
Walter Roberson
2016-2-3
fspecial is part of the Image Processing toolkit, the license for which is typically included as part of the Student Version license. However you might have purchased one of the more customized Student Version license, or (more likely) you might not have asked for Image Processing Toolkit to be installed at the time you were installing MATLAB.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!