ImageDatastoreでサイズを変更しつつ、ラベルづけをする方法を教えてください
조회 수: 5 (최근 30일)
이전 댓글 표시
Aというフォルダの中にa,bというサブフォルダがあり、様々なサイズの画像が入っています。これらの画像のサイズを100x100に変換しながら、ImageDatastoreで読み込んで、フォルダ名でラベルづけをする方法を教えてください。
imds = imageDatastore('./A','IncludeSubfolders',true,'LabelSource','foldernames');
サイズの変更がない場合はこれでラベル付けしながら読み込めるのですが、ここからサイズを変更する方法がわかりません。augmentedImageDatastoreでやろうとしましたが、
imageSize = [100 100 1];
imds = augmentedImageDatastore('./A', imageSize, 'IncludeSubfolders',true,'LabelSource','foldernames');
上のコードではうまく動きませんでした。
댓글 수: 0
답변 (1개)
Kenta
2020년 7월 31일
こちら、ネットで探すと以下のようなわかりやすい記事がありました。
こちらにもあるのですが、
imds = imageDatastore('./A','IncludeSubfolders',true,'LabelSource','foldernames');
でimdsを作成したのち、
auimds = augmentedImageDatastore([100 100 1],imds)
などで、サイズを変更できます。データ拡張(オーギュメンテーション)も、このコマンドに入れ込むことができます。
댓글 수: 2
참고 항목
카테고리
Help Center 및 File Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!