Histogram Equalization: Regional Adaptive

Jump to: navigation, search

The Histogram Equalization: Regional Adaptive algorithm, a high-pass filter, enhances the contrast in an image by reevaluating the gray-scale, or intensity, value of each pixel based on the values of nearby pixels in the same region.


Features in some images require a larger range of intensity values than are displayed. Histogram equalization is a method to improve the contrast of an area in an image by distributing an equal number of pixels across the range of intensities in the image. This algorithm tabulates the histogram for each region, then assigns the pixel to the new histogram level.

This algorithm acts in regions of an image, dividing the image into m rows and n columns. Each region is the source when remapping the histogram, adapting the value of the pixel to its location in the histogram of the region.


bin width-The permitted range of floating-point values of a pixel to equate to an intensity level in a 256-color image.

Although, depending on image type, there are some minor variations in how this algorithm proceeds, generally the algorithm first calculates the bin width of each region. It then processes each region by judging each pixel's location within this new histogram. Regardless of pixel value, the algorithm remaps the brightest pixel in each region to the brightest value in the histogram (i.e., 256) and remaps the darkest pixel to the lowest value in the histogram (i.e., 0) of the pixels' neighboring region, recording the new values as pixel-intensity values. The algorithm then processes each of the remaining regions in the original, or source, image in the same way and builds a new, or reference, image using the new pixel-intensity values.

Performing histogram equalization makes it possible to see minor variations within portions of the reference image that appeared nearly uniform in the source image. Arithmetically, the process in a region is rather simple:


where Ni is the intensity of the ith pixel, and T is the total number of pixels in the region.

The reference image using the new histogram is similar to the source image; however, in areas where the source image had similar values, the reference image is enhanced. The reference histogram now stretches over a greater proportion of the possible image intensities (Figure 1).

Figure 1. Source image and histogram and reference images and histograms for reference images that were separated into 1 x 1, 2 x 2, and 3 x 3 regions




Note: All histograms shown in this section are in log scale in the vertical axis.

The histogram for the source image is very compact in structure; that is, it has a great number of darker pixels, but very few brighter pixels. In fact, the bottom-most intensity values make up almost all of the pixels' values in the image. Note, however, in the histogram of the reference image, the look-up table is more evenly spread than that of the histogram for the source image. Also, areas of low intensity and low contrast in the source image were correspondingly remapped in the reference image to areas of higher contrast and generally overall brighter values.

Notice that different low areas of the reference image are more distinguishable depending on the number of rows and columns that divide the image. The contrast changes are due to which pixel is considered the brightest and which the darkest in a particular region. The brightest pixel in a 1 x 1 separated image is the brightest of the image. However, when the image is divided into more regions, the brightest pixel in the region gets remapped as one of the brightest pixels in the image regardless of its absolute intensity in the image. Likewise, the darkest pixel in the region is remapped as one of the darkest in the image regardless of its absolute intensity.

The histogram equalization process can enforce certain characteristics about the image called clipping. As the algorithm processes the image, it counts out the number of pixels of a certain intensity. Clipping cuts that counting short; it stores the excess pixels of a particular intensity and redistributes that number equally among all intensities. For instance, if a particular intensity must be clipped at 100 and the count is 145, the algorithm redistributes 45 pixels to other brightnesses. It adds to the count of each intensity level an equal number of pixels if there are enough excess, but it attempts to spread the excess over as many pixels as possible. Figure 2 shows examples of the source image from Figure 1 that was separated into 1 x 1 regions with no clipping, 45-percent clipping, and 75-percent clipping.

Image types

You can apply this algorithm to both color and black-and-white images.

Special notes

This algorithm only works on the whole image, not on volumes of interest (VOIs).

Figure 2. Examples of no clipping, 45-percent clipping, and 75-percent clipping



Refer to the following references for more information:

Bob Cromwell, "Localized Contrast Enhancement: Histogram Equalization," paper on his web site at http://www.cromwell-intl.com/3d/histogram/Index.html.

Douglas A. Lyon, Image Processing in Java (Upper Saddle River, New Jersey: Prentice-Hall, 1999).

Tamer Rabie, Rangaraj Rangayan, Raman Paranjape, "Adaptive-Neighborhood Image Deblurring," The University of Calgary, Department of Electrical and Computer Engineering (Calgary, Alberta, Canada: NEC Research Institute, 2002).

John Russ, The Image Processing Handbook (Boca Raton, Florida: CRC Press LLC, 2003).

J. Alex Stark, "Adaptive Image Contrast Enhancement Using Generalizations of Histogram Equalization," in IEEE Transactions on Image Processing (May 2000).

Claes Tidestav, "Short Introduction to Adaptive Equalization." (Uppsala, Swedon: Uppsala University, April 1996).

Applying the Histogram Equalization: Regional Adaptive algorithm

To run this algorithm, complete the following steps:

  1. Open an image.
  2. Perform, as an option, any other image processing on the image.
  3. Select Algorithms > Histogram Equalization > Regional Adaptive. The Regional Adaptive Histogram Equalization dialog box (Figure 3) opens.
  4. Complete the information in the dialog box.
  5. Click OK. The algorithm begins to run.

Figure 3. The Regional Adaptive Histogram Equalization dialog box

Divisions of width
Indicates the number of times the algorithm should divide the image in width to make a region.
If you select 2, the algorithm divides the image in width by 2 yielding two areas: a left side and a right side. Each is used separately for histogram equalization.

Divisions of height
Indicates the number of times the algorithm should divide the image in height to make a region.
If you select 3, the algorithm divides the image in height by 3 yielding three areas: a top, middle, and bottom part.
Activate clamping
Allows you to specify the maximum number of pixels with a certain pixel bin.
Selecting this check box makes Fraction of most frequent pixel intensity active.
Fraction of most frequent pixel intensity (%)
Indicates the percentage (1 through 99) of the maximum number of pixels per intensity allowed. The algorithm records and redistributes the pixels for any intensity that has more pixels than the calculated value. The default value is 75 percent. A lower value reduces the contrast of a region and is sometimes required to prevent parts of the image from becoming oversatured. To use this field, first select Activate clamping.
Red channel
Treats all of the pixels in the red channel as its own intensity as if the image were three separate monochrome images (only applicable to color images).
Green channel
Treats all of the pixels in the green channel as its own intensity as if the image were three separate monochrome images (only applicable to color images).
Blue channel
Treats all of the pixels in the blue channel as its own intensity as if the image were three separate monochrome images (only applicable to color images).
New image
Shows the results of the algorithm in a new image window.
Replace image
Replaces the source image with the results of the algorithm.
Applies the algorithm according to the specifications in this dialog box.
Disregards any changes you made in this dialog box and closes the dialog box.
Displays online help for this dialog box.
A pop-up window appears with the status. A series of status messages appear in the window.
When the algorithm finishes running, the pop-up window closes.
Depending on whether you selected New image or Replace image, the results appear in a new window or replace the image to which the algorithm was applied.