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

조회 수: 1 (최근 30일)
Hardit Singh
Hardit Singh 2019년 12월 13일
답변: Image Analyst 2019년 12월 15일
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?

채택된 답변

Walter Roberson
Walter Roberson 2019년 12월 13일
Rbin = YourImage <= 42;
  댓글 수: 2
Walter Roberson
Walter Roberson 2019년 12월 15일
I assure you that it does work, with the exception of TIFF images that use IEEE floating point representation (these exist but are rare)

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2019년 12월 15일
Try this:
grayImage = 255 - grayImage; % Assuming your image is uint8. Use 65535 if it's uint16.

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

제품


릴리스

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by