How to change image size from 224 x 224 x 1 to 224 x 224 x 3
Show older comments
i have images with 224 x 224 x 1 size i want to convert it to 224 x 224 x 3
Accepted Answer
More Answers (1)
Walter Roberson
on 4 Nov 2022
0 votes
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 Comments
Rev
on 7 Dec 2023
How do you do that?
Walter Roberson
on 7 Dec 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.
Categories
Find more on Convert Image Type 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!
