MATLAB 程序运行一直说我未定义函数或变量

nuoniou 2016-05-27 11:24:43
附上程序:
img = imread('C:\Users\lenovo\Desktop\test\our saliency model\JuddSaliencyModel\JuddSaliencyModel\sampleimage.jpeg');
[w, h, c] = size(img);
dims = [200, 200];
img = imresize(img, dims);
Nsc = maxPyrHt(dims, [15 15])-1; % Number of scales
edges = 'reflect1';
pyrFilters = 'sp3Filters';

% Find the Steerable Pyramid elements
[pyr, ind] = buildSpyr(double(mean(img,3)), Nsc, pyrFilters, edges);
features = zeros(dims(1)*dims(2), length(ind)-1);

for b=1:length(ind)-1
out = pyrBand(pyr,ind,b);
absOut = abs(out);
% Low pass the band with a gaussian filter
gf = fspecial('gaussian', 6, 2);
absOutBlurred = imfilter(absOut,gf,'replicate');
absOutMean = absOutBlurred/mean(mean(absOutBlurred)); % Divide the band by the mean
absOutMeanResized = imresize(absOutMean, dims); %this reinterpolates the band to be the same size as the image.
% Fill in features
features(:, b) = absOutMeanResized(:);
end

if nargout<1
for b = 1:13
subband = reshape(features(:, b), dims);
subplot(3, 6, b); imagesc(subband); title(strcat('band=', num2str(b))); %colorbar;
end
end

然后显示“未定义函数或变量 'maxPyrHt'。”
额……请问问题是在哪里
...全文
33616 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
yangliupiaoyang 2017-04-13
  • 打赏
  • 举报
回复 1
那个函数在matlabPyrTools包中,需要自己下载
paschen 2016-05-27
  • 打赏
  • 举报
回复
这个函数的m文件放到脚本目录下,另外文件名与函数名要相同
赵4老师 2016-05-27
  • 打赏
  • 举报
回复
未定义函数maxPyrHt

3,423

社区成员

发帖
与我相关
我的任务
社区描述
其他开发语言 其他开发语言
社区管理员
  • 其他开发语言社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧