总体上来说这种数据有2中处理思路。第一种如下所示,从一组数据中挑选出符合要求的数据;
第二中就是数据中不需要的数据删除,选择处理不需要的数据,留下的补集就是需要的数库。一般情况下需要看问题是否明确,需求明确的话,考虑操作数,和操作的复杂程度,选择具体使用哪一种数据。
index=[2,4,7,13,14];
% parent_path='\\ip\public\光学测试\0基线\O公司\O公司实测数据\拍摄';
parent_path='C:\Users\Administrator\Desktop\part_noon';
folder_name='室内人脸';
output_path=['C:\Users\Administrator\Desktop\上午\',folder_name];
if exist(output_path,'dir')
rmdir(output_path,'s');
end
if ~exist(output_path,'dir')
mkdir(output_path);
end
output_depth=[output_path,'\depth'];
if ~exist(output_depth,'dir')
mkdir(output_depth);
end
output_ir=[output_path,'\ir'];
if ~exist(output_ir,'dir')
mkdir(output_ir);
end
output_raw=[output_path,'\raw'];
if ~exist(output_raw,'dir')
mkdir(output_raw);
end
floder_path=[parent_path,'\',folder_name];
for i = 1:size(index,2)
filepath=[floder_path,'\raw\depth8_',num2str(index(i)),'.bmp'];
copytopath=[output_raw,'\depth8_',num2str(i),'.bmp'];
copyfile(filepath, copytopath);
filepath=[floder_path,'\raw\ir_background8_',num2str(index(i)),'.bmp'];
copytopath=[output_raw,'\ir_background8_',num2str(i),'.bmp'];
copyfile(filepath, copytopath);
filepath=[floder_path,'\raw\ir8_',num2str(index(i)),'.bmp'];
copytopath=[output_raw,'\ir8_',num2str(i),'.bmp'];
copyfile(filepath, copytopath);
filepath=[floder_path,'\raw\speckle_enhance8_',num2str(index(i)),'.bmp'];
copytopath=[output_raw,'\speckle_enhance8_',num2str(i),'.bmp'];
copyfile(filepath, copytopath);
filepath=[floder_path,'\raw\speckle_original8_',num2str(index(i)),'.bmp'];
copytopath=[output_raw,'\speckle_original8_',num2str(i),'.bmp'];
copyfile(filepath, copytopath);
filepath=[floder_path,'\raw\speckle8_',num2str(index(i)),'.bmp'];
copytopath=[output_raw,'\speckle8_',num2str(i),'.bmp'];
copyfile(filepath, copytopath);
%
filepath=[floder_path,'\ir\',num2str(index(i)),'.png'];
copytopath=[output_ir,'\',num2str(i),'.png'];
copyfile(filepath, copytopath);
%
filepath=[floder_path,'\depth\',num2str(index(i)),'.png'];
copytopath=[output_depth,'\',num2str(i),'.png'];
copyfile(filepath, copytopath);
end
index
folder_name