下载的matlab图像分类程序,运行出错,请大神指点
出错提示:
错误使用 imread>get_full_filename (line 481)
文件 "C:\Users\Administrator\Pictures\Saved Pictures\贝壳图片\6.jpg" 不存在。
出错 imread (line 344)
filename = get_full_filename(fid, errmsg, filename);
出错 photoclassify (line 18)
I = imread(FullPath);
主程序:(包含几个自定义函数)
%图像分类
clc;
FilePath = 'C:\Users\Administrator\Pictures\Saved Pictures\贝壳图片\';
%FilePath = 'D:\Corel\CorelImg1\';
% count of the graph in the same group
kindcount = 50 ;
for kind=0:5
num = 1;
Array = cell(kindcount, 1) ;
for i=1:kindcount
% read every graph in a order of number in a specific range
FileName = sprintf('%d.jpg', kind*100+i-1) ;
FullPath = strcat(FilePath, FileName) ;
I = imread(FullPath);
% 提取图像特征
FR = getFeature(I) ;
% save the feature data in the array.
Array{i} = FR;
wvctor = sofm(FR) ;
wvctor = wvctor' ;
[cout, dim] = size(wvctor) ;
% save the feature data clustered once more in the FRG
FRG(num:num+cout-1, :) = wvctor ;
num = num + cout ;
end
%cluster again from all the graph in the same group
wvctors = sofm(FRG) ;
for i=1:kindcount
one = Array{i};
[c d] = size(one) ;
for j=1:200
vdist = dist(one, wvctors(:, j)) ;
for k=1:c
if (vdist(k)<40)
vdist(k) = 1;
else
vdist(k) = 0;
end
end
P(j) = sum(vdist) ;
end
svmdata(i, :) = P ;
end
svmdata = svmdata/c;
end