필터 지우기
필터 지우기

Bitmap image wrongly inverted

조회 수: 3 (최근 30일)
Andrew Davis
Andrew Davis 2017년 3월 17일
답변: Image Analyst 2017년 3월 17일
Hi all,
I am reading a black and white bitmap (.bmp) image using
imread('filepath');
However, for this certain image the picture comes through as the complement of itself. i.e. the colours/intensities are inverted. I have tried using
imread('filepath', 'bmp');
as well.
Any ideas? I have attached the image in question, along with the output that is given.
Thanks

채택된 답변

Thorsten
Thorsten 2017년 3월 17일
[I, map] = imread('../../Downloads/scene_l.bmp');
imshow(I, map)
J = ind2rgb(I, map); % convert to non-indexed image
imshow(J)

추가 답변 (1개)

Image Analyst
Image Analyst 2017년 3월 17일
Subtract it from 255:
grayImage = uint8(255) - invertedGrayImage;

카테고리

Help CenterFile Exchange에서 Modify Image Colors에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by