Re: find largest cluster?
- From: bugbear <bugbear@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 10 Apr 2008 09:46:16 +0100
ImageAnalyst wrote:
On Apr 9, 6:35 am, bugbear <bugbear@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:Given a list of RGB (or other triple) colours,
rgb0, rgb1... rgbN I would like to be able
to detect what the largest "common" colour.
I think this would need to be within a tolerance
(e.g. from a list of 10, 4 are identical
within +- 2 in each channel).
There are some obvious nested loop
algorithms, but they're very inefficient
(essentially form and calculate all permutations
of the list).
Is this a standard problem, or does
anyone have an ah-hah algorithm?
BugBear
-----------------------------------------------------------
BugBear:
Here's an eye opening experience for you:
Download ImageJ and install it - it's freeware from the NIH.
http://rsb.info.nih.gov/ij/
Then go here
http://rsb.info.nih.gov/ij/plugins/color-inspector.html
and install the 3D Color Inspector/Color Histogram.
This amazing gamut visualization program lets you visualize the color
gamut in several different color spaces. You read in your color
image
and it plots the gamut scatterplot in 3D and lets you interact with
it
in several ways, such as reorienting the axes. It's really amazing
how much you can learn when you see what colors you actually have in
your image displayed graphically in a 3D scatterplot. Plus it lets
you pick several color classifiers such as Median Cut, and Wu's color
quantization. You can even specify the number of colors you wish to
classify your gamut into.
You can tell the plot to plot each and every pixel in the scatterplot
with equal intensity (shows all colors that are there), or you can
tell it to plot more frequent colors brighter and less frequent colors
darker (gamut will fade away as you get farther away from more
frequent colors).
The selections like Median Cut, etc. basically do what you want to
do. They find clusters based on how frequent the color is and how
concentrated the clusters are. You can specify how many colors
(clusters) you want to chop up your gamut into. Once you've
visualized your gamut in 3D and can easily see your clusters, and
checked out several quantization schemes, you can look the algorithms
somewhere.
Seriously, do this (it's free, painless, and easy), and then let me
know how you like it. You'll be glad you did. It's really cool!
Best wishes,
ImageAnalyst
I've seen it - it's wonderful.
But it doesn't do the thing I want.
BugBear
.
- Follow-Ups:
- Re: find largest cluster?
- From: ImageAnalyst
- Re: find largest cluster?
- References:
- find largest cluster?
- From: bugbear
- Re: find largest cluster?
- From: ImageAnalyst
- find largest cluster?
- Prev by Date: Re: find largest cluster?
- Next by Date: CFP: IEEE CIS2008. Deadline 5 May 2008
- Previous by thread: Re: find largest cluster?
- Next by thread: Re: find largest cluster?
- Index(es):
Relevant Pages
|