matlab图像批处理的问题

2024-11-29 05:41:08
推荐回答(1个)
回答1:

str = 'C:\'; %输入路径
strAll = '*.jpg';%输入图像格式设置

path = strcat(str, strAll);
file = dir(path);
for ii = 1 : length(file)

ImgPath = strcat(str, file(ii).name);
Img = imread(ImgPath); %读入图像
%%%%%%%%%%%%%%%%%%%%%%%
%你的代码
%%%%%%%%%%%%%%%%%%%%%%%%%%
end