Академический Документы
Профессиональный Документы
Культура Документы
of
42
S.SHAIK MAJEETH
Associate Professor/ECE
Saveetha Engineering College, Chennai
09-05-2013 Thursday
2
of
42
Introduction
Origin
y
Image “After snow storm” f(x,y)
– Fingerprint recognition
– Enhancement of CCTV
images
15
of
42
Key Stages in Digital Image Processing
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Object
Acquisition Recognition
Representation
Problem Domain
& Description
Colour Image Image
Processing Compression
16
of
Key Stages in Digital Image Processing:
42 Image Aquisition
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Object
Acquisition Recognition
Representation
Problem Domain
& Description
Colour Image Image
Processing Compression
17
of
Key Stages in Digital Image Processing:
42 Image Enhancement
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Object
Acquisition Recognition
Representation
Problem Domain
& Description
Colour Image Image
Processing Compression
18
of
Key Stages in Digital Image Processing:
42 Image Restoration
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Object
Acquisition Recognition
Representation
Problem Domain
& Description
Colour Image Image
Processing Compression
19
of
Key Stages in Digital Image Processing:
42 Morphological Processing
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Object
Acquisition Recognition
Representation
Problem Domain
& Description
Colour Image Image
Processing Compression
20
of
Key Stages in Digital Image Processing:
42 Segmentation
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Object
Acquisition Recognition
Representation
Problem Domain
& Description
Colour Image Image
Processing Compression
21
of
Key Stages in Digital Image Processing:
42 Object Recognition
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Object
Acquisition Recognition
Representation
Problem Domain
& Description
Colour Image Image
Processing Compression
22
of
Key Stages in Digital Image Processing:
42 Representation & Description
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Object
Acquisition Recognition
Representation
Problem Domain
& Description
Colour Image Image
Processing Compression
23
of
Key Stages in Digital Image Processing:
42 Image Compression
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Object
Acquisition Recognition
Representation
Problem Domain
& Description
Colour Image Image
Processing Compression
24
of
Key Stages in Digital Image Processing:
42 Colour Image Processing
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Object
Acquisition Recognition
Representation
Problem Domain
& Description
Colour Image Image
Processing Compression
25
of
42
Image displayed with various gray levels
26
of
42
Contents
In this lecture we will look at image
enhancement point processing techniques:
– What is point processing?
– Negative images
– Thresholding
– Logarithmic transformation
– Power law transforms
– Grey level slicing
27
of
42
Image Enhancement
Aim: Improving the interpretation of information
from the image
Methodology
Point Processing
Mask Processing
28
of
Basic Spatial Domain Image
42 Enhancement
Most spatial domain enhancement operations can be reduced to the
form
g (x, y) = T[ f (x, y)] Origin x
f (x, y) is the
input image,
s = intensitymax - r
31
of
42
Linear
• Negative/Identity
– Logarithmic
• Log/Inverse log
– Power law
• nth power/nth root
36
of
42
Logarithmic Transformations
The general form of the log transformation is
s = c * log(1 + r)
The log transformation maps a narrow range of
low input grey level values into a wider range of
output values
s = log(1 + r)
38
of
42
Logarithmic Transformations (cont…)
s = log(1 + r)
We usually set c to 1
Grey levels must be in the range [0.0, 1.0]
39
of
42
Power Law Transformations
Power law transformations have the following form
s=c*rγ
s=rγ
Usually c = 1
Grey levels must be in the range [0.0, 1.0]
41
of
42
Power Law Example
42
of
42
Power Law Example (cont…)
γ = 0.6
1
Transformed Intensities
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 0.2 0.4 0.6 0.8 1
Old Intensities
43
of
42
Power Law Example (cont…)
γ = 0.4
1
0.9
Transformed Intensities
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 0.2 0.4 0.6 0.8 1
Original Intensities
44
of
42
Power Law Example (cont…)
γ = 0.3
1
0.9
Transformed Intensities
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 0.2 0.4 0.6 0.8 1
Original Intensities
45
of
42
Power Law Example (cont…)
The images to the
right show a Magnetic
s = r 0.6
Resonance (MR) image
of a fractured human
spine
s = r 0.4
Different curves
highlight different
detail
46
of
42
Power Law Example
47
of
42
Power Law Example (cont…)
γ = 5.0
1
0.9
Transformed Intensities
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 0.2 0.4 0.6 0.8 1
Original Intensities
48
of
42
Power Law Transformations (cont…)
An aerial photo
of a runway is
shown
s = r 3.0
Power law
transforms are
s = r 4.0
used to darken
the image
Different curves
highlight
different detail
49
of
42
Gamma Correction
Gamma correction of computer monitors
Problem is that
display devices do
not respond linearly
to different intensities
Can be corrected
using a log transform
50
of
42
More Contrast Issues
51
of
Piecewise Linear Transformation
42 Functions
Rather than using a well defined mathematical
function use arbitrary user-defined transforms
SPATIAL FILTERING
56
of
Spatial Filtering Methods
42 (or Mask Processing Methods)
output image
57
of
42
Mechanics of spatial filtering
• The process consists simply of moving the
filter mask from point to point in an image.
a b
g ( x, y ) = w(s, t ) f ( x + s, y + t )
s = − at = − b
60
of
42
Simplified expression mn
R = w1 z1 + w2 z2 + ... + wmn zmn = wi zi w1 w2 w3
i =1
9 w4 w5 w6
R = w1 z1 + w2 z2 + ... + w9 z9 = wi zi w7 w8 w9
i =1
Where the w’s are mask coefficients, the z’s are the value of the image gray levels
corresponding to those coefficients
61
of
42
Linear spatial filtering
The result is the sum of
Pixels of image
products of the mask
coefficients with the
w(-1,-1) w(-1,0) w(-1,1)
corresponding pixels
f(x-1,y-1) f(x-1,y) f(x-1,y+1)
w(0,-1) w(0,0) w(0,1)
directly under the mask
f(x,y-1) f(x,y) f(x,y+1) w(-1,-1) w(-1,0) w(-1,1)
w(1,-1) w(1,0) w(1,1) Mask
w(0,-1) w(0,0) w(0,1)
f(x+1,y-1) f(x+1,y) f(x+1,y+1) coefficient
w(1,-1) w(1,0) w(1,1) s
7 9 11
Input Image after 0 padding
10 50 8
0 0 0 0 0
9 6 8
0 7 9 11 0
0 10 50 8 0
3 By 3 Average Filter
0 9 6 8 0
1 1 1
0 0 0 0 0
1/9 1 1 1
1 1 1
63
of
42
Convolution
1/9 1/9 1/9
0 0 0 0 0
0 9 6 8 0
0 0 0 0 0
0 9 6 8 0
0 0 0 0 0
65
of
42
Convolution
1/9 1/9 1/9
0 0 0 0 0
0 9 6 8 0
0 0 0 0 0
66
of
42
Convolution
1/9 1/9 1/9
0 0 0 0 0
0 9 6 8 0
0 0 0 0 0
67
of
42
Convolution
0 0 0 0 0
1/9 1/9 1/9
0 8.4 10.7 8.8 0
1/9 1/9 1/9
0 10.3 50 8 0
1/9 1/9 1/9
0 9 6 8 0
0 0 0 0 0
68
of
42
Convolution
0 0 0 0 0
1/9 1/9 1/9
0 8.4 10.7 8.8 0
1/9 1/9 1/9
0 10.3 12.9 8 0
1/9 1/9 1/9
0 9 6 8 0
0 0 0 0 0
69
of
42
Convolution
0 0 0 0 0
1/9 1/9 1/9
0 8.4 10.7 8.8 0
1/9 1/9 1/9
0 10.3 12.9 5.7 0
1/9 1/9 1/9
0 9 6 8 0
0 0 0 0 0
70
of
42
Convolution
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
Original Image
Result of Mean Filter
7 9 11
8.4 10.7 8.8
10 50 8
10.3 12.8 5.7
9 6 8
4.1 4.6 3.2
74
of
42
Nonlinear spatial filtering
• Nonlinear spatial filters also operate on
neighborhoods, and the mechanics of sliding a
mask past an image are the same as was just
outlined.
• Blur edges
1 1 1 1 2 1
1 1
1 1 1 2 4 2
9 16
1 1 1 1 2 1
1 1 1 1 1
1 1 1 1 1
( 1/25)
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
81
of
42
Smoothing Linear Filters
• The general implementation for filtering an
MxN image with a weighted averaging filter of
size mxn is given by the expression
a b
w(s, t ) f ( x + s, y + t )
g ( x, y ) = s = − at = − b
a b
w(s, t )
s = − at = − b
82
of
42 Examples
15x15 25x25
83
of
42
Result of Smoothing Linear Filters
Original Image
• Corp region of
neighborhood
10 15 20
• Sort the values of
20 100 20 the pixel in our
region
20 20 25
• In the MxN mask
the median is MxN
10, 15, 20, 20, 20, 20, 20, 25, 100 div 2 +1
5th
85
of Smoothing Filters: Median Filtering
42
(non-linear)
median
averaging filtering
86
of
42
Sharpening Spatial Filters
• Objective of sharpening is to highlight fine
detail in an image (or)
1 -4 1
1
92
of
42
Image Segmentation
Edge Detection
Laplacian of Gaussina
93
of
42
To approximate Gradient at Z5
I = z − z
Mask : -1 1
x 6 5 1
I = z − z -1
x 5 8
I = ( z6 − z5 )2 + ( z5 − z8 )2
99
of
42
First Derivative
• Gradient equation:
• Gradient direction:
f
= f ( x + 1) − f ( x)
x
103
of
42
Definition for a first derivative
• Must be zero in flat segments
2 f
= f ( x + 1) + f ( x − 1) − 2 f ( x).
x 2
105
of
42
Definition for a second derivative
• Must be zero in flat areas;
000123200226332233000000776553
7
6
5
4
3
2
1
0
107
of
42
Derivative of image profile
0 0 0 1 2 3 2 0 0 2 2 6 3 3 2 2 3 3 0 0 0 0 0 0 7 7 6 5 5 3
second 0-1 0 0-2-1 2 2-2 4-7 3-1 1 1-1-3 3 0 0 0 0-7 7-1 0 1-2
108
of
42
109
of
42
Observation
• The 1st-order derivative is nonzero along the
entire ramp,
• while the 2nd-order derivative is nonzero only
at the onset and end of the ramp.
• As edges in an image resembles this type of
transition
• If the maximum gray level of the line had been same as the
isolated point , the response of the second order derivative is
stronger.
• If the gray level of the thin line had been the same as the step,
the response of the second derivative is stronger for the line
than for the step
112
of
42
Conclusion
• I order derivative produces thicker edge and
mainly used to extract edges.
1 0 0 1
h1 = h2 =
0 − 1 − 1 0
-1 0 1 -1 -2 -1
-2 0 2 0 0 0
-1 0 1 1 2 1
115
of
42 The Sobel Edge Detector
-1 -2 -1 -1 0 1
0 0 0 -2 0 2
1 2 1 -1 0 1
Partial Derivatives
-1 0 1 -1 -1 -1
-1 0 1 0 0 0
-1 0 1 -1 -1 -1
117
of
42 The Prewitt Edge Detector
-1 -1 -1 -1 0 1
0 0 0 -1 0 1
1 1 1 -1 0 1
0 0 0 0 0 0
0 -1 0 0 0 -1
0 0 1 0 1 0
Gx z9 − z5 Gy z8 − z6
f
= f (i, j ) − f (i + 1, j + 1)
x
f
= f (i + 1, j ) − f (i, j + 1)
x
Mask
1 0
Mx =
0 − 1
0 − 1
My =
1 0
120
of
42
Edge Models
121
of
42
Original Gradient
Laplacian Canny
122
of
42
123
of
42
The Laplacian (2nd order derivative)
2
f 2
f
f = 2 + 2
2
x y
124
of
42
Second Order Derivative Methods
• Defined as
• Mask
0 1 0
1 -4 1
0 1 0
•
• Very susceptible to noise, filtering required, use
Laplacian of Gaussian
127
of
42
Discrete form of derivative
f(x,y-1)
f(x,y) 2 f
= f ( x, y + 1) + f ( x, y − 1) − 2 f ( x, y )
y 2
f(x,y+1)
128
of
42
2-Dimentional Laplacian
1 -4 1
1
129
of
42
Laplacian
0 1 0 1 1 1
1 -4 1 1 -8 1
0 1 0 1 1 1
1 0 1
0 -4 0
1 0 1
130
of
42
Laplacian
0 -1 0 -1 -1 -1
-1 4 -1 -1 8 -1
0 -1 0 -1 -1 -1
-1 0 -1
0 4 0
-1 0 -1
131
of
42
• Steps
– Smooth the image using Gaussian filter
– Enhance the edges using Laplacian operator
– Zero crossings denote the edge location
– Use linear interpolation to determine the sub-pixel location
of the edge
134
of
42
Laplacian of Gaussian – contd.
• Defined as