Borrar filtros
Borrar filtros

Converting from grayscale to binary image gives error

1 visualización (últimos 30 días)
engineer
engineer el 13 de Ag. de 2018
Editada: jonas el 13 de Ag. de 2018
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

Respuesta aceptada

jonas
jonas el 13 de Ag. de 2018
Editada: jonas el 13 de Ag. de 2018
The threshold (0.4) is too high. Reduce the threshold (to e.g. 0.2) or use imbinarize instead of im2bw (recommended).

Más respuestas (0)

Categorías

Más información sobre Convert Image Type en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by