creating an image database
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Shreya Shetty
le 22 Juil 2019
Commenté : Shreya Shetty
le 25 Juil 2019
i want to create a database of images present in a folder by converting it to binary format.
can u pls share the procedure or the source code.
thank you
0 commentaires
Réponse acceptée
KALYAN ACHARJYA
le 22 Juil 2019
Modifié(e) : KALYAN ACHARJYA
le 25 Juil 2019
Images=dir('C:\Complete_path\Input_folder_name\*.png'); %Input Images, Note on .format
outDirectory='C:\path_to create_out_folder\folder_name\'; % It will automatically ctreated
mkdir(outDirectory);
for i=1:length(Images)
ImgName=strcat('C:\Complete_path\Input_folder_name\',Images(i).name);
ImgName=imread(ImgName);
bw_image=im2bw(ImgName)
imwrite(bw_image,strcat(outDirectory,Images(i).name));
end
Please do minor change in the code, as per your requirements, any Issue let me know!
5 commentaires
KALYAN ACHARJYA
le 25 Juil 2019
Modifié(e) : KALYAN ACHARJYA
le 25 Juil 2019
#Edited Answer Check
Are you sure your input images are RGB? May be your images are gray image, therefore skip the line.
Please do share complete code /replication code/sample images?
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Modify Image Colors 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!