| Previous | Table of Contents | Next |
Histogram stretches scale output pixel values by some constant.
(output pixel value) = (constant value) * (input pixel value)
Figure 12-5 Mapping function that slopes up at 45º
Figure 12-6 Mapping function with a constant greater than 1
Figure 12-7 Mapping function with a constant less than 1
If the constant has a value of one, the mapping function is the identity mapping function represented in Figure 12-5 which consists of a line that slopes up at 45º. If the constant is greater than one, then mapping function spreads out the histogram and has a graph consisting of a line that slopes up at an angle greater than 45º as illustrated in Figure 12-6. If the constant is a value less than one, then the mapping function is a histogram shrink and has a graph that is a line that slopes up at an angle less than 45º as illustrated in Figure 12-7.
Histogram equalization is another point process that attempts to improve contrast by spreading out an input histogram. It attempts to distribute output pixels so that equal-sized pixel value ranges contain the same number of output pixels. It does this by first determining the number of allowable output values based on some criteria such as image bit depth constrained by monitor slew rates. It then generates a histogram and divides the total number of pixels by the number of allowable output values. The division produces the average number of output pixel values to assign to each output value.
The approach then assigns a zero output value to input pixel values zero through the minimum allowable output value and continues to assign sequentially larger input pixel values a zero value until the total number of pixels assigned a zero value exceeds the calculated average pixel count. The approach then advances one or more output values until the cumulative output average drops below the average number of output pixel values. At that point, the process begins assigning output values again until the calculated average is exceeded again. Because images involve quantized data, a pixel input value range sometimes maps to a single output value. Other times, output values have no corresponding input points.
There are several histogram equalization approaches. One, called adaptive histogram equalization, is sometimes compared to traditional darkroom dodging and burning. It consists of tiling an input image into individual non-overlapping, equal-sized areas and performing histogram equalization independently on each area. However, darkroom dodging and burning is actually a point operation over small areas and not an area operation.
Another approach divides an image into overlapping, equal-sized areas and performs histogram equalization independently on each area. Pixel output values for each pixel are then calculated by weighting the various histogram values assigned to each pixel. The weights are assigned by calculating how far the pixel position is from the center of the respective histogram area. The United States Justice Department used this technique to enhance the Rodney King videotape footage.
Point operation approaches sometimes construct algorithms using global image data such as histograms. Thereafter, output value calculations only consider input pixel values. In contrast, area operations consider individual input pixel values and a small area surrounding the input pixel. One example of an area operation is called a spatial filter.
Recalling Chapter 11, running computations used a one-dimensional filter kernel which weighted pixel values surrounding calculation input points. So, Chapter 11 computations involved operations using values to the left and right of input values. Since image pixels have two-dimensional (row, column) positions, this allows masks, referred to as spatial filters, that have two dimensions.
Spatial filters are usually represented as two-dimensional, square matrices that have an odd number of rows and columns [size (2n+1)x(2n+1)]. The individual matrix elements are called taps or weights. The matrix of weights is usually horizontally and vertically symmetrical. The odd number of rows and columns provides a central weight which is spatially coincident with the input pixel. Output value calculations occur at every input pixel position by using the spatial filter elements as coefficients to multiply corresponding points surrounding the input pixel point. It is a simple process but difficult to describe. To understand the calculation process, consider the following hypothetical 3x3 spatial filter kernel and input image portions:
Hypothetical Input Image Portion:
| ... | ... | ... | ... | ... | ... |
| ... | 201 | 202 | 203 | 204 | ... |
| ... | 205 | 206 | 207 | 208 | ... |
| ... | 209 | 210 | 211 | 212 | ... |
| ... | 213 | 214 | ... | ... | ... |
| ... | ... | ... | ... | ... | ... |
Hypothetical Spatial Filter:
| 2 | 4 | 6 |
| 8 | 10 | 12 |
| 14 | 16 | 18 |
| Previous | Table of Contents | Next |