creating an image database

3 ビュー (過去 30 日間)
Shreya Shetty
Shreya Shetty 2019 年 7 月 22 日
コメント済み: Shreya Shetty 2019 年 7 月 25 日
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

採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 7 月 22 日
編集済み: KALYAN ACHARJYA 2019 年 7 月 25 日
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 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 7 月 25 日
編集済み: KALYAN ACHARJYA 2019 年 7 月 25 日
#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?
Shreya Shetty
Shreya Shetty 2019 年 7 月 25 日
Thank you

サインインしてコメントする。

その他の回答 (0 件)

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by