Saturday, October 30, 2004

Histogram Equalization

Histogram Equalization improves contrast and the goal of histogram equalization is to obtain a uniform histogram. This technique can be used on a whole image or just on a part of an image. Histogram equalization will not "flatten" a histogram. It redistributes intensity distributions. If the histogram of any image has many peaks and valleys, it will still have peaks and valley after equalization, but peaks and valley will be shifted. Because of this, "spreading" is a better term than "flattening" to describe histogram equalization.
OPERATION:
1. Compute the histogrm H(I), (counting each distinct pixel value in the image);
2. Caculate nomalize sum of histogram: H_n(I) = \sum _{n=0}^I H(n) max(I)(usually 255)/(number of pixels (262144 if it is a 512x512 image)) ;
3. Transform input to output using H_n(I) as LUT.

Matlab:

g = histeq (f, nlev);

f is the input image and nlev is the number of intensity levels specified for the output image. The default value of nlev=64.

Relative: Histogram Matching (histogram specification)

No comments:

Post a Comment