How to convert multiple binary images to grayscale and save them into a folder ?
2 views (last 30 days)
Show older comments
Hello , I have a folder contating around 4000 binary images which I wanted to use them as training samples for AlexNet . As you know AlexNet and most deep networks accept only grayscale or RGB images. Is there an efficent way to convert these multiple images to grayscale or RGB without using for loop. e.g. by using image datatstore function. please help :)
0 Comments
Accepted Answer
Walter Roberson
on 30 Apr 2020
create your imagedatastore based on the binary images. Now use transform() to create a new datastore with a transformation function @im2uint8 or @im2double or @(M)repmat(im2uint8(M), 1,1,3)
4 Comments
Walter Roberson
on 30 Apr 2020
im2uint8 not im2unit8
Also you need to assign the result of transform to a variable, and use that variable as the datastore to pass around
More Answers (0)
See Also
Categories
Find more on Deep Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!