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

2 次查看(过去 30 天)
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);

采纳的回答

Kevin Claytor
Kevin Claytor 2014-11-18
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);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Geometric Transformation and Image Registration 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by