How to fuse R,G,B Components?

조회 수: 2 (최근 30일)
Sabarinathan Vadivelu
Sabarinathan Vadivelu 2012년 9월 14일
I have read an RGB Image, and extracted all its components R,G,B seperately by,
R = inputImage (:,:,1);
G = inputImage (:,:,2);
B = inputImage (:,:,3);
Again I performed some operations to get the values changed. they are Re,Ge,Be.
Now again I want to display the Image integrating all these Re,Ge,Be. How?

채택된 답변

Dishant Arora
Dishant Arora 2012년 9월 14일
cat(3,Re,Be,Ge);

추가 답변 (1개)

Image Analyst
Image Analyst 2012년 9월 14일
Concatenate separate image channels into one RGB image using cat():
newRGBImage = cat(3, Re, Ge, Be);
But now, how you display it depends on what class your processed image channels were: integer or floating point. If, after processing, your new image is uint8, you can simply display it.
imshow(newRGBImage);
If, after processing, your new image channels are floating point, instead of uint8, and are in the range 0-255, you'll need to cast to uint8 before you display the new image.
imshow(uint8(newRGBImage));
If you have floating point values outside this range, you can do:
imshow(im2double(newRGBImage));

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by