How to fuse R,G,B Components?
조회 수: 2 (최근 30일)
이전 댓글 표시
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?
댓글 수: 0
채택된 답변
추가 답변 (1개)
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));
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!