write an image file

조회 수: 2 (최근 30일)
Elysi Cochin
Elysi Cochin 2020년 4월 1일
답변: Image Analyst 2020년 4월 1일
i have a image im of uint16 datatype
figure(1), imshow(im)
figure(2), imshow(uint8(im))
figure(3), imshow(im,[])
all the above lines displays the image in different format
How to write the image in as obtained in 3rd figure format
  댓글 수: 2
krishna kotha
krishna kotha 2020년 4월 1일
hii iam krishna
it is clearely mentioned in matlab help

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

채택된 답변

Image Analyst
Image Analyst 2020년 4월 1일
You need to scale it to 0-255 first (which is what [] does), and then cast to uint8:
image8 = uint8(rescale(im, 0, 255));
imwrite(filename, image8);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by