필터 지우기
필터 지우기

creating an image database

조회 수: 7 (최근 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개)

카테고리

Help CenterFile Exchange에서 Modify Image Colors에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by