The color histogram of an image is relatively invariant with translation and rotation about the viewing axis, and varies only slowly with the angle of view.
![normalized histogram matlab 2009 normalized histogram matlab 2009](https://ww2.mathworks.cn/help/audio/ref/detectspeech_algorithm.png)
The histogram provides a compact summarization of the distribution of data in an image. Although harder to display, a three-dimensional color histogram for the above example could be thought of as four separate Red-Blue histograms, where each of the four histograms contains the Red-Blue values for a bin of green (0-63, 64-127, 128-191, and 192-255). A two-dimensional histogram of Red-Blue chromaticity divided into four bins ( N=4) might yield a histogram that looks like this table:Ī histogram can be N-dimensional. For example, a Red–Blue chromaticity histogram can be formed by first normalizing color pixel values by dividing RGB values by R+G+B, then quantizing the normalized R and B coordinates into N bins each. A histogram of an image is produced first by discretization of the colors in the image into a number of bins, and counting the number of image pixels in each bin. OverviewĬolor histograms are flexible constructs that can be built from images in various color spaces, whether RGB, rg chromaticity or any other color space of any dimension. Like other kinds of histograms, the color histogram is a statistic that can be viewed as an approximation of an underlying continuous distribution of color values. The color histogram may also be represented and displayed as a smooth function defined over the color space that approximates the pixel counts. Most often, space is divided into an appropriate number of ranges, often arranged as a regular grid, each containing many similar color values. If the set of possible color values is sufficiently small, each of those colors may be placed on a range by itself then the histogram is merely the count of pixels that have each possible color. Each measurement has its own wavelength range of the light spectrum, some of which may be outside the visible spectrum.
![normalized histogram matlab 2009 normalized histogram matlab 2009](https://www.mathworks.com/help/examples/matlab/win64/PlotMultipleHistogramsExample_01.png)
For multi-spectral images, where each pixel is represented by an arbitrary number of measurements (for example, beyond the three measurements in RGB), the color histogram is N-dimensional, with N being the number of measurements taken. For monochromatic images, the term intensity histogram may be used instead. The color histogram can be built for any kind of color space, although the term is more often used for three-dimensional spaces like RGB or HSV. For digital images, a color histogram represents the number of pixels that have colors in each of a fixed list of color ranges, that span the image’s color space, the set of all possible colors. In image processing and photography, a color histogram is a representation of the distribution of colors in an image.