イメージサイズ

5 次查看(过去 30 天)
大空
大空 2022-7-21
イメージサイズを(256 256 1)にしたいのですが
256 256 3になっているみたいなのですがどこを変更すればよろしいでしょうか?
imds = imageDatastore('sindou','IncludeSubfolders',true,'LabelSource','foldernames');
labelCount = countEachLabel(imds)
%% データで振り分ける
rateTrainFiles = 0.6;
[imdsTrain,imdsValidation] = splitEachLabel(imds,rateTrainFiles,'randomize');
s_image = [256 256 1];
audsTrain = augmentedImageDatastore(s_image,imdsTrain);
audsValidation = augmentedImageDatastore(s_image,imdsValidation);

采纳的回答

Hernia Baby
Hernia Baby 2022-7-21
augmentedImageDatastoreで可能なはずです
グレースケールにしたい場合はColorPreprocessingをご参考ください
auds = augmentedImageDatastore([256 256],imds,'ColorPreprocessing','rgb2gray')
  3 个评论
大空
大空 2022-8-4
ごめんなさい最初行ったのですが上手くいかず再度行ったら上手くいきました。
ありがとうございます
Hernia Baby
Hernia Baby 2022-8-4
うまくいったようでよかったです。もし、ダメだった場合はコメント頂けると再検討しますので遠慮なくどうぞ。

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Convert Image Type 的更多信息

产品


版本

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!