Professional Documents
Culture Documents
11/14/2022 1
Spatial Filtering
11/14/2022 2
Spatial Correlation
a b
w( x, y ) f ( x, y ) w( s, t ) f ( x s, y t )
s a t b
11/14/2022 3
Spatial Convolution
a b
w( x, y ) f ( x, y ) w(s, t ) f ( x s, y t )
s a t b
11/14/2022 4
11/14/2022 5
Smoothing Spatial Filters
11/14/2022 6
Spatial Smoothing Linear Filters
w(s, t ) f ( x s, y t )
g ( x, y ) s a t b
a b
w(s, t )
s a t b
where m 2a 1, n 2b 1.
11/14/2022 7
Two Smoothing Averaging Filter Masks
11/14/2022 8
11/14/2022 9
Example: Gross Representation of Objects
11/14/2022 10
Order-statistic (Nonlinear) Filters
— Nonlinear
11/14/2022 11
Example: Use of Median Filtering for Noise Reduction
11/14/2022 12
Sharpening Spatial Filters
► Foundation
► Laplacian Operator
11/14/2022 13
Sharpening Spatial Filters: Foundation
f
f ( x 1) f ( x)
x
2 f
2
f ( x 1) f ( x 1) 2 f ( x)
x
11/14/2022 14
11/14/2022 15
Sharpening Spatial Filters: Laplace Operator
11/14/2022 17
Sharpening Spatial Filters: Laplace Operator
g ( x, y ) f ( x, y ) c 2 f ( x, y )
where,
f ( x, y ) is input image,
g ( x, y ) is sharpenend images,
c -1 if 2 f ( x, y ) corresponding to Fig. 3.37(a) or (b)
and c 1 if either of the other two filters is used.
11/14/2022 18
11/14/2022 19
Image scaling (Ch2)
(OR) y= ((x-min)/(max-min))*255
11/14/2022 20
Unsharp Masking and Highboost Filtering
► Unsharp masking
Sharpen images consists of subtracting an unsharp (smoothed)
version of an image from the original image
e.g., printing and publishing industry
► Steps
1. Blur the original image
2. Subtract the blurred image from the original (creates a mask)
3. Add the mask to the original
11/14/2022 21
Unsharp Masking: Demo
11/14/2022 22
Unsharp Masking and Highboost Filtering
11/14/2022 23
Unsharp Masking and Highboost Filtering: Example
11/14/2022 24
Image Sharpening based on First-Order Derivatives
M ( x, y ) | g x | | g y |
z1 z2 z3
M ( x, y ) | z8 z5 | | z6 z5 |
z4 z5 z6
z7 z8 z9
11/14/2022 26
Image Sharpening based on First-Order Derivatives
Sobel Operators
M ( x, y ) | ( z7 2 z8 z9 ) ( z1 2 z2 z3 ) |
z1 z2 z3 | ( z3 2 z6 z9 ) ( z1 2 z4 z7 ) |
z4 z5 z6
z7 z8 z9
11/14/2022 27
Image Sharpening based on First-Order Derivatives
11/14/2022 28
Example
11/14/2022 29
Example:
Combining
Spatial
Enhancement
Methods
Goal:
Enhance the
image by
sharpening it
and by bringing
out more of the
skeletal detail
11/14/2022 30
Example:
Combining
Spatial
Enhancement
Methods
Goal:
Enhance the
image by
sharpening it
and by bringing
out more of the
skeletal detail
11/14/2022 31