Digital Image Processing
LECTURE 04
IMAGE ENHANCEMENT-II
(HISTOGRAM PROCESSING)
Maryiam Zahoor
A Note About Grey Levels
So far when we have spoken about image grey level values we have said they are
in the range [0, 255]
Where 0 is black and 255 is white
There is no reason why we have to use this range
The range [0,255] stems from display
For many of the image processing operations in this lecture grey levels are
assumed to be given in the range [0.0, 1.0]
Image Histograms
Image Histograms
The histogram of an image shows us the distribution of grey levels in the image
Massively useful in image processing, especially in segmentation
Frequencies
Grey Levels
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Histogram Examples (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Histogram Examples (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Histogram Examples (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Histogram Examples (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Histogram Examples (cont…)
Histogram Examples (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
A selection of images and
their histograms
Notice the relationships
between the images and
their histograms
Note that the high contrast
image has the most
evenly spaced histogram
11
Histogram Equalization
The intensity levels in an image may be viewed as
random variables in the interval [0, L-1].
Let pr (r ) and ps ( s) denote the probability density
function (PDF) of random variables r and s.
Histogram Equalization
Histogram Equalization
Background (Probability
Distribution)
Histogram Equalization
Histogram Equalization
Histogram Equalization
Histogram Equalization(Summary)
Spreading out the frequencies in an image (or equalising
the image) is a simple way to improve dark or washed
out images
The formula for histogram
equalisation is given where
rk: input intensity
sk: processed intensity
k: the intensity range
Discrete values:
(e.g 0 – 255)
k
nj: the frequency of intensity j
sk T (rk ) ( L 1) pr (rj )
MN: number of pixels/ sum of all frequencies
j 0
k nj
L 1 k
( L 1) nj k=0,1,..., L-1
j 0 MN MN j 0
Example 2
Example 2
Example 2
Example
Histogram Equalization-Examples
Histogram Equalization-Examples
Histogram Equalization-Examples
Histogram Equalization-Examples
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Function
Equalisation Transformation
Histogram Equalization-Examples
Histogram Equalization-Examples
Histogram Equalization-Examples
Histogram Equalization-Examples
Histogram Specification/Matching
Histogram Specification/Matching
Histogram Specification/Matching
Histogram Specification/Matching
Example
Cont.
Cont.
Cont.
Cont.
Histogram Matching Example
Histogram Matching
Example(continued)
Histogram Matching Example
(continued)
Local Histogram Processing
Define a neighborhood and move its center from pixel to
pixel
At each location, the histogram of the points in the
neighborhood is computed. Either histogram equalization or
histogram specification transformation function is obtained
Map the intensity of the pixel centered in the neighborhood
Move to the next location and repeat the procedure
Local Histogram Processing:
Example