Tags: blue, cantake, color, function, green, histogram, image, matlab, programming, red, separate, separatethe
how separate color image as red ,green and blue
please anyone can help me to find a function that separate
the color image to three red,green and blue .So, I can
take the histogram for each one.
Leave a comment...
- 1 Comments
- "huda nawaf" <halmamory.matlab.questionfor.info.yahoo.com> wrote in message
> hi there,
> please anyone can help me to find a function that separate
> the color image to three red,green and blue .So, I can
> take the histogram for each one.
> many thanks,huda
If you have an image say Image_rgb then you can separate the
colour planes as follows
Image_red = Image_rgb(:,:,1);
Image_green = Image_rgb(:,:,2);
Image_blue = Image_rgb(:,:,3);
It probably goes without saying that if you view these
planes they are displayed as greyscale images; I mention
this, as one previous op was surprised that they did not
come out as a red, green and blue colour images.
Bear in mind that when you histogram these images separately
as you plan to do, you can come to some possibly misleading
results. For example suppose your result tells you you that
25% of your pixels are full scale green, and 25% are full
scale red, you can get this either from you having 25% of
individual pixels being red, and another 25% being green,
else you can get exactly the same histogramme, if 25% of
your colour image is yellow, so be aware this can happen. If
this is a problem, you can generate a normal histogramme for
the intensity plane, and a two dimensional histogramme which
has hue on one axis, saturation on the other, and pixel
count in the z direction.
Dave Robinson#1; Mon, 28 Apr 2008 02:22:00 GMT