Professional Documents
Culture Documents
Spatial Filtering
sinisa@eecs.oregonstate.edu
1
Outline
MATLAB
2
MATLAB
3
MATLAB
3
MATLAB
3
MATLAB
3
MATLAB
3
MATLAB
3
MATLAB
3
Linear Spatial Filtering
a b
g(x, y) = w(i, j)f (x + i, y + j)
i= a j= b
4
Linear Spatial Filtering
5
Correlation vs. Convolution
Correlation:
1. Move the filter mask to a location
3. Go to 1. a b
w(x, y) f (x, y) = w(i, j)f (x + i, y + j)
i= a j= b
Convolution:
1. Rotate the filter mask by 180 degrees
2. Correlation
a b
w(x, y) f (x, y) = w(i, j)f (x i, y j)
i= a j= b
6
Example: Correlation vs. Convolution
7
Example: Correlation vs. Convolution
8
Example: Correlation vs. Convolution
9
Example: Correlation vs. Convolution
10
Gaussian Filter
x +y 2 2
N (x, y) = exp( )
2 2
3x3 filter:
11
Smoothing Filter -- Low Pass Filter
12
Example: Smoothing Filter
13
Application of Smoothing
14
Application of Smoothing
15