You are on page 1of 8

Histogram equalization derivation

1/3

Input: histogram H(p) of the N N image with gray leveles p = p0, pk . Aim: nd a monotonic pixel brightness transformation q = T (p), such that the desired output histogram G(q) is uniform over the whole output brightness scale q = q0, qk . The monotonicity of the transformation implies:
k k

G(qi) =
i=0 i=0

H(pi) .

Equalized histogram uniform density N2 G(q) = . qk q0

Histogram equalization derivation II


2/3

The exactly uniform histogram may be obtained only in continuous space.


q p

G(s) ds =
q0 p0

H(s) ds .

Histogram equalization derivation II


2/3

The exactly uniform histogram may be obtained only in continuous space.


q p

G(s) ds =
q0 q q0

H(s) ds .
p0 p

N2 ds = qk q0

H(s) ds .
p0

Histogram equalization derivation II


2/3

The exactly uniform histogram may be obtained only in continuous space.


q p

G(s) ds =
q0 q q0

H(s) ds .
p0 p

N2 ds = qk q0

H(s) ds .
p0 p

N 2(q q0) = qk q0

H(s) ds .
p0

Histogram equalization derivation II


2/3

The exactly uniform histogram may be obtained only in continuous space.


q p

G(s) ds =
q0 q q0

H(s) ds .
p0 p

N2 ds = qk q0

H(s) ds .
p0 p

N 2(q q0) = qk q0

H(s) ds .
p0 p

N 2(q q0) = (qk q0)


p0

H(s) ds .

Histogram equalization derivation II


2/3

The exactly uniform histogram may be obtained only in continuous space.


q p

G(s) ds =
q0 q q0

H(s) ds .
p0 p

N2 ds = qk q0

H(s) ds .
p0 p

N 2(q q0) = qk q0

H(s) ds .
p0 p

N 2(q q0) = (qk q0)


p0

H(s) ds .

q = T (p)

Histogram equalization derivation II


2/3

The exactly uniform histogram may be obtained only in continuous space.


q p

G(s) ds =
q0 q q0

H(s) ds .
p0 p

N2 ds = qk q0

H(s) ds .
p0 p

N 2(q q0) = qk q0

H(s) ds .
p0 p

N 2(q q0) = (qk q0) qk q0 q = T (p) = N2


p0 p

H(s) ds . H(s) ds + q0 .
p0

Histogram equalization derivation III


3/3

Continous space distribution function qk q0 q = T (p) = N2 Dicrete space cumulative histogram qk q0 H(i) + q0 . q = T (p) = 2 N i=p
0

H(s) ds + q0 .
p0