DSPRelated.com
Forums

Image Processing Problem

Started by deepak ropireddy October 6, 2004

Hi,

I have a specific problem in Image Processing.
I have a set of RGB JPEG images, with 4 distinct RGB
values. Thats is all the pixels have one of these RGB
values. I would like to calculate the number of pixels
of each particular RGB value in each image. I do not
want the intensity values of Red, Green and Blue
channels, which is basically what a histogram plot
does in regular image processing tools.

Could anybody please help me out and I am a novice in
Matlab. So, please I would be very much thankful to
you if you could include a snippet of the code.

Thanks in advance.

Regards,
Deepak.

__________________________________________________






From my understanding,
Each pixel has a particular value
say 1.0
but that value may represent a red,blue or green or no
color.
R G B
pixel1 1 0 0
pixel2 0 1 0
pixel3 0 0 0
etc.

If this is the case when u import the image it would
have three matrices one for R G and B.( assuming RGB
format)
else use ind2rgb to convert a indexed immage to rgb.

Then sum the pixel values in both row an column of a
particular matrix say R and divide by the particular
value in my case it is 1.0 to get the no. of pixels
with intensity 1.0 in R.

if the above does not work histogram give the no. of
pixels in each intensity value for each color. Sum all
intensitie for a constant color u get the no. of
pixels in that particular color.

--- deepak ropireddy <> wrote:

>
> Hi,
>
> I have a specific problem in Image Processing.
> I have a set of RGB JPEG images, with 4 distinct RGB
> values. Thats is all the pixels have one of these
> RGB
> values. I would like to calculate the number of
> pixels
> of each particular RGB value in each image. I do not
> want the intensity values of Red, Green and Blue
> channels, which is basically what a histogram plot
> does in regular image processing tools.
>
> Could anybody please help me out and I am a novice
> in
> Matlab. So, please I would be very much thankful to
> you if you could include a snippet of the code.
>
> Thanks in advance.
>
> Regards,
> Deepak.
>
> __________________________________________________
> >
>