[Insight-users] clustering/segmentation

Luis Ibanez luis.ibanez@kitware.com
Tue, 10 Dec 2002 08:33:19 -0500


Hi Zein,

If you only need the "n" most common colors you don't
need to build the 16Mb histogram. The "n" most common
can be found at the price of visiting the image many,
many times. You will just need to keep the ocurrency
count of 16 colors and the current one.

So,
you visit one pixel, take its color as the current
color and counts how many other pixels in the image
have the same color. If the count value is larger than
any of the ones in the current "n" table this color
enter into the table.

This, however, can be very slow... but that's the way
it is... is you want to save memory you have to pay
in clock cycles.

On the other hand,...
16Mb is not that much memory in this days   :-)

----

Please note that the "n" most common colors
may not produce a mechanism for segmentation.
In the same way that the "n" most common graylevels
in an image are not necessarily a good segmentation.

This can only be useful if the image has been
previously labeled with color. Otherwise, if you
find shadings of similar colors they can monopolize
the counting. What kind of image are you dealing with ?

If your final goal is segmentation, you are probably
better with a clustering approach.


Hope that helps,


Luis


----------------------------

Zein Salah wrote:
> Luis, Thanks a lot for the answers.
> 
> I have another question:
> I want to know (roughly) the "n" most important colors in an image, i.e. the
> n most occuring colors. As far as I know, a histogram can be of help. The
> problem is that a histogram of 24 bit/voxel image is extremely large. (16M
> entry). One can build a 3-band histogram (i.e. a histogram for each color
> channel). The histograms in the second case will be quite small. BUT how can
> I dedicate the " n most occuring colors" from three different hostograms? Do
> you have any idea?
> 
> Many thanks in advanced.
> 
> Zein
> 
> 
> 
>