clear;
clc;
%fin = fopen(\’E:/Personal/Desktop/test1.txt\’,\’wt\’);
imgDataPath = \’E:/Personal/Desktop/zhong/\’;
outdir = \’E:/Personal/Desktop/photo3\’;%图片路径
imgDataDir = dir(imgDataPath); % 遍历所有文件

for i=0:499 %********100
imgDir = dir([imgDataPath,\’/\’, num2str(i) \’/*.jpg\’]); % ********100
for j =1:length(imgDir)%图
img = imread([imgDataPath,\’/\’, num2str(i) \’/\’ imgDir(j).name]);%*********100
newname = [outdir,\’/\’,num2str(i),\’_\’,imgDir(j).name];%图片路径********100
imwrite(img,newname);%图片
end
end

版权声明:本文为j657521265原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/j657521265/p/8150930.html