# can any one tell me how to extract only the l component of the image ..if the image is rgb ..i want only the l component of the image ,how is it possible

7 views (last 30 days)
ashok on 10 Feb 2014
Edited: Dishant Arora on 10 Feb 2014
can any one tell me how to extract only the l component of the image ..if the image is rgb ..i want only the l component of the image ,how is it possible

Dishant Arora on 10 Feb 2014
R=YourImage(:,:,1);
G=YourImage(:,:,2);
B=YourImage(:,:,3);
Dishant Arora on 10 Feb 2014
you need intensity component?? To get the intensity notion you can take mean of the three components as it happens in HSI model:
I=1/3*(R+G+B);
also you can follow YCbCr model to get intensity:
Y = 0.2126*R + 0.7152*G + 0.0722*B
where Y denotes luminosity.

Thomas on 10 Feb 2014
Lets say you have a three channel RGB image, im.
% extract the red channel
red = im(:,:,1);
% extract the green channel
green = im(:,:,2);
% extract the blue channel
blue = im(:,:,3);
Simples!
ashok on 10 Feb 2014
i asked how to extract only the l component from the image not r ,g,b seperately