필터 지우기
필터 지우기

Converting from grayscale to binary image gives error

조회 수: 1 (최근 30일)
engineer
engineer 2018년 8월 13일
편집: jonas 2018년 8월 13일
Hi everybody I convert my image from grayscale to binary image, however, the result is completely black. I attached my code and images. Could you please help me with that?
if true
grayImage=imread('20x.png');
binaryImage = im2bw(grayImage,0.4);
binaryImage = imfill(binaryImage, 'holes');
imshow(binaryImage, []);
end

채택된 답변

jonas
jonas 2018년 8월 13일
편집: jonas 2018년 8월 13일
The threshold (0.4) is too high. Reduce the threshold (to e.g. 0.2) or use imbinarize instead of im2bw (recommended).

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by