for文内で作成したimageDatastoreの結合
9 views (last 30 days)
Show older comments
1つのフォルダの中に3つのサブフォルダがありそれぞれにimageが何枚かずつ保存されている場合、
以下のように親となるフォルダを指定しまとめてイメージデータストアを作成できることは確認しました。
%参照したいimageが含まれるサブフォルダの手前までのパス
datasetpath = " ";
imds = imageDatastore(path,'IncludeSubfolders',true,'LabelSource','foldernames');
対して、以下のようにfor文内でそれぞれサブフォルダごとのイメージデータストアを作成して結合させることで上記と同じイメージデータストアを作成することは可能でしょうか。
%参照したいimageが含まれるサブフォルダのパス
datasetpath = [" "," "," "];
for i=1:length(datasetpath)
path = datasetpath{i};
imds = imageDatastore(path,'IncludeSubfolders',true,'LabelSource','foldernames');
end
0 Comments
Accepted Answer
Hernia Baby
on 7 Mar 2022
2つ方法があります
imdsCombined = combine(imdsdsL,imdsdsR);
2. cellで複数のpathを格納して読み込む
imdsCombined = datastore({'path to dsL', 'path to dsR'},'Type','tall')
More Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!