How to convert a grey-scale image into a reverse binary image

cup.jpgI have images like the one shown above and I want to convert the image to a binary image where the black parts are white and the rest of the image is black. How would I approach solving this problem?

 Respuesta aceptada

Rbin = YourImage <= 42;

2 comentarios

Does not work.
I assure you that it does work, with the exception of TIFF images that use IEEE floating point representation (these exist but are rare)

Iniciar sesión para comentar.

Más respuestas (1)

Try this:
grayImage = 255 - grayImage; % Assuming your image is uint8. Use 65535 if it's uint16.

Productos

Versión

R2016b

Etiquetas

Preguntada:

el 13 de Dic. de 2019

Respondida:

el 15 de Dic. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by