Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Digital Image Processing

Lecture 6 - Image Enhancement –


Histogram Processing

Image Enhancement

 Process an image to make the result more suitable than


the original image for a specific application
 Image enhancement is subjective (problem /application
oriented) matter
 Image enhancement methods:
– Spatial domain: Direct manipulation of pixel in an image (on the
image plane)
– Frequency domain: Processing the image based on modifying
the Fourier transform of an image
 Many techniques are based on various combinations of
methods from these two categories
Dr. Chiranji Lal Chowdhary, VIT
Vellore

Point processing

 Simple gray level transformations


– Image negatives
– Log transformations
– Power-law transformations
– Contrast stretching
– Gray-level slicing
– Bit-plane slicing
 Histogram processing
– Histogram equalization
– Histogram matching (specification)
 Arithmetic/logic operations
– Image averaging

Dr. Chiranji Lal Chowdhary, VIT


Vellore

1
Histogram Processing

Histogram Equalization
Histogram Matching
Local Histogram Processing
Using Histogram Statistics for Image
Enhancement

Dr. Chiranji Lal Chowdhary, VIT


Vellore

Histogram

 Histogram : is the discrete function hist[rk]=nk , where rk is the kth


gray level in the range of [0, L-1] and nk is the number of pixels
having gray level rk.
 Gray-level histogram is a function showing, for each gray level, the
number of pixels in the image that have that gray level.

nk  hist[ rk ]  
f  x , y   rk
1

 Normalized histogram : is p(rk)=nk/N, for k=0,1,…,L-1 and p(rk)


can be considered to give an estimate of the probability of
occurrence of gray level rk.
 Normalized histogram (probability):

k) 
pDr.(rChiranji Laln
k / N VIT
Chowdhary,
Vellore

Histogram –
Examples

Dr. Chiranji Lal Chowdhary, VIT


Vellore

2
Example

Dr. Chiranji Lal Chowdhary, VIT


Vellore

Question
 What does the histogram of a low-contrast image look
like?
 How about high-contrast?

Dr. Chiranji Lal Chowdhary, VIT


Vellore

Histogram equalization

 Why and when do we want to use HE?

Dr. Chiranji Lal Chowdhary, VIT


Vellore

3
Histogram equalization

 Histogram equalization : is a method which


increases the dynamic range of the gray-levels in
a low-contrast image to cover full range of gray-
levels.

Dr. Chiranji Lal Chowdhary, VIT


Vellore

HE – Example 2

Dr. Chiranji Lal Chowdhary, VIT


Vellore

Histogram equalization

 Transformation function
s  T r   ò pr wdw
r
0 £ r £1
0

 pr(w) is the probability density function (pdf)


 The transformation function is the cumulative
distribution function (CDF)
– To make the pdf of the transformed image uniform,
i.e. to make the histogram of the transformed image
uniform

Dr. Chiranji Lal Chowdhary, VIT


Vellore

4
Histogram equalization

 How-to-Do: is achieved by having a


transformation function which is the
Cumulative Distribution Function (CDF) of
a given PDF of gray-levels in a given image.

Dr. Chiranji Lal Chowdhary, VIT


Vellore

HE – Discrete case

nj
  pr r j 
k k
sk  T rk  
j 0 n j 0

r hist(r) r s s hist(s)
0 10 0 10 10 10
1 70 1 80 80 70
2 15 2 95 95 15
3 5 3 100 100 5

Dr. Chiranji Lal Chowdhary, VIT


Vellore

Dr. Chiranji Lal Chowdhary, VIT


Vellore

5
HE - Discussion

 Can contrast stretching achieve similar result as


histogram equalization?
 If it can, why histogram equalization then?
 Why isn’t the transformed histogram uniform?
– Contrast stretching (also called Normalization) attempts to
improve an image by stretching the range of intensity values
it contains to make full use of possible values.
– Unlike histogram equalization, contrast stretching is
restricted to a linear mapping of input to output values. The
result is less dramatic, but tends to avoid the sometimes
artificial appearance of equalized images.
Dr. Chiranji Lal Chowdhary, VIT
Vellore

Dr. Chiranji Lal Chowdhary, VIT


Vellore

Histogram Equalization

Dr. Chiranji Lal Chowdhary, VIT


Vellore

6
Histogram Equalization

Dr. Chiranji Lal Chowdhary, VIT


Vellore

Histogram Equalization

Dr. Chiranji Lal Chowdhary, VIT


Vellore

Histogram Equalization

Dr. Chiranji Lal Chowdhary, VIT


Vellore

7
Example

Dr. Chiranji Lal Chowdhary, VIT


Vellore

Example

Dr. Chiranji Lal Chowdhary, VIT


Vellore

Histogram Equalization

Dr. Chiranji Lal Chowdhary, VIT


Vellore

8
Example:
Histogram Equalization

Dr. Chiranji Lal Chowdhary, VIT


Vellore

Example:
Histogram Equalization

Dr. Chiranji Lal Chowdhary, VIT


Vellore

Example:
Histogram Equalization

Dr. Chiranji Lal Chowdhary, VIT


Vellore

9
Dr. Chiranji Lal Chowdhary, VIT
Vellore

Dr. Chiranji Lal Chowdhary, VIT


Vellore

Dr. Chiranji Lal Chowdhary, VIT


Vellore

10
Dr. Chiranji Lal Chowdhary, VIT
Vellore

Dr. Chiranji Lal Chowdhary, VIT


Vellore

Question

Is histogram equalization always good?

No

Dr. Chiranji Lal Chowdhary, VIT


Vellore

11
Summary - Point processing

 Simple gray level transformations


– Image negatives
– Log transformations
– Power-law transformations
– Contrast stretching
– Gray-level slicing
– Bit-plane slicing
 Histogram processing
– Histogram equalization
• Derivation (572 only)
– Histogram matching (specification) (572 only)
 Arithmetic/logic operations
– Image averaging
• Generation of Gaussian noise (572 only)

Dr. Chiranji Lal Chowdhary, VIT


Vellore

12

You might also like