Professional Documents
Culture Documents
Histogram
Histogram
Histogram
Histogram
h(rk ) = nk
L−1
X
p(rk ) = 1
k=0
Examples
3.3 Histogram Processing Lecture 3 (page 3)
s = T (r), r ∈ [0, 1]
r = T −1(s), s ∈ [0, 1]
3.3 Histogram Processing Lecture 3 (page 4)
ds dT (r)
=
dr dr
d ½Z r ¾
= pr (w) dw
dr 0
= pr (r)
¯ ¯
dr ¯¯¯ ¯
¯
¯
⇒ ps(s) = pr (r) ¯¯¯ ¯
¯
ds ¯ ¯
¯
¯
1 ¯¯¯¯
¯
¯
= pr (r) ¯
¯
¯
¯
pr (r) ¯¯
¯
= 1, s ∈ [0, 1]
3.3 Histogram Processing Lecture 3 (page 5)
Z
r
Thus for T (r) = 0 pr (w) dw, ps(s) is always uniform
Recall
nk
p(rk ) = , k = 0, 1, 2, . . . , L − 1
n
NB: This will not produce a uniform histogram, but will tend
to spread the histogram of the input image
Advantages:
• Gray-level values cover entire scale (contrast enhancement)
• Fully automatic
3.3 Histogram Processing Lecture 3 (page 6)
Transformation functions
3.3 Histogram Processing Lecture 3 (page 8)
thus
G(z) = T (r)
and
z = G−1(s) = G−1 [ T (r) ]
3.3 Histogram Processing Lecture 3 (page 9)
Discrete formulation
Recall histogram equalization...
k
X
sk = T (rk ) = pr (rj )
j=0
k
X nj
= , k = 0, 1, 2, . . . , L − 1
j=0 n
k
X
sk = T (rk ) = pr (rj )
j=0
k
X nj
= , k = 0, 1, 2, . . . , L − 1
j=0 n
k
X
vk = G(zk ) = pz (zi) = sk , k = 0, 1, 2, . . . , L − 1
i=0
r0 −→ T −→ s0
r1 −→ T −→ s1
.. .. ..
rL−1 −→ T −→ sL−1
z0 −→ G −→ s0 = v0
z1 −→ G −→ s1 = v1
.. .. ..
zL−1 −→ G −→ sL−1 = vL−1
3.3 Histogram Processing Lecture 3 (page 11)
E · f (x, y) if mSxy ∈ [0, k0MG] AND σSxy ∈ [k1DG, k2DG]
g(x, y) =
f (x, y) otherwise