DSPRelated.com
Forums

Color Identification using imhist

Started by Imran Akthar July 3, 2003
Hi all,

I am trying to get the maximum occourence of a particular color in an
image using imhist command in an image .I first converted the RGB image to
indexed image usnig rgb2ind command

RGB=imread('a.jpg');
[x,map]=rgb2ind(RGB,128);
imhist(x,map); How to infer the colors from the imhist plot.

Thanks

Imran Akthar



Hi,
Use the MAP. for example find the most common RGB like
that:
B=imhist(x,map);
[bmax,mb]=max(B);
RGBmax=map(mb,:); % 3 components

I hope this helps

Joe
BSTeX- Equation viewer for Matlab
http://www.geocities.com/bstex2001

--- Imran Akthar <> wrote:
> Hi all,
>
> I am trying to get the maximum occourence of
> a particular color in an image using imhist command
> in an image .I first converted the RGB image to
> indexed image usnig rgb2ind command
>
> RGB=imread('a.jpg');
> [x,map]=rgb2ind(RGB,128);
> imhist(x,map); > How to infer the colors from the imhist plot.
>
> Thanks
>
> Imran Akthar

__________________________________