|
遍历文件夹下的全部图像文件:并将其切分,写入到另一个文件夹- clc,clear, close all
- warning off
- FilePath='./train';
- fileList = dir(FilePath);
- savePath='./train2';
- for i=1:length(fileList)
- if strcmp(fileList(i).name,'.')==1||strcmp(fileList(i).name,'..')==1
- continue;
- else
- fileList(i).name;
- img = imread([FilePath,'/',fileList(i).name]);
- % Crop Parts
-
- imwrite(img, [savePath,'/',fileList(i).name])
- end
- end
复制代码
|
|