lecture6
lecture6
Lecture 6:
3/27/2025 Capital University of Science and Technology Digital Image Processing CPE3643 1
3/27/2025 Capital University of Science and Technology Digital Image Processing CPE3643 2
1
Histogram equalization: continuous case
▪ Idea: To find a non-linear transformation
s = T (r)
to be applied to each pixel of the input image f(x,y), such that a
uniform distribution of gray levels in the entire range results for
the output image g(x,y).
3/27/2025 Capital University of Science and Technology Digital Image Processing CPE3643 3
2
Background (probability distribution)
▪ Assume continuous random variables
Cumulative Distribution Function (cdf)
▪ The probability that the random variable is less than or equal to a
specified constant a. We write this as
3/27/2025 Capital University of Science and Technology Digital Image Processing CPE3643 5
3/27/2025 Capital University of Science and Technology Digital Image Processing CPE3643 6
3
Histogram equalization
If the following transformation function is used
r
s = T (r ) = pr ( )d for 0 r 1
0
Then the pdf ps(s) = 1 over the range 0 s 1
In words
If we select T(r) as the cumulative distribution of r
Then the output image will have a uniform pdf of gray levels
Now Consider
1. a digital (gray level) case
2. the gray levels 0 r L −1
3/27/2025 Capital University of Science and Technology Digital Image Processing CPE3643 7
nj L −1
4
Histogram equalization examples
Input image Output image
Equalized histogram
Equalized histogram
high contrast image Output image
3/27/2025 Capital University of Science and Technology Digital Image Processing CPE3643 10
10
5
Histogram equalization examples
Dark input image Output image
Equalized histogram
Equalized histogram
Bright input image Output image
3/27/2025 Capital University of Science and Technology Digital Image Processing CPE3643 11
11
12
6
Histogram equalization examples
3/27/2025 Capital University of Science and Technology Digital Image Processing CPE3643 13
13
3/27/2025 Capital University of Science and Technology Digital Image Processing CPE3643 14
14
7
Histogram equalization examples
3/27/2025 Capital University of Science and Technology Digital Image Processing CPE3643 15
15
3/27/2025 Capital University of Science and Technology Digital Image Processing CPE3643 16
16
8
Local histogram processing
The histogram processing methods mentioned up to now
are global transformation where:
▪ Function is designed according to the gray-level
distribution over an entire image
▪ Global transformation methods may not be suitable for
enhancing details over small areas (where number of
pixels may have negligible influence on designing the
global transformation function)
3/27/2025 Capital University of Science and Technology Digital Image Processing CPE3643 17
17
3/27/2025 Capital University of Science and Technology Digital Image Processing CPE3643 18
18
9
Local histogram equalization example
3/27/2025 Capital University of Science and Technology Digital Image Processing CPE3643 19
19
3/27/2025 Capital University of Science and Technology Digital Image Processing CPE3643 20
20
10