Histograms

 Contrast Enhancing

The adequate direct mapping selection is, in general, essentially empirical. However, an image histogram previous exam can be useful. The histogram is one of the most common ways to represent the gray level (GL) distribution from an image, and it is the most used technique in Digital Image Processing (DIP).

The histogram gives information about how many pixels in the image have a certain GL, defined between 0 (black) and 255 (white), for an image coded using 8 bits. Another characteristic is that the histogram does not present any spatial information of the image, just a probability function to find a GL related to an object in the image. Normally, the X axis represents the GL distribution and the Y axis the frequency the GL occurs (see the figure below).

A histogram describes the gray level statistical distribution as the number of samples ("pixels") in each level, and this distribution can also be given as a percentage of the total number of "pixels" in the image. An analogy can be established between an image histogram and a probability density function, which is a mathematical distribution model of the gray levels from an image class.

The histograms can be uni-dimensional (like the one in the figure above), that is, for a single image (band), or multi-dimensional when representing the distribution of two or more bands, where the two dimensional is the simplest. A two band histogram, or scattergram, as it is known, allows to analyze visually the correlation degree between the two bands and decide about the type of technique for contrast increase to be applied in multi spectral images.

The histogram shape gives important information as the average intensity and spreading of the gray level values, where the latter is the image contrast measure. The larger the spreading the higher the image contrast. The next figure shows a gray level distribution.

To increase an image contrast, the original gray level interval in the original image has to be expanded, using a function that maps the variations inside the original gray level interval, for another desired interval. This mapping is a punctual operation which uses a mathematical function called radiometric transformation, which takes into account only the original gray level in each pixel to compute the new value in the output image.

The following figure shows a contrast enhancing, where some gray levels in the 0 and a range will be mapped to 0, and those between b and N-1, will be saturated in N-1. After the radiometric transformation, the histogram of the output image with 0 and N-1 frequencies will be obtained, representing a larger distribution of the gray levels if compared to the original interval.

NOTE: It is possible to use as a contrast parameter the transfer function slope, represented by the plotted curve related to the XY axis. As a general rule increasing the curve slope, increases the contrast. If the slope is higher than 45 degrees the contrast will be expanded, and if the slope is smaller than 45 degrees the contrast will be compressed.

The following figures show two images extracted from the band 5 of the Landsat 5. The left image shows the original band, and the right image is enhanced by modifying the histogram.

ima_br_b5_original.gif - 23843 Bytes    ima_br_b5.gif - 35228 Bytes


The SPRING allows the contrast manipulation through several operations in the Operations menu, such as:

 

See how to manipulate contrast in the SPRING

 Enhancing Contrast