根據 imds
= imageDatastore(location
)location
指定的圖像數據集合創建一個數據存儲 imds
。
使用一個或多個名稱-值對組參數為 imds
= imageDatastore(location
,Name,Value
)imds
指定其他參數和屬性。
例:digitDatasetPath = fullfile('F:\dachuang\語料庫', '0-9Pictrues'); %fullfile(): 將地址拼接 digitDatasetPath = 'F:\dachuang\語料庫\0-9Pictrues'
imds = imageDatastore(digitDatasetPath,'IncludeSubfolders',true,'LabelSource','foldernames');
digitDatasetPath: 數據所在位置
'IncludeSubfolders',true: 是否包含子文件夾:是 (默認為否)
'LabelSource','foldernames' : 標簽來源:子文件夾名 (只有這個或者無標簽)
官方文檔:https://ww2.mathworks.cn/help/matlab/ref/matlab.io.datastore.imagedatastore.html
參考博客:https://blog.csdn.net/wanzi1122/article/details/80491937