The highest gain therefore occurs at DNs with the most pixels. Where the CDF increases rapidly, the contrast gain also increases. Because of the unimodal shape of most image histograms, equalization tends to automatically reduce the contrast in very light or dark areas and to expand the middle DNs toward the low and high ends of the GL scale. Equalization refers to the fact that the histogram of the processed image is approximately uniform in density (number of pixels /GL) ( Gonzalez and Woods, 2002).
It is achieved by using the Cumulative Distribution Function (CDF) of the image as the transformation function, after appropriate scaling of the ordinate axis to correspond to output GLs.
Histogram equalization is a widely-used nonlinear transformation ( Fig. More than two linear segments may be used in the transformation for better control over the image contrast. The transformation parameters are selected to move the input minimum and maximum DNs to the extremes of the display GL range and to move the mode of the histogram to the center of the display range (128). This example is a two segment stretch, with the left segment having a higher gain than the right segment. With a piecewise-linear transformation, more control is gained over the image contrast, and the histogram asymmetry can be reduced, thus making better use of the available display range ( Fig. If the image histogram is asymmetric, as it often is, it is impossible to simultaneously control the average display GL and the amount of saturation at the ends of the histogram with a simple linear transformation. SchowengerdtProfessor, in Remote Sensing (Third edition), 2007 Nonlinear stretch