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

1 vue (au cours des 30 derniers jours)
Hardit Singh
Hardit Singh le 13 Déc 2019
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?

Réponse acceptée

Walter Roberson
Walter Roberson le 13 Déc 2019
Rbin = YourImage <= 42;
  2 commentaires
Hardit Singh
Hardit Singh le 14 Déc 2019
Does not work.
Walter Roberson
Walter Roberson le 15 Déc 2019
I assure you that it does work, with the exception of TIFF images that use IEEE floating point representation (these exist but are rare)

Connectez-vous pour commenter.

Plus de réponses (1)

Image Analyst
Image Analyst le 15 Déc 2019
Try this:
grayImage = 255 - grayImage; % Assuming your image is uint8. Use 65535 if it's uint16.

Catégories

En savoir plus sur Image Processing Toolbox dans Help Center et File Exchange

Produits


Version

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by