下载的matlab图像分类程序,运行出错,请大神指点

LHLHLHH 2020-05-23 10:57:57
出错提示:
错误使用 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
...全文
272 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
Simple-Soft 2020-05-24
  • 打赏
  • 举报
回复
可能文件就是不存在吧?检查一下

24,854

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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