Image Processing Reference
In-Depth Information
Fig. 4.13
An example of histogram stretching
Conceptually it might be easier to appreciate the equation if we rearrange Eq.
4.3
:
255
f
2
−
g(x,y)
=
f
1
·
f(x,y)
−
f
1
·
a
⇔
(4.10)
f
1
·
f(x,y)
f
1
255
f
2
−
g(x,y)
=
−
(4.11)
First the histogram is shifted left so that
f
1
is located at 0. Then each value is
multiplied by a factor
a
so that the maximum value
f
2
−
f
1
becomes equal to 255.
In Fig.
4.13
an example of histogram stretching is illustrated.
If just one pixel has the value 0 and another 255, histogram stretching will not
work, since
f
2
−
255. A solution is
modified histogram stretching
where small
bins in the histogram are removed by changing their values to those of larger bins.
But if a significant number of pixels with very small and very high values exit, we
still have
f
2
−
f
1
=
255, and hence the histogram (and image) remains the same, see
Fig.
4.15
. A more robust method to improve the histogram (and image) is therefore
to apply
histogram equalization
.
f
1
=
4.3.2 Histogram Equalization
Histogram equalization is based on non-linear gray-level mapping using a
cumula-
tive histogram
.