Histogram equalization

From Wikipedia, the free encyclopedia

Histogram equalization is a method in image processing of contrast adjustment using the image's histogram.

Contents

[edit] Overview

This method usually increases the local contrast of many images, especially when the usable data of the image is represented by close contrast values. Through this adjustment, the intensities can be better distributed on the histogram. This allows for areas of lower local contrast to gain a higher contrast without affecting the global contrast. Histogram equalization accomplishes this by effectively spreading out the most frequent intensity values.

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 over or under-exposed. A key advantage of the method is that it is a fairly straightforward technique and an invertible operator. 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.

[edit] Back project

The back project 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 probability that the corresponding input pixel group belongs to the object whose histogram is used.[ 1 ]

[edit] Implementation

Consider a discrete grayscale image, and let ni be the number of occurrences of gray level i. The probability of an occurrence of a pixel of level i in the image is

p(x_i) = \frac{n_i}{n}, i\in {0,..., L - 1}

L being the total number of gray levels in the image, n being the total number of pixels in the image, and p being in fact the image's histogram, normalized to 0..1.

Let us also define c as the cumulative distribution function corresponding to p, defined by:

c(i) = \sum_{j=0}^i p(x_j)

c is the image's accumulated normalized histogram.

We would like to create a transformation of the form \,y = T(x) that will produce a level y for each level x in the original image, such that the cumulative probability function of y will be linearized across the value range. The transformation is defined by:

\,y_i = T(x_i) = c(i)

Notice that the T maps the levels into the domain of 0..1. In order to map the values back into their original domain, the following simple transformation needs to be applied on the result:

y_i' = y_i \cdot(\max - \min) + \min

The above describes histogram equalization on a greyscale image. However it can also be used on color images by applying the same method separately to the Red, Green and Blue components of the RGB color values of the image.

[edit] Example

An unequalized image
An unequalized image
Corresponding histogram
Corresponding histogram
Same image after histogram equalization
Same image after histogram equalization
Corresponding histogram
Corresponding histogram

[edit] References

  1. ^  Intel Corporation (2001). "Open Source Computer Vision Library Reference Manual" (PDF). Intel Corporation. Retrieved on 2006-08-18.

[edit] External links

In other languages