ImageProcessing5 SpatialFiltering1
ImageProcessing5 SpatialFiltering1
of
19
Interesting article in
the March, 2006
issue of Wired
magazine
Read it here
Image Enhancement
(Spatial Filtering 1)
3
of
19
Contents
In this lecture we will look at spatial filtering
techniques:
Neighbourhood operations
What is spatial filtering?
Smoothing operations
What happens at the edges?
Correlation and convolution
4
of
19
Neighbourhood Operations
Neighbourhood operations simply operate
on a larger neighbourhood of pixels than
point operations
Origin
Neighbourhoods are
mostly a rectangle
around a central pixel
Neighbourhood
Any size rectangle
and any shape filter
are possible
y
Image f (x, y)
(x, y)
5
of
19
6
of
19
Original Image
123 127 128
Enhanced Image
x
119
115 130
7
of
19
Origin
Simple 3*3
Neighbourhood
3*3 Filter
Image f (x, y)
Original Image
Pixels
Filter
eprocessed = v*e +
r*a + s*b + t*c +
u*d + w*f +
x*g + y*h + z*i
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
8
of
19
w(s, t ) f ( x s, y t )
s at b
9
of
19
10
of
19
Origin
Simple 3*3
Neighbourhood
1
1
1
/9 100
/9 108
/9
104
1
/9 106
/9 198
/9
99
/9 190
/9 185
/9
95
90
85
Original Image
3*3 Smoothing
Pixels
/9
/9
/9
/9
/9
/9
/9
/9
/9
Filter
Filter
Image f (x, y)
e = 1/9*106 +
1
/9*104 + 1/9*100 + 1/9*108 +
1
/9*99 + 1/9*98 +
1
/9*95 + 1/9*90 + 1/9*85
= 98.3333
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
11
of
19
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
12
of
19
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
13
of
19
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
14
of
19
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
15
of
19
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
16
of
19
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
17
of
19
18
of
19
/16
/16
/16
/16
/16
/16
/16
/16
/16
Weighted
averaging filter
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
19
of
19
Original Image
Smoothed Image
Thresholded Image
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
20
of
19
Original Image
With Noise
Image After
Averaging Filter
Image After
Median Filter
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
21
of
19
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
22
of
19
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
23
of
19
24
of
19
119
115 130
25
of
19
e
e
Image f (x, y)
26
of
19
27
of
19
119
115 130
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
28
of
19
Original
Image
Filtered Image:
Replicate Edge Pixels
Filtered Image:
Wrap Around Edge Pixels
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
29
of
19
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
30
of
19
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
31
of
19
32
of
19
Original Image
Pixels
Filter
eprocessed = v*e +
z*a + y*b + x*c +
w*d + u*e +
t*f + s*g + r*h
33
of
19
Summary
In this lecture we have looked at the idea of
spatial filtering and in particular:
Neighbourhood operations
The filtering process
Smoothing filters
Dealing with problems at image edges when
using filtering
Correlation and convolution