In image processing, Histogram equalization is a method of contrast adjustment using the image's histogram. Histogram equalization is a specific case of the more general class of histogram remapping methods. These methods seek to adjust the image to make it easier to analyze or improve visual quality.
Overview This method usually increases the global contrast of many images, especially when the image is represented by a narrow range of intensity values. Through this adjustment, the intensities can be better distributed on the histogram, utilizing the full range of intensities evenly. This allows for areas of lower local contrast to gain a higher contrast. Histogram equalization accomplishes this by effectively spreading out the highly populated intensity values, which tend to degrade image contrast. The method is useful in images with backgrounds and foregrounds that are both bright or both dark. In particular, the method can lead to better views of bone structure in x-ray images and to better detail in photographs that are either over- or under-exposed. A key advantage of the method is that it is a fairly straightforward technique, adaptive to the input image and an invertible operation. So, in theory, if the histogram equalization function is known, then the original histogram can be recovered. The calculation is not computationally intensive. A disadvantage of the method is that it is indiscriminate. It may increase the contrast of background noise, while decreasing the usable signal. In scientific imaging, where spatial correlation is more important than intensity of signal (such as separating DNA fragments of quantized length), the small signal-to-noise ratio usually hampers visual detections. Histogram equalization often produces unrealistic effects in photographs; however, it is very useful for scientific images like thermal, satellite or x-ray images, often the same class of images to which one would apply false-color. Also histogram equalization can produce undesirable effects (like visible image gradient) when applied to images with low color depth. For example, if applied to an 8-bit image displayed with 8-bit gray-scale palette it will further reduce color depth (number of unique shades of gray) of the image. Histogram equalization will work the best when applied to images with much higher color depth than palette size, like continuous data or 16-bit gray-scale images. There are two ways to think about and implement histogram equalization, either as an image change or as a palette change. The operation can be expressed as P ( M ( I ) ) {\displaystyle P(M(I))} where I {\displaystyle I} is the original image, M {\displaystyle M} is the histogram equalization mapping operation, and P {\displaystyle P} is a palette. If we define a new palette as P ′ = P ( M ) {\displaystyle P'=P(M)} and leave image I {\displaystyle I} unchanged, then histogram equalization is implemented as palette change or mapping change. On the other hand, if palette P {\displaystyle P} remains unchanged and image is modified to I ′ = M ( I ) {\displaystyle I'=M(I)} then the implementation is accomplished by image change. In most cases, palette change is preferred as it preserves the original data. Modifications of this method use multiple histograms, called subhistograms, to emphasize local contrast rather than overall global contrast. Examples of such methods include adaptive histogram equalization and variations including contrast-limited adaptive histogram equalization, multipeak histogram equalization, and multipurpose beta-optimized bihistogram equalization (MBOBHE). The goal of these methods, especially MBOBHE, is to modify the algorithm to improve the contrast without producing brightness mean-shift and detail loss artifacts. A signal transform equivalent to histogram equalization also seems to happen in biological neural networks so as to maximize the output firing rate of the neuron as a function of the input statistics. This has been proved in particular in the fly retina.
Back projection The back projection of a histogrammed image is the re-application of the modified histogram to the original image, functioning as a look-up table for pixel brightness values. For each group of pixels taken from the same position from all input single-channel images, the function puts the histogram bin value to the destination image, where the coordinates of the bin are determined by the values of pixels in this input group. In terms of statistics, the value of each output image pixel characterizes the probability that the corresponding input pixel group belongs to the object whose histogram is used.
Implementation Consider a discrete grayscale image X {\displaystyle X} and let n i {\displaystyle n_{i}} be the number of occurrences of gray level i {\displaystyle i} . The probability of a pixel value chosen uniformly randomly from image X {\displaystyle X} being i {\displaystyle i} , is
p X ( i ) = n i n , 0 ≤ i < L {\displaystyle \ p_{X}(i)={\frac {n_{i}}{n}},\quad 0\leq i<L}
… excerpt ends here. Continue reading the full article.






