Color histogram
From Wikipedia, the free encyclopedia
In computer graphics, a color histogram is a representation of an image derived by counting the 'color' of each pixel. The idea was proposed by Michael Swain and Dana Ballard in 1991 and is mainly used in situations where speed of processing is a factor in the choice of algorithm, or where a specific object, rather than a more abstract class of objects is required to be identified; as noted by Swain and Ballard, "It may not be helpful to model coffee cups as being red and white, but yours may be."
Color histograms are a flexible construct that can be built from images in various color spaces, whether RGB, rg-chromaticity or any other color space of any dimension. A histogram of an image is produced first by discretising the colors in the image into a number of bins, and counting the number of image pixels in each bin:
red | |||||
0-63 | 64-127 | 128-191 | 192-255 | ||
blue | 0-63 | 43 | 78 | 18 | 0 |
64-127 | 45 | 67 | 33 | 2 | |
128-191 | 127 | 58 | 25 | 8 | |
192-255 | 140 | 47 | 47 | 13 |
This provides a far more compact overview of the data in an image than knowing the exact value of every pixel. The color histogram of an image is invariant with translation and rotation about the viewing axis, and varies only slowly with the angle of view. This makes the color histogram particularly suited to recognising an object of unknown position and rotation within a scene. Importantly, translation of an RGB image into the illumination invariant rg-chromaticity space allows the histogram to operate well in varying light levels.
The main drawback of histograms is that the representation is solely dependent of the color of the object being studied. There is no way to distinguish a red and white cup from a red and white plate. Put another way, histogram-based algorithms have no concept of a generic 'cup', and a model of our red and white cup is no use when given an otherwise identical blue and white cup.