how to get back the rgb image from r g b component ?

3 views (last 30 days)
i have 3D image. i want to combine r g and b component ? how do i display the 3D image back ?
% display one channel only clear all;
im=imread('images/DSC1228L_512.jpg'); im_red = im; im_green = im; im_blue = im;
% Red channel only im_red(:,:,2) = 0; im_red(:,:,3) = 0; figure, imshow(im_red);
% Green channel only im_green(:,:,1) = 0; im_green(:,:,3) = 0; figure, imshow(im_green);
% Blue channel only im_blue(:,:,1) = 0; im_blue(:,:,2) = 0; figure, imshow(im_blue);

Accepted Answer

Kevin Claytor
Kevin Claytor on 18 Nov 2014
Exactly the opposite of how you pulled out the data;
im = imread(...);
red = im(:,:,1);
grn = im(:,:,2);
blu = im(:,:,3);
original_mk2 = zeros(size(im));
original_mk2(:,:,1) = red;
original_mk2(:,:,2) = grn;
original_mk2(:,:,3) = blu;
fiugre; imshow(original_mk2);

More Answers (0)

Categories

Find more on Image Processing and Computer Vision in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!