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

1 回表示 (過去 30 日間)
ashok
ashok 2014 年 2 月 10 日
編集済み: Dishant Arora 2014 年 2 月 10 日
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

回答 (2 件)

Dishant Arora
Dishant Arora 2014 年 2 月 10 日
R=YourImage(:,:,1);
G=YourImage(:,:,2);
B=YourImage(:,:,3);
  5 件のコメント
Thomas Seers
Thomas Seers 2014 年 2 月 10 日
If so convert to grayscale:
gray = rgb2gray(im); % with image processing toolbox
GIm=0.2989*im(:,:,1)+0.5870*im(:,:,2)+0.1140*im(:,:,3); % without
Dishant Arora
Dishant Arora 2014 年 2 月 10 日
編集済み: Dishant Arora 2014 年 2 月 10 日
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 Seers
Thomas Seers 2014 年 2 月 10 日
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!
  1 件のコメント
ashok
ashok 2014 年 2 月 10 日
i asked how to extract only the l component from the image not r ,g,b seperately

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeComposite Components についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by