Borrar filtros
Borrar filtros

How to change the Image colour of ones and zeros to white and black

2 visualizaciones (últimos 30 días)
The mage has 50 x 100 points (vertical x horizontal dimension). Each point can be zero or one, where zero = white colour and one = black colour.
I tried this
B = randi([0 1],50, 100);
imagesc(B)
The output image is represented with yellow and blue but I want it to be black and white.

Respuesta aceptada

Image Analyst
Image Analyst el 18 de Jun. de 2021
You don't need a colormap. Just try this:
B = randi([0 1],50, 100);
imshow(B)
impixelinfo();
  16 comentarios
Akakan-Abasi Okon
Akakan-Abasi Okon el 21 de Ag. de 2021
Thank you Image Analyst, please you can help with this one.
What I actually want is how to remove noise from this noisy image to get back my original image.
Though the recovered image might not look exactly the way it was but should have the rectangular blocks(probably with some distortions) in similar position as it was in the original image.
Image Analyst
Image Analyst el 21 de Ag. de 2021
Try imclose() and bwareaopen() or bwareafilt().

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by