:: Sai Chaitanya Gaddam | Creating Color Histograms ::

Publications

Explorations

Color Histograms

Matlab Code
#
Image
#
Color Histogram
#
Color Cloud

How hard can it be to produce distributions of various colors in an image, like the set above? Well, I realized after some tinkering with the Aggregate Posters I had created is that it isn't a linear leap from one-dimensional histograms.
There seem to be two confounds. One is the obvious one of showing a three-dimensional distribution in two-dimensions. And the other is the perceptual confound of showing actual colors without contextual interactions (Here's the link to the abstract if you are blocked by a paywall). The usual method of plotting histograms separately for each of the three primary color bands is hardly optimal. There's no reason to believe that the peaks of the individual bands correspond to the same triplet of color, and the even the fundamental idea of showing spectral densities with graphs that could just as well be used for any universal triplet is dicey. Why not have the graphs speak to you in the visual language of color when they are supposed to be describing color?

As a starting point I decided to bin the color triplets into bands of 25 gray-scale values in each of the RGB band. That is, each (r,g,b) triplet is truncated as (r*,g*,b*) where each value can only be a multiple of 25 up to a maximum of 255. That gives you a resolution of 11^3 voxels in the entire color space covered by a 24-bit representation. The next step is deciding how to order the bins. Our perception of color difference varies quite a bit from the euclidean distance between two color triplets. It seemed prudent to take brightness out of the mix by normalizing all triplets by the sum of their values, making them (r/(r+g+b), g/(r+g+b), b/(r+g+b)) and then ordering them with (1,0,0) (primary red) as the leftmost point.

We can do better. There's no reason to stick to a one-dimensional representation when we are so adept at analyzing spatial arrangments of colors. Why not try using this ability to our advantage?
Aside: Chernoff Faces are a lovely example of using our immense computing prowess in creative ways.
The color cloud depicted above is one attempt at obtaining two-dimensional representations. Color densities are converted into scattered random dots around the spatial position assigned to the color triplet, with the extent of the spatial position determined by the frequency with which that triplet appears in the image. So, more frequent a color, larger the pointillistic blot of that color. After multiple attempt at achieving a good separation of the three colors, I decided on the following x and y transformations for the triplet (r,g,b):

x= Sigmoid((g-r+1)/2)

y=(b+eps)/(r+g+b+3*eps))

Here are some examples (Ask me if you'd like the Matlab code used in generating them) # # #

A gray-scale image: The light and dark colors overlap in the cloud because of the way x and y are computed, but this reflects a conscious choice to use the cloud to highlight actual color differences as opposed to brightness differences. The scatter has the benefit of showing both the light and dark in the regions of overlap, and the stark contrast of light and dark ensures that your perceptual filters don't ignore them.

Sepia Tones
# # #
Dark shades of blue
# # #
Bright shades of blue
# # #
A distinctly two-peaked distribution
# # #
Bright and multi-colored with one predominant color
# # #
Another bright, multi-colored image with one predominant color
# # #

For computational reasons, I use the same bins in graphing the clouds as I do for the histograms. However, the clouds are really scatter plots of the colors and using the same colors as in the image is possible. You would still need the scatter to convey the density of that particular color triplet in the image. I noticed in the course of plotting these clouds for numerous images that they all skew towards the left, which is the red end despite the x and y scales being designed to be symmetric. Does this indicate a general skew in poster creation? Is green eschewed for being hard to print or fluorescent in lamination? Whatever the reason, one could achieve more separation in the image by using a logarithmic scale that compresses the corners (primary color regions) that seem to be under utilized in general.

Research Nuggets

CONFIGR:
is a first-generation neural model for contour interpolation.

Knowledge Discovery from Labeled Web Documents:
is an attempt to sythesize disparate semantic information from user tags.