How to change image size from 224 x 224 x 1 to 224 x 224 x 3
Ältere Kommentare anzeigen
i have images with 224 x 224 x 1 size i want to convert it to 224 x 224 x 3
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 4 Nov. 2022
0 Stimmen
I recommend that you consider using an imageDatastore followed by an augmentedImageDatastore -- the augmented store can automatically resize your images and can automatically convert to RGB or grayscale.
2 Kommentare
Rev
am 7 Dez. 2023
How do you do that?
Walter Roberson
am 7 Dez. 2023
unzip('MerchData.zip');
imds = imageDatastore('MerchData', ...
'IncludeSubfolders',true, ...
'LabelSource','foldernames');
augds = augmentedImageDatastore([224 224], imds, 'ColorPreprocessing', 'gray2rgb');
[imdsTrain,imdsValidation] = splitEachLabel(augds,0.7);
and so on.
Kategorien
Mehr zu Convert Image Type finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

