How to Solve Histogram Equalization Numerical Problem in MATLAB?
Histogram Equalization is a mathematical technique to widen the dynamic range of the histogram. Sometimes the histogram is spanned over a short range, by equalization the span of the histogram is widened. In digital image processing, the contrast of an image is enhanced using this very technique.
Use of Histogram Equalization:
It is used to increase the spread of the histogram. If the histogram represents the digital image, then by spreading the intensity values over a large dynamic range we can improve the contrast of the image.
- Find the frequency of each value represented on the horizontal axis of the histogram i.e. intensity in the case of an image.
- Calculate the probability density function for each intensity value.
- After finding the PDF, calculate the cumulative density function for each intensity’s frequency.
- The CDF value is in the range 0-1, so we multiply all CDF values by the largest value of intensity i.e. 255.
- Round off the final values to integer values.
A 3-bit image of size 4×5 is shown below. Compute the histogram equalized image.
- Find the range of intensity values.
- Find the frequency of each intensity value.
- Calculate the probability density function for each frequency.
- Calculate the cumulative density function for each frequency.
- Multiply CDF with the highest intensity value possible.
- Round off the values obtained in step-5.
Overview of calculation: Range of intensity values = [0, 1, 2, 3, 4, 5, 6, 7] Frequency of values = [1, 6, 3, 2, 3, 2, 1, 2] total = 20 = 4*5 Calculate PDF = frequency of each intensity/Total sum of all frequencies, for each i value of intensity Calculate CDF =cumulative frequency of each intensity value = sum of all PDF value (<=i) Multiply CDF with 7. Round off the final value of intensity.
The tabular form of the calculation is given here:
Interpretation: The pixel intensity in the image has modified. 0 intensity is replaced by 0. 1 intensity is replaced by 2. 2 intensity is replaced by 4. 3 intensity is replaced by 4. 4 intensity is replaced by 5. 5 intensity is replaced by 6. 6 intensity is replaced by 6. 7 intensity is replaced by 7.
Output: The new image is as follow:
My Personal Notes arrow_drop_up
Please Login to comment...