資源簡介
用于深度學習中的圖像數據增廣的matlab小程序,保持圖像尺寸不變情況下,對圖像亮度角度的調整,實用性強~
代碼片段和文件信息
addpath(‘test‘);
addpath(‘train‘);
file_path?=?‘C:\Users\Byte\Desktop\test_images\‘;???%圖像文件夾路徑
save_path?=?‘C:\Users\Byte\Desktop\aa_test\‘;???%圖像文件夾路徑
%?img_path_list?=?dir(strcat(file_path‘*.jpg‘));?%獲取文件夾中所有jpg格式圖像
img_path_list?=?dir(strcat(file_path‘*.jpg‘));
img_num?=?length(img_path_list);??%獲取總數
if?img_num?>?0
????for?j?=?1?:?img_num
????????img_name?=?img_path_list(j).name;
????????image?=?imread(strcat(file_pathimg_name));
????????img_name_core?=?img_name(1:end-4);????%除去后綴名
????????
????????fprintf(‘%d?%d?%s\n‘ijstrcat(file_pathimg_name));
????????
????????%圖像增廣
????????
????????%翻轉flipdim
????????img_u?=?flipdim(image1);
????????img_r?=?flipdim(image2);
????????img_ur?=?flipdim(img_r1);
????????imwrite(img_ustrcat(save_pathimg_name_core‘
- 上一篇:遷移學習數據集百度云盤地址
- 下一篇:matlab手掌靜脈處理
評論
共有 條評論