how to generate RGB image from [mxnx3] matrix

조회 수: 4 (최근 30일)
BHANU SRINIVASA
BHANU SRINIVASA 2020년 2월 1일
답변: Image Analyst 2020년 2월 1일
i have an image i have converted it to a matrix and did some modifications and displayed it but i was not able t generate the color image again
how can i do that

답변 (1개)

Image Analyst
Image Analyst 2020년 2월 1일
You can use imshow() but your variable has to be of the right class.
imshow(yourImage);
yourImage should be either:
  1. a uint8 image with integer values in the range 0-255
  2. a uint16 image with integer values in the range 0-65535
  3. a double image with double values in the range 0-1
If you have anything else, like an RGB image with double values in the range 0-255, you'll have to cast it to one of the above types with functions like mat2gray(), rescale(), im2double(), im2uint8, etc. For examples:
rgbImage = uint8(rgbImage);
rgbImage = mat2gray(rgbImage);
rgbImage = uint8(rescale(rgbImage, 0, 255));

카테고리

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