Re: RGB histogram??
- From: ImageAnalyst <imageanalyst@xxxxxxxxxxxxxx>
- Date: Wed, 20 Aug 2008 12:29:00 -0700 (PDT)
On Aug 20, 3:12 am, inva...@xxxxxxxxxxxxxxx wrote:
AE lover wrote:---------------------------------------------------------------------------------
Hi all,
I want to analyze a series of digital photos to see what colors appear
most frequently. Assume all photos are in 24 bit RGB. Do you have any
idea how to do it? Just generate a 255 x255 x255 table, each entry of
which contrains the number of times that color appears?
I think that this analysis is very common and useful. I guess someone
should have done it before.
You are right -- Ursus and Nadeschkin have done it before. They call it
"Tidy up art".
See
<http://www.amazon.com/exec/obidos/ASIN/3036952004/keinundaberch-21> and
<http://www.ursusnadeschkin.ch/e/kunst.php> ;)
Joking apart: a 256^3 table is not exactly easy to visualize or even to
handle. It is a huge (and typically sparse) matrix: Every histogram
needs 64MB storage space (single precision). I think you should reduce
the color depth in order to get something more manageable.
One way to analyze the histogram cold be converting it to an image stack
and treat this volume of data like computed tomography, e.g. with ImageJ
<http://rsbweb.nih.gov/ij/>.
Another representation that comes to my mind is a 3D-"cloud" of bubbles
where the diameter or transparency of a bubble represents the frequency
of a color.
Klaus
--
echo '4b6c617573204b6172636865722c206d61696c746f3a6c6973
7473406469676974616c70726f6f662e696e666f0a' | xxd -r -ps
AE Lover:
This is reasonable. To find out which colors occur most frequently
you're going to have to go through the image and basically just find
out via brute force. Color Quanitization or color reduction (Google
it) is what you want to do. That is the concept of finding out what
are the most common colors in an image and then replacing colors with
just those most common ones so that the image can be compressed or
displayed more efficiently.
Klaus needs to get a new computer. 64 MB is definitely not huge
anymore. I regularly work with medical images of 500 MB to 18 GB.
MATLAB tells me that I can have a single array up to 1024 MB in size,
so 64 MB is peanuts.
Here's something I pulled from one of my earlier posts that you should
try:
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
.
- Follow-Ups:
- Re: RGB histogram??
- From: invalid
- Re: RGB histogram??
- References:
- RGB histogram??
- From: AE lover
- Re: RGB histogram??
- From: invalid
- RGB histogram??
- Prev by Date: Re: RGB histogram??
- Next by Date: Re: RGB histogram??
- Previous by thread: Re: RGB histogram??
- Next by thread: Re: RGB histogram??
- Index(es):
Relevant Pages
|
Loading