Adaptive Histogram Equalization Is A Computer Image Processing Technique Used To Improve Contrast
Adaptive Histogram Equalization Is A Computer Image Processing Technique Used To Improve Contrast
It differs from ordinary histogram equalization in the respect that the adaptive method computes several histograms, each corresponding to a distinct section of the image, and uses them to redistribute the lightness values of the image. Ordinary histogram equalization simply uses a single histogram for an entire image. Consequently, adaptive histogram equalization is considered an image enhancement technique capable of improving an image's local contrast, bringing out more detail in the image. However, it also can produce significant noise. A generalization of adaptive histogram equalization called contrast limited adaptive histogram equalization, also known as CLAHE, was developed to address the problem of noise amplification. Histogram equalization is a method in image processing of contrast adjustment using the image's histogram.
Contents
[hide]
1 Overview o 1.1 Back projection 2 Implementation 3 Histogram equalization of color images 4 Examples o 4.1 Small image o 4.2 Full-sized image 5 Notes 6 References 7 External links
[edit] Overview
This method usually increases the global contrast of many images, especially when the usable data of the image is represented by close contrast values. Through this adjustment, the intensities can be better distributed on the histogram. This allows for areas of lower local contrast to gain a higher contrast without affecting the global contrast. Histogram
equalization accomplishes this by effectively spreading out the most frequent intensity values. The method is useful in images with backgrounds and foregrounds that are both bright or both dark. In particular, the method can lead to better views of bone structure in x-ray images, and to better detail in photographs that are over or under-exposed. A key advantage of the method is that it is a fairly straightforward technique and an invertible operator. So in theory, if the histogram equalization function is known, then the original histogram can be recovered. The calculation is not computationally intensive. A disadvantage of the method is that it is indiscriminate. It may increase the contrast of background noise, while decreasing the usable signal. In scientific imaging where spatial correlation is more important than intensity of signal (such as separating DNA fragments of quantized length), the small signal to noise ratio usually hampers visual detection. Histogram equalization provides better detectability of fragment size distributions, with savings in DNA replication, toxic fluorescent markers and strong UV source requirements, whilst improving chemical and radiation risks in laboratory settings, and even allowing the use of otherwise unavailable techniques for reclaiming those DNA fragments unaltered by the partial fluorescent marking process. Histogram equalization often produces unrealistic effects in photographs; however it is very useful for scientific images like thermal, satellite or x-ray images, often the same class of images that user would apply false-color to. Also histogram equalization can produce undesirable effects (like visible image gradient) when applied to images with low color depth. For example if applied to 8-bit image displayed with 8-bit gray-scale palette it will further reduce color depth (number of unique shades of gray) of the image. Histogram equalization will work the best when applied to images with much higher color depth than palette size, like continuous data or 16-bit gray-scale images. There are two ways to think about and implement histogram equalization, either as image change or as palette change. The operation can be expressed as P(M(I)) where I is the original image, M is histogram equalization mapping operation and P is a palette. If we define new palette as P'=P(M) and leave image I unchanged then histogram equalization is implemented as palette change. On the other hand if palette P remains unchanged and image is modified to I'=M(I) then the implementation is by image change. In most cases palette change is better as it preserves the original data. Generalizations of this method use multiple histograms to emphasize local contrast, rather than overall contrast. Examples of such methods include adaptive histogram equalization and contrast limiting adaptive histogram equalization or CLAHE. Histogram equalization also seems to be used in biological neural networks so as to maximize the output firing rate of the neuron as a function of the input statistics. This has been proved in particular in the fly retina.[1]
Histogram equalization is a specific case of the more general class of histogram remapping methods. These methods seek to adjust the image to make it easier to analyze or improve visual quality (e.g., retinex)
[edit] Implementation
Consider a discrete grayscale image {x} and let ni be the number of occurrences of gray level i. The probability of an occurrence of a pixel of level i in the image is
L being the total number of gray levels in the image, n being the total number of pixels in the image, and px being in fact the image's histogram, normalized to [0,1]. Let us also define the cumulative distribution function corresponding to px as
, which is also the image's accumulated normalized histogram. We would like to create a transformation of the form y = T(x) to produce a new image {y}, such that its CDF will be linearized across the value range, i.e.
for some constant K. The properties of the CDF allow us to perform such a transform (see Cumulative distribution function#Inverse); it is defined as
Notice that the T maps the levels into the range [0,1]. In order to map the values back into their original range, the following simple transformation needs to be applied on the result:
[edit] Examples
[edit] Small image
The following is the same 8x8 subimage as used in JPEG. The 8-bit greyscale image shown has the following values:
The histogram for this image is shown in the following table. Pixel values that have a zero count are excluded for the sake of brevity. Valu Count Value Count Value Count Value Count Value Count e
52
64
72
85
113
55
65
73
87
122
58
66
75
88
126
59
67
76
90
144
60
68
77
94
154
61
69
78
104
62
70
79
106
63
71
83
109
The cumulative distribution function (cdf) is shown below. Again, pixel values that do not contribute to an increase in the cdf are excluded for brevity. Valu cdf Value cdf Value cdf Value cdf Value cdf e
52
64
19 72
40 85
51 113
60
55
65
22 73
42 87
52 122
61
58
66
24 75
43 88
53 126
62
59
67
25 76
44 90
54 144
63
60
10 68
30 77
45 94
55 154
64
61
14 69
33 78
46 104
57
62
15 70
37 79
48 106
58
63
17 71
39 83
49 109
59
This cdf shows that the minimum value in the subimage is 52 and the maximum value is 154. The cdf of 64 for value 154 coincides with the number of pixels in the image. The cdf must be normalized to [0,255]. The general histogram equalization formula is:
Where cdfmin is the minimum value of the cumulative distribution function (in this case 1), M N gives the image's number of pixels (for the example above 64, where M is width and N the height) and L is the number of grey levels used (in most cases, like this one, 256). The equalization formula for this particular example is:
For example, the cdf of 78 is 46. (The value of 78 is used in the bottom row of the 7th column.) The normalized value becomes
Once this is done then the values of the equalized image are directly taken from the normalized cdf to yield the equalized values:
Notice that the minimum value (52) is now 0 and the maximum value (154) is now 255.
Original
Equalized
An unequalized image
[edit] Notes
1. ^ Laughlin, S.B (1981). "A simple coding procedure enhances a neurons information capacity". Z.
Naturforsch. 910(36):9102. 2. ^ Intel Corporation (2001) (PDF). Open Source Computer Vision Library Reference Manual. http://www.itee.uq.edu.au/~iris/CVsource/OpenCVreferencemanual.pdf. Retrieved 2006-08-18.
[edit] References
Acharya and Ray, Image Processing: Principles and Applications, WileyInterscience 2005 ISBN 0-471-71998-6 Russ, The Image Processing Handbook: Fourth Edition, CRC 2002 ISBN 08493-2532-3
"Histogram Equalization" at Generation5 Open Source Computer Vision Library Wiki: Histograms Free histogram equalization plugin for Adobe Photoshop and PSP Page by Ruye Wang with good explanation and pseudo-code
Each time an image is acquired, window and level parameters must be adjusted to 9 maximize contrast and structure visibility. This must be done before the image is 9 saved in any other format than the generic format of the acquisition software HIS.For the moment, very little post-processing in addition to window-level is applied to the image after its acquisition. This is due in part to the good quality of the image without processing, but also because of the short experience and tools we have working with 16 bit images. CLAHE seems a good algorithm to obtain a good looking image directly from a raw HIS image, without window and level adjustment. This is one possibility to automatically display an image without user intervention. Further investigation of this approach is necessary.
CLAHE
CLAHE was originally developed for medical imaging and has proven to be successful for enhancement of low-contrast images such as portal films. The CLAHE algorithm partitions the images into contextual regions and applies the histogram equalization to each one. This evens out the distribution of used grey values and thus makes hidden features of the image more visible. The full grey spectrum is used to express the image. Contrast Limited Adaptive Histogram Equalization, CLAHE, is an improved version of AHE, or Adaptive Histogram Equalization. Both overcome the limitations of standard histogram equalization. A variety of adaptive contrast-limited histogram equalization techniques (CLAHE) are provided. Sharp field edges can be maintained by selective enhancement within the field boundaries. Selective enhancement is accomplished by first detecting the field edge in a portal image and then only processing those regions of the image that lie inside the field edge. Noise can be reduced while maintaining the high spatial frequency content of the image by applying a combination of CLAHE, median filtration and edge sharpening. This technique known as Sequential processing can be recorded into a user macro for repeat application at any time. A variation of the contrast limited technique called adaptive histogram clip (AHC) can also be applied. AHC automatically adjusts clipping level and moderates over enhancement of
2D Minimum Filter
The minimum filter replaces the value of a pixel by the smallest value of neighboring pixels covered by a NxN matrix mask. The size of the mask can be adjusted via the input field kernel size. A value of 3 denotes a 3x3 mask. If applied to a binary label field the minimum filter implements a so-called erosion operation. It reduces the size of a segmented region by removing pixels from its boundary.
2D Median Filter
The median filter is a simple edge-preserving smoothing filter. It may be applied prior to segmentation in order to reduce the amount of noise in a stack of 2D images. The filter works by sorting pixels covered by a NxN mask according to their grey value. The center pixel is then replaced by the median of these pixels, i.e., the middle entry of the sorted list. The size of the pixel mask may be adjusted via the text field labeled kernel size. A value of 3 denotes a 3x3 mask. An odd value is required.
2D Maximum Filter
The maximum filter replaces the value of a pixel by the largest value of neighboring pixels covered by a NxN mask. The size of the mask can be adjusted via the input field kernel size. A value of 3 denotes a 3x3 mask. If applied to a binary label field the maximum filter implements a so-called dilation operation. It enlarges the size of a segmented region by adding pixels to its boundary.