From: Arie Arden on
Hi all,

Let's say we have a color image and we wanna get what humans would describe as the dominant colors in it, and their respective weights in it. What do you think is a good way about this?
What I've got mostly so far is:

transform the image into CIE-LAB and run k-means in order to get k centroids of color. Weight each centroid-color by the amount of pixels in that centroid.

The problem with this approach is that the clusters created cover *all* pixels of the image, thereby forcing the algorithm to take under consideration rare colors that I would rather ignore.
Furthermore, the a priori k poses a problem, since it would be better to have an adaptive procedure that realizes k on its own.

I know there isn't a simple answer to this question, what I am asking is what is a common\rational way to go about it.
Mind the fact that I do not care about spatial information, only the "underlying palette" of the image.

Thanks for any help.
From: Image Analyst on
Arie Arden:

Have you looked at the wikipedia article:
http://en.wikipedia.org/wiki/Color_quantization

You'll find these web sites very fun:
http://labs.ideeinc.com/multicolr/
http://color.slightlyblue.com/

Finally there is the concept of a "color frequency image" introduced about 3 years ago by a Japanese professor:

%-------------------------------------------------------------------------------
% http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?tp=&arnumber=4421050&isnumber=4420928
% Introduction of frequency image and applications
% Kashiwagi, T. Oe, S.
% Tokushima Prefectural Ind. Technol. Center, Tokushima;
%
% This paper appears in: SICE (Society of Instrument and Control Engineers), 2007 Annual Conference
% Publication Date: 17-20 Sept. 2007
% On page(s): 584-591
% Location: Takamatsu,
% ISBN: 978-4-907764-27-2
% INSPEC Accession Number: 9853526
% Digital Object Identifier: 10.1109/SICE.2007.4421050
% Current Version Published: 2008-01-07
%
% Abstract
% We introduce a new imaging method of "Frequency Image" and its applications.
% This new image is made from multi-dimensional features of an image and presents
% a distribution of the frequency of feature vectors. Especially, selecting R, G and B colors
% as the three features of an image, Frequency Image is a feature image of which pixel
% represents the frequency of the same color pixels. In this paper, first, we explain
% the basic idea and how to make this Frequency Image. Next, we introduce some effective
% applications using this image. Finally we mention excellent potentials of Frequency Images.
%-------------------------------------------------------------------------------
From: Arie Arden on
Hi, thanks for the quick reply,

The article sounds interesting, but I cannot seem to get a copy of it anywhere.
I see you mentioned in a different post that you've written code implementing it.
Is that so?

(Seriously cool site you gave there, the first one :)
From: Arie Arden on
One more I'd like to mention - concerning color quantization:

I believe my needs here are a bit different.
Regular color quantization seeks to preserve the original as best as possible, thereby it cannot simply ignore rare colors in the image.
I'm seeking to get the dominant colors in the original, I actually need to get rid of the rare colors...
From: Mark Hayworth on
Sounds like you might benefit from the color frequency image. There was just some code for that uploaded to the File Exchange today by someone I know, but it's not shown up yet - maybe tomorrow or Monday, keep looking.