資源簡介
matlab的一個小腳本,用于訓練數據不夠時數據增強使用
代碼片段和文件信息
clear?close?all;
file_path?=‘C:\Users\user\Desktop\project\kz‘;
sdir=‘C:\Users\user\Desktop\project\kz‘;
img_PathList?=?dir(strcat(file_path?‘*.png‘));
img_num?=?length(img_PathList);
for?i=1:img_num
????
????img_name?=?img_PathList(i).name;
????image?=?imread(strcat(file_pathimg_name));
????
????img_tep?=?imresize(image?[38?134]);
????a1?=?img_tep(1:32?1:128);
????a2?=?img_tep(7:38?1:128);
????a3?=?img_tep(1:32?7:134);
????a4?=?img_tep(7:38?7
評論
共有 條評論