Professional Documents
Culture Documents
EQUALIZATION
PRESENTED BY:
UNATI (04161913049)
INTRODUCTION
• Histogram equalization is a technique used in
image processing to enhance the contrast of an
image.
• The goal of histogram equalization is to spread
out the intensity values of an image's histogram so
that the entire range of values is utilized, resulting
in a more balanced distribution of pixel
intensities.
• The histogram of an image represents the
frequency distribution of pixel intensities. It plots
the number of pixels at each intensity level,
ranging from 0 to 255 for an 8-bit grayscale
image.
• The histogram can provide information about the
overall brightness and contrast of an image.
PROCESS OF HISTOGRAM:
1. Compute the histogram of the image: The histogram represents the frequency distribution of pixel intensities
in the image. It calculates the number of occurrences of each intensity value in the image.
2. Compute the cumulative distribution function (CDF) of the histogram: The CDF is calculated by summing
up the histogram values. It represents the cumulative probability of each intensity value in the image.
3. Calculate the transformation function using the CDF: The transformation function is derived from the CDF.
It maps the input pixel intensities to their new values. The transformation function ensures that the pixel
intensities are redistributed in a way that the resulting image has a more uniform histogram.
4. Apply the transformation function to map the pixel intensities: Iterate over each pixel in the image and use
the transformation function to map the old intensity to the new intensity.
5. Stretch the histogram if desired by clipping the intensity values: By default, histogram equalization
stretches the entire range of intensity values to cover the full range of the output.
PROCESS OF HISTOGRAM:
Read the image (pixel by pixel) Get image size Get image Histogram
Get Cumulative
Distributive Function
(CDF)
grayImage = rgb2gray(image);
histogram = imhist(grayImage);
subplot(1, 2, 1);
imshow(grayImage);
title('Original Image');
subplot(1, 2, 2);
imshow(equalizedImage);
title(‘Histogram Equalized Image');
1) Image Enhancement: Histogram equalization enhances image contrast and
brings out details.
4 4 4 4 4
• Maximum gray value = 5
• No. of possible gray values = 8 that varies from 0 to 7
3 4 5 4 3
F(x,y)= 3 5 5 5 3
Histogram
3 4 5 4 3
16
4 4 4 4 4 14
No. of Pixels
12
10
8
6
4
Gray level 0 1 2 3 4 5 6 7 2
0
No. of Pixel (nk) 0 0 0 6 14 5 0 0 0 1 2 3 4 5 6 7
Gray Level
Gray Level No. of Pixel PDF = nk/N CDF (sk) = Σ PDF Sk * 7 (Gray Round of
= nk Level) Histogram
Equalization
Level
0 0 0/25 = 0 0+0 = 0 7*0 = 0 0
1 0 0/25 = 0 0+0 = 0 7*0 = 0 0
2 0 0/25 = 0 0+0 = 0 7*0 = 0 0
3 6 6/25 = 0.24 0+0.24 = 0.24 7*0.24 = 1.68 2
4 14 14/25 = 0.56 0.24+ 0.56 = 0.8 7*0.8 = 5.6 6
5 5 5/25 = 0.2 0.8+0.2 = 1 7*1= 7 7
6 0 0/25 = 0 1+0 = 1 7*1 = 7 7
7 0 0/25 = 0 1+0 = 1 7*1 = 7 7
Input Image Output Image
4 4 4 4 4 6 6 6 6 6
3 4 5 4 3 2 6 7 6 2
After Equalization
3 5 5 5 3 2 7 7 7 2
3 4 5 4 3 2 6 7 6 2
4 4 4 4 4 6 6 6 6 6
14 14
12 12
10 10
8 8
6 6
4 4
2 2
0 0
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
1.Contrast enhancement: Histogram equalization improves the contrast of an
image by redistributing the pixel intensities.
1. https://www.tutorialspoint.com/dip/histogram_equalization.htm
2. https://www.mygreatlearning.com/blog/histogram-equalization-explained/
3. https://www.geeksforgeeks.org/histogram-equalization-in-digital-image-processing/
4. https://medium.com/@kyawsawhtoon/a-tutorial-to-histogram-equalization-497600f270e2
5. https://people.ece.ubc.ca/irenek/techpaps/introip/manual02.html
6. https://www.imageeprocessing.com/2011/04/matlab-code-histogram-equalization.html
7. https://www.bogotobogo.com/Matlab/Matlab_Tutorial_Digital_Image_Processing_5_Histogra
m_Equalization_imhist_histeq_imadjust.php