How to conver folder (images) from GRB to Gary and save them in Output folder with the same original names?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Goma Najah
le 7 Août 2016
Réponse apportée : Image Analyst
le 7 Août 2016
i have this code which convert image to Gray and save it in current folder.
directory = dir('AM01AFS.jpg');
for i = 1 : size(directory,1)
filename = directory(i).name;
img = rgb2gray(imread(filename));
imwrite(img, ['Gr_' filename]);
end
I need to convert folder (images) from GRB to Gary and save them in Output folder with the same original names? Any help Plz.
0 commentaires
Réponse acceptée
Image Analyst
le 7 Août 2016
You need to use fullfile() to make a name with the output folder prefixing the base file name:
outputFileName = fullfile(outputFolder, filename);
imwrite(img, outputFileName);
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!