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

3 visualizaciones (últimos 30 días)
namita chandrakar
namita chandrakar el 18 de Nov. de 2014
Respondida: Kevin Claytor el 18 de Nov. de 2014
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);

Respuesta aceptada

Kevin Claytor
Kevin Claytor el 18 de Nov. de 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);

Más respuestas (0)

Categorías

Más información sobre Image Processing and Computer Vision en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by