![]() Contrast Enhancement The enhancement technique is used to give a higher quality for images considering the subjective human eyes criteria. It is normally used as a pre-processing step for pattern recognition systems. The contrast between two objects can be defined as the ratio between their gray level averages. The contrast manipulation consists in a radiometric transference in each "pixel", with the purpose to increase the visual discrimination between the presented objects in the image. The point to point operation is performed, independently of the neighborhood. This radiometric transference is performed with the helping of histograms, that are manipulated to get the desired enhancements. Learn more about Histograms here. NOTES: 1- There is no rule which is better applied to the contrast enhancement in an image, because it depends on the same characteristics, such that: acquisition period, illumination angle, sensor height and bands. 2- The reason for increasing or decreasing the contrast in an image has to be really clear, even before executing it, once this processing might change the following operations. 3- When executing a contrast enhancement as a pre processing step, one has to know that part of the information can be lost, depending on how the contrast increase is performed (see about the overflow effect in the Min/Max operation). 4- A contrast increase will never give a new information, which is not in the original image. The contrast only presents the information in the raw data in a clearer way for the user. As it will be presented next, SPRING allows the contrast manipulation through several options available in the Operations menu item, such that:
Minimum Maximum - OptionThe histogram manipulation by the MinMax option is identical to the linear curve manipulation as it will be presented next. The difference is in the moment where the option is selected.
As it can be observed in the figure above, just after selecting an option, the system computes the minimum and maximum gray level values in the image. With these values a linear transformation is applied where a straight line is defined going from the position of the minimum value to the position of the maximum value. In this way there will be no information lost by overflow, that is, all the gray levels will keep the same number of pixels. An overflow happens when many pixels with different gray levels are transformed in a unique level, that is, when the transfer line inclination is exaggerated. Notice that in the figure below, where the overflow arrow is indicating, there is information lost, once pixels in column neighbor in the input histogram, which can be originally differentiated based on the gray level, will be aggregated in a single column and they will have the same gray level (0 in the figure below)
NOTICE: The overflow occurrence is desired many times, once the user knows what is the gray level interval of the desired enhancement area. Otherwise it will be losing information when the enhanced image is saved. Linear - OptionThe contrast increase by a linear transformation is the simplest option. The transference function is a line and only two parameters are controlled: the line slope and the intersection point with the X axis (see the figure below). The slope controls the contrast increasing quantity and the intersection point with the X axis controls the average intensity of the final image. The linear mapping function can be represented by:
In the linear contrast increase the bars that build the histogram of the output image are equally spaced, once the transfer function is a straight line. As one can see in the figure above, the output histogram will be identical, in format, to the input histogram, except that it will have an average value and a different spreading. Square Root - OptionThe square root transformation option is used to increase the contrast of the dark regions in the original image. The transformation function is represented by a curve, as shown in the figure below. Notice that the curve inclination is as higher as the gray level values are smaller. It can be expressed by a function:
where: Y = resulting gray level
NOTE: This mapping differs from the logarithm because it enhancements a larger low gray level interval (dark), while the logarithm enhancements a small interval. Square - OptionThis mapping is used when one wants to increase the white aspects contrast (high gray level values in the image). Notice, in the figure below, that the contrast increase is higher from the histogram average, even if there is a general displacement to the region of darker levels.
The transformation function is given by the equation: Y = AX2 where: X = original gray level Logarithm - OptionThe logarithm mapping of gray level values is useful to increase the contrast in dark features (low gray values). It is equivalent to a logarithm curve as shown in the figure below. The transformation function is given by the equation: Y = A log (X + 1) where: Y = new gray level value
NOTE: Notice, in the figure above, that there is a smaller portion of gray levels over a larger contrast increase, compared with the transformation by a square root, mentioned previously. Negative - OptionIt is an inverse linear mapping function, that is, the contrast occurs such that the darker areas (low gray level values) become lighter (high gray level values) and vice versa. The next figure shows this representation.
The negative mapping function can be represented by: Y = - (AX + B) where Y = new gray level value X = original gray level value A = straight line slope (angle's tangent) B = increment factor, defined by the minimum and maximum limits given by the user. NOTES: Notice that in all mentioned options so far, it is possible to get an overflow. All the contrast option mentioned above has the operation mode equals to the option described in the operation Histogram Manipulation option. Histogram Equalization - OptionThis is a histogram manipulation method that reduces the contrast automatically in very light or very dark areas in an image. It also expands the gray levels in the interval. It consists in a non linear transformation which considers the cumulative distribution of the original image, to generate a resulting image, where the histogram will be approximately uniform (see the figure below). The equalization option considers that the image contrast would be optimized if all possible 256 intensity levels were equally used, that is, all vertical bars in the histogram have the same height. Obviously this is not possible because the digital data discrete nature in a remote sensing image. However an approximation is obtained when spreading the image histogram peaks, leaving untouched all histogram flattening areas. As one can see in the figure below, this process is obtained through a transfer function that has a high slope every time the original histogram presents a peak, and a low slope in the remaining parts of the histogram.
SPRING presents the following histogram equalization function:
where : faxi = accumulated frequency for the xi gray level Pt = total population (total number of "pixels") NOTE: The equalization option is automatically computed and presented, such that the user can not change the curve position or shape, keeping the window in the static mode. Slicing - OptionThe slicing option (or gray level slicing) is a way to increase the contrast. The operation consists simply in enhancing the pixels with the intensity in the specific interval (the slice), that is, between a maximum and minimum. It consists in the division of the gray level total interval of certain slices (or color classes). The gray level slicing is considered the simplest classification way because it is applied to a single spectral band. According to the gray level interval determination criteria, it is possible to get a slicing normal, equidistribution and rainbow.
Equidistribution Slicing: the gray level interval is divided such that each slice has the same number of points.
Rainbow Slicing: is the gray level mapping to a certain color. It is based on the fact that color variations are much more visible to the human eye than the gray level variations. The global mapping of these levels for the color spacing follows the rainbow sequence.
In SPRING the gray level slicing is performed interactively where the user defines the slicing type and the number of slices. See how to make it in Gray Level Slicing. Edition - OptionIt allows the application of a radiometric transformation table defined by the user. Its purpose is to emphasize an specific aspect of the image that the user wants to analyze. Example: in case where an image presents dark regions (low gray levels) inside an area with small radiometric variations that are not of interest. It is possible to use the saturation limit to enhancement or attenuate the contrast with some image characteristic. The figure below shows the effect of the variation of the saturation threshold.
Editing in Bimodal When the working image presents an asymmetric histogram, as it is frequently observed, it is not recommended to work with a simple linear transformation. In this case, the user can specify in the window a linear transformation by parts. This offers a higher degree of freedom in the specification of the output histogram, reducing the histogram asymmetry and better using the interval of available gray levels. See figure:
The figure below shows a straight line with three points, where the new histogram was computed such that only the input histogram extremities was enhanced, while the straight line segment in the horizontal made the input histogram central part reduced to a single gray level, causing an overflow in the region.
See how to edit a histogram in Editing a Histogram. ![]() |