Histogram Equalization
Histogram equalization is a technique for adjusting image intensities to enhance contrast.
Let f be a given image represented as a m
r
by m
c
matrix of integer pixel intensities ranging
from 0 to L − 1. L is t he number of possible intensity values, often 256. Let p denote the
normalized histogram of f with a bin fo r each possible intensity. So
p
n
=
number of pixels with intensity n
total number of pixels
n = 0, 1, ..., L − 1.
The histogram equalized image g will be defined by
g
i,j
= floor((L − 1)
f
i,j
X
n=0
p
n
), (1)
where floor() rounds down to the nearest integer. This is equivalent to transforming the
pixel intensities, k, of f by the function
T (k) = floor((L − 1)
k
X
n=0
p
n
).
The motivation f or this transformation comes from thinking of the intensities of f and g as
continuous random variables X, Y on [0, L − 1] with Y defined by
Y = T (X) = (L − 1)
Z
X
0
p
X
(x)dx, (2)
where p
X
is the probability density f unction of f . T is the cumulative distributive function
of X multiplied by (L − 1). Assume for simplicity that T is differentiable and invertible. It
can then be shown that Y defined by T (X) is uniformly distributed on [0, L − 1], namely
that p
Y
(y) =
1
L−1
.
Z
y
0
p
Y
(z)dz = probability that 0 ≤ Y ≤ y
= probability that 0 ≤ X ≤ T
−1
(y)
=
Z
T
−1
(y)
0
p
X
(w)dw
d
dy
Z
y
0
p
Y
(z)dz
= p
Y
(y) = p
X
(T
−1
(y))
d
dy
(T
−1
(y)).
1
评论0
最新资源