10/11/2012 Image Enhancement 1
Image Enhancement
10/11/2012 Image Enhancement 2
Techniques
• Spatial domain
– Point operations
– Local neighborhood
– Global operation
• Frequency domain
– Low Pass
– High Pass
– Band Pass
10/11/2012 Image Enhancement 3
Point operations
• Brightening,Darkening
• Threshold
• Contrast stretch
• Logarithmic operation
• Negative
• Bit plane coding
10/11/2012 Image Enhancement 4
Darkening improves quality
Brightening improves quality
10/11/2012 Image Enhancement 5
Logarithmic Operation (Brightening)
10/11/2012 Image Enhancement 6
Exponential operation (Darkening)
10/11/2012 Image Enhancement 7
Mapped image
Original Image
Logarithm Map
10/11/2012 Image Enhancement 8
Brightness modification Contrast modification
Also called as
Gamma correction
10/11/2012 Image Enhancement 9
Contrast stretch using sigmoid
transfer function:
Quantizing - representing image
with fewer levels :
Thresholding - converting into
binary image :
10/11/2012 Image Enhancement 10
Original Image
Contrast Stretched :
Histogram Equalized :
Dark ones darker,
bright ones brighter.
All gray levels equally
distributed
10/11/2012 Image Enhancement 11
Original
Thresholding at 118
Thresholding at 128 Thresholding at 136
10/11/2012 Image Enhancement 12
0000 0001
0000 0010
0000 0100
0000 1000
00010000
0010 0000
0100 0000 1000 0000
Bitplane coding
Original image
Info contained in each bit plane:
10/11/2012 Image Enhancement 13
10/11/2012 Image Enhancement 14
Local operations
• Smoothing/Averaging filter
• Median Filter
• Sharpening filters
– Roberts
– Prewitt
– Laplacian
– Sobel
10/11/2012 Image Enhancement 15
3X3 (1/9) mask
mean filter
5X5 (1/25) mask mean
filter
Original Image
Mean filter smoothes the image, larger the mask size greater the effect:
10/11/2012 Image Enhancement 16
Laplacian Filter
Laplacian High Boost
Filter
Original Image
High pass and High boost filters :
10/11/2012 Image Enhancement 17
Gaussian low pass filter :
10/11/2012 Image Enhancement 18
Sobels operator :
10/11/2012 Image Enhancement 19
1 0
0 -1
0 1
-1 0
Original
¯
Output Image
Roberts Operator:
Very simple, sensitive to noise and responds only to sharp edges
10/11/2012 Image Enhancement 20
-1 0 1
-1 0 1
-1 0 1
-1 -1 -1
0 0 0
1 1 1
Original
¯
Output Image
Prewitts Operator :
10/11/2012 Image Enhancement 21
Laplacian operator :
10/11/2012 Image Enhancement 22
Global operations
• Histogram equalization
• Histogram specification
10/11/2012 Image Enhancement 23
Histogram Processing
• The histogram of a digital image with gray levels
from 0 to L-1 is a discrete function h(r
k
)=n
k
,
where:
– r
k
is the kth gray level
– n
k
is the # pixels in the image with that gray level
– n is the total number of pixels in the image
– k = 0, 1, 2, …, L-1
• Normalized histogram: p(r
k
)=n
k
/n
– sum of all components = 1
10/11/2012 Image Enhancement 24
Histogram Processing
• The shape of the histogram of an image
does provide useful info about the
possibility for contrast enhancement.
• Types of processing:
Histogram equalization
Histogram matching (specification)
Local enhancement
10/11/2012 Image Enhancement 25
Histograms of
images :
10/11/2012 Image Enhancement 26
Match the images show here with …
See next slide …
10/11/2012 Image Enhancement 27
… the histograms given below
10/11/2012 Image Enhancement 28
Histogram Equalization
• As mentioned above, for gray levels that
take on discrete values, we deal with
probabilities:
p
r
(r
k
)=n
k
/n, k=0,1,.., L-1
– The plot of p
r
(r
k
) versus r
k
is called a
histogram and the technique used for
obtaining a uniform histogram is known as
histogram equalization (or histogram
linearization).
10/11/2012 Image Enhancement 29
Histogram Equalization
• Histogram equalization(HE) results are similar to
contrast stretching but offer the advantage of full
automation, since HE automatically determines
a transformation function to produce a new
image with a uniform histogram.
) ( ) (
0 0
j
k
j
k
j
r
j
k k
r p
n
n
r T s
¯ ¯
= =
= = =
10/11/2012 Image Enhancement 30
Histogram Matching
(or Specification)
• Histogram equalization does not allow
interactive image enhancement and
generates only one result: an
approximation to a uniform histogram.
• Sometimes though, we need to be able to
specify particular histogram shapes
capable of highlighting certain gray-level
ranges.
10/11/2012 Image Enhancement 31
Histogram Specification
• The procedure for histogram-specification
based enhancement is:
– Equalize the levels of the original image
using:
¯
=
= =
k
j
j
k
n
n
r T s
0
) (
n: total number of pixels,
nj: number of pixels with gray level rj,
L: number of discrete gray levels
10/11/2012 Image Enhancement 32
Histogram Specification
– Specify the desired density function and
obtain the transformation function G(z):
¯ ¯
=
~ = =
z
i
i
z
z
n
n
w p z G v
0 0
) ( ) (
– Apply the inverse transformation function
z=G
-1
(s) to the levels obtained in step 1.
pz: specified desirable PDF for output
10/11/2012 Image Enhancement 33
Histogram Specification
• The new, processed version of the original
image consists of gray levels
characterized by the specified density
p
z
(z).
)] ( [ ) (
1 1
r T G z s G z
÷ ÷
= ÷ = In essence:
10/11/2012 Image Enhancement 34
Histogram Specification
• The principal difficulty in applying the
histogram specification method to image
enhancement lies in being able to
construct a meaningful histogram. So…
10/11/2012 Image Enhancement 35
Histogram Specification
– Either a particular probability density function
(such as a Gaussian density) is specified and
then a histogram is formed by digitizing the
given function,
– Or a histogram shape is specified on a
graphic device and then is fed into the
processor executing the histogram
specification algorithm.
10/11/2012 Image Enhancement 36
Image Enhancement in the
Spatial Domain
10/11/2012 Image Enhancement 37
Chapter 3
Image Enhancement in the
Spatial Domain
10/11/2012 Image Enhancement 38
10/11/2012 Image Enhancement 39
Original image Its histogram
Equalized
histogram
Histogram
equalized
image
Histogram Equalization
10/11/2012 Image Enhancement 40
Histogram equalization :
With different input qualities, output quality same
10/11/2012 Image Enhancement 41
Specified Histogram
Actual histogram
Histogram Specification :
Actual Histogram
Specified Image
10/11/2012 Image Enhancement 42
original image
Histogram original
histogram
equalized
image
histogram of the equalized image
10/11/2012 Image Enhancement 43
10/11/2012 Image Enhancement 44
10/11/2012 Image Enhancement 45
Different colors used to improve image appearance:
10/11/2012 Image Enhancement 46
Homomorphic Filtering
• Simultaneous dynamic range compression
and contrast enhancement
10/11/2012 Image Enhancement 47
An image formation model
• We can view an image f(x,y) as a product
of two components:
• i(x,y): illumination. It is determined by the
illumination source.
• r(x,y): reflectance (or transmissivity). It is
determined by the characteristics of
imaged objects.
( ) ( ) ( )
1 ) , ( 0
) , ( 0
, , ,
< <
· < <
· =
y x r
y x i
y x r y x i y x f
10/11/2012 Image Enhancement 48
Homomorphic Filtering…
• In some images, quality of image is
reduced because of non-uniform
illumination.
• Homomorphic filtering can be used
to perform illumination correction.
• The above equation cannot be used
directly in order to operate separately
on the frequency components of
illumination and reflectance.
10/11/2012 Image Enhancement 49
Homomorphic Filtering…
• By separating the illumination and reflectance
components, homomorphic filter can then
operate on them separately.
• Illumination component of an image generally
has slow variations, while the reflectance
component vary abruptly.
• By removing the low frequencies (highpass
filtering) the effects of illumination can be
removed .
10/11/2012 Image Enhancement 50
( ) ( ) ( ) v u F v u F v u Z
r i
, , , + =
( ) ( ) ( ) ( ) x,y r x,y i x,y f x,y z ln ln ln + = =
) , ( ) , ( ) , (
) , ( ) , ( ) , (
0 0
) , (
' '
y x r y x i e y x g
y x r y x i y x s
y x s
= =
+ =
Homomorphic Filtering
( ) v u Z v u H v u S , ) , ( ) , ( =
ln :
DFT :
H(u,v) :
(DFT)
-1
:
exp :
( ) ( ) ( ) y x r y x i y x f , , , · =
10/11/2012 Image Enhancement 51
doc_507572022.ppt
Image Enhancement
10/11/2012 Image Enhancement 2
Techniques
• Spatial domain
– Point operations
– Local neighborhood
– Global operation
• Frequency domain
– Low Pass
– High Pass
– Band Pass
10/11/2012 Image Enhancement 3
Point operations
• Brightening,Darkening
• Threshold
• Contrast stretch
• Logarithmic operation
• Negative
• Bit plane coding
10/11/2012 Image Enhancement 4
Darkening improves quality
Brightening improves quality
10/11/2012 Image Enhancement 5
Logarithmic Operation (Brightening)
10/11/2012 Image Enhancement 6
Exponential operation (Darkening)
10/11/2012 Image Enhancement 7
Mapped image
Original Image
Logarithm Map
10/11/2012 Image Enhancement 8
Brightness modification Contrast modification
Also called as
Gamma correction
10/11/2012 Image Enhancement 9
Contrast stretch using sigmoid
transfer function:
Quantizing - representing image
with fewer levels :
Thresholding - converting into
binary image :
10/11/2012 Image Enhancement 10
Original Image
Contrast Stretched :
Histogram Equalized :
Dark ones darker,
bright ones brighter.
All gray levels equally
distributed
10/11/2012 Image Enhancement 11
Original
Thresholding at 118
Thresholding at 128 Thresholding at 136
10/11/2012 Image Enhancement 12
0000 0001
0000 0010
0000 0100
0000 1000
00010000
0010 0000
0100 0000 1000 0000
Bitplane coding
Original image
Info contained in each bit plane:
10/11/2012 Image Enhancement 13
10/11/2012 Image Enhancement 14
Local operations
• Smoothing/Averaging filter
• Median Filter
• Sharpening filters
– Roberts
– Prewitt
– Laplacian
– Sobel
10/11/2012 Image Enhancement 15
3X3 (1/9) mask
mean filter
5X5 (1/25) mask mean
filter
Original Image
Mean filter smoothes the image, larger the mask size greater the effect:
10/11/2012 Image Enhancement 16
Laplacian Filter
Laplacian High Boost
Filter
Original Image
High pass and High boost filters :
10/11/2012 Image Enhancement 17
Gaussian low pass filter :
10/11/2012 Image Enhancement 18
Sobels operator :
10/11/2012 Image Enhancement 19
1 0
0 -1
0 1
-1 0
Original
¯
Output Image
Roberts Operator:
Very simple, sensitive to noise and responds only to sharp edges
10/11/2012 Image Enhancement 20
-1 0 1
-1 0 1
-1 0 1
-1 -1 -1
0 0 0
1 1 1
Original
¯
Output Image
Prewitts Operator :
10/11/2012 Image Enhancement 21
Laplacian operator :
10/11/2012 Image Enhancement 22
Global operations
• Histogram equalization
• Histogram specification
10/11/2012 Image Enhancement 23
Histogram Processing
• The histogram of a digital image with gray levels
from 0 to L-1 is a discrete function h(r
k
)=n
k
,
where:
– r
k
is the kth gray level
– n
k
is the # pixels in the image with that gray level
– n is the total number of pixels in the image
– k = 0, 1, 2, …, L-1
• Normalized histogram: p(r
k
)=n
k
/n
– sum of all components = 1
10/11/2012 Image Enhancement 24
Histogram Processing
• The shape of the histogram of an image
does provide useful info about the
possibility for contrast enhancement.
• Types of processing:
Histogram equalization
Histogram matching (specification)
Local enhancement
10/11/2012 Image Enhancement 25
Histograms of
images :
10/11/2012 Image Enhancement 26
Match the images show here with …
See next slide …
10/11/2012 Image Enhancement 27
… the histograms given below
10/11/2012 Image Enhancement 28
Histogram Equalization
• As mentioned above, for gray levels that
take on discrete values, we deal with
probabilities:
p
r
(r
k
)=n
k
/n, k=0,1,.., L-1
– The plot of p
r
(r
k
) versus r
k
is called a
histogram and the technique used for
obtaining a uniform histogram is known as
histogram equalization (or histogram
linearization).
10/11/2012 Image Enhancement 29
Histogram Equalization
• Histogram equalization(HE) results are similar to
contrast stretching but offer the advantage of full
automation, since HE automatically determines
a transformation function to produce a new
image with a uniform histogram.
) ( ) (
0 0
j
k
j
k
j
r
j
k k
r p
n
n
r T s
¯ ¯
= =
= = =
10/11/2012 Image Enhancement 30
Histogram Matching
(or Specification)
• Histogram equalization does not allow
interactive image enhancement and
generates only one result: an
approximation to a uniform histogram.
• Sometimes though, we need to be able to
specify particular histogram shapes
capable of highlighting certain gray-level
ranges.
10/11/2012 Image Enhancement 31
Histogram Specification
• The procedure for histogram-specification
based enhancement is:
– Equalize the levels of the original image
using:
¯
=
= =
k
j
j
k
n
n
r T s
0
) (
n: total number of pixels,
nj: number of pixels with gray level rj,
L: number of discrete gray levels
10/11/2012 Image Enhancement 32
Histogram Specification
– Specify the desired density function and
obtain the transformation function G(z):
¯ ¯
=
~ = =
z
i
i
z
z
n
n
w p z G v
0 0
) ( ) (
– Apply the inverse transformation function
z=G
-1
(s) to the levels obtained in step 1.
pz: specified desirable PDF for output
10/11/2012 Image Enhancement 33
Histogram Specification
• The new, processed version of the original
image consists of gray levels
characterized by the specified density
p
z
(z).
)] ( [ ) (
1 1
r T G z s G z
÷ ÷
= ÷ = In essence:
10/11/2012 Image Enhancement 34
Histogram Specification
• The principal difficulty in applying the
histogram specification method to image
enhancement lies in being able to
construct a meaningful histogram. So…
10/11/2012 Image Enhancement 35
Histogram Specification
– Either a particular probability density function
(such as a Gaussian density) is specified and
then a histogram is formed by digitizing the
given function,
– Or a histogram shape is specified on a
graphic device and then is fed into the
processor executing the histogram
specification algorithm.
10/11/2012 Image Enhancement 36
Image Enhancement in the
Spatial Domain
10/11/2012 Image Enhancement 37
Chapter 3
Image Enhancement in the
Spatial Domain
10/11/2012 Image Enhancement 38
10/11/2012 Image Enhancement 39
Original image Its histogram
Equalized
histogram
Histogram
equalized
image
Histogram Equalization
10/11/2012 Image Enhancement 40
Histogram equalization :
With different input qualities, output quality same
10/11/2012 Image Enhancement 41
Specified Histogram
Actual histogram
Histogram Specification :
Actual Histogram
Specified Image
10/11/2012 Image Enhancement 42
original image
Histogram original
histogram
equalized
image
histogram of the equalized image
10/11/2012 Image Enhancement 43
10/11/2012 Image Enhancement 44
10/11/2012 Image Enhancement 45
Different colors used to improve image appearance:
10/11/2012 Image Enhancement 46
Homomorphic Filtering
• Simultaneous dynamic range compression
and contrast enhancement
10/11/2012 Image Enhancement 47
An image formation model
• We can view an image f(x,y) as a product
of two components:
• i(x,y): illumination. It is determined by the
illumination source.
• r(x,y): reflectance (or transmissivity). It is
determined by the characteristics of
imaged objects.
( ) ( ) ( )
1 ) , ( 0
) , ( 0
, , ,
< <
· < <
· =
y x r
y x i
y x r y x i y x f
10/11/2012 Image Enhancement 48
Homomorphic Filtering…
• In some images, quality of image is
reduced because of non-uniform
illumination.
• Homomorphic filtering can be used
to perform illumination correction.
• The above equation cannot be used
directly in order to operate separately
on the frequency components of
illumination and reflectance.
10/11/2012 Image Enhancement 49
Homomorphic Filtering…
• By separating the illumination and reflectance
components, homomorphic filter can then
operate on them separately.
• Illumination component of an image generally
has slow variations, while the reflectance
component vary abruptly.
• By removing the low frequencies (highpass
filtering) the effects of illumination can be
removed .
10/11/2012 Image Enhancement 50
( ) ( ) ( ) v u F v u F v u Z
r i
, , , + =
( ) ( ) ( ) ( ) x,y r x,y i x,y f x,y z ln ln ln + = =
) , ( ) , ( ) , (
) , ( ) , ( ) , (
0 0
) , (
' '
y x r y x i e y x g
y x r y x i y x s
y x s
= =
+ =
Homomorphic Filtering
( ) v u Z v u H v u S , ) , ( ) , ( =
ln :
DFT :
H(u,v) :
(DFT)
-1
:
exp :
( ) ( ) ( ) y x r y x i y x f , , , · =
10/11/2012 Image Enhancement 51
doc_507572022.ppt