creating an image database
조회 수: 7 (최근 30일)
이전 댓글 표시
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
채택된 답변
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
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?
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Modify Image Colors에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!