for文内で作成したimageDatastoreの結合
14 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')
3 Comments
Atsushi Ueno
on 9 Mar 2022
>上記と同じimdsを作成することは可能でしょうか
CombinedDatastore オブジェクトは複数のimdsを纏めた物で各imdsの中身迄は融合されません
だから、質問の答えはNOですね。
More Answers (0)
See Also
Categories
Find more on 大規模なイメージ ファイル in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!