Professional Documents
Culture Documents
Filtering
Filtering
Fourier analysis.
Many nice slides taken from Bill Freeman.
(Freeman)
(Freeman)
Correlation
Examples on white board 1D
Examples -2D
Boundaries
Zeros
Repeat values
Cycle
Produce shorter result
Examples
Correlation
F I ( x)
F (i) I ( x i)
i N
F I ( x, y )
F (i, j ) I ( x i, y j )
j N i N
Convolution
Like Correlation with Filter Reversed
Associative
1D
F I ( x)
F (i) I ( x i)
i N
2D F I ( x, y )
F (i, j ) I ( x i, y j )
j N i N
Some Examples
Additive noise
I = S + N. Noise doesnt depend on
signal.
Well consider:
I i si ni with E (ni ) 0
si deterministic.
ni , n j independent for ni n j
ni , n j identically distributed
Average Filter
Mask with positive
entries, that sum 1.
Replaces each pixel
with an average of
its neighborhood.
If all weights are
equal, it is called a
BOX filter.
(Camps)
F
1 1 1
1/9 1 1 1
1 1 1
Example: Smoothing by
Averaging
=
Nearby points tell more about the
signal than distant ones.
Gaussian Averaging
Rotationally
symmetric.
Weights nearby
pixels more than
distant ones.
This makes sense
as probabalistic
inference.
A Gaussian gives a
good model of a fuzzy
blob
An Isotropic Gaussian
The picture shows a
smoothing kernel
proportional to
x2 y2
G 0 ( x, y )
exp
2
2
2
1
(which is a reasonable
model of a circularly
symmetric fuzzy blob)
Theeffectsofsmoothing
Eachrowshowssmoothing
withgaussiansofdifferent
width;eachcolumnshows
differentrealizationsof
animageofgaussiannoise.
Efficient Implementation
Both, the BOX filter and the Gaussian
filter are separable:
First convolve each row with a 1D filter
Then convolve each column with a 1D
filter.
Box Filter
1
9
1
9
1
9
1
9
1
9
1
9
1
1
0
0
0
9
3
1
1
1
0
0
9
3 3
1
1
0
0
0
9
3
0
1
3
0
0
1
3
0
Gaussian Filter
2
1
1
x2 y2
y2
x
G0 ( x, y )
exp
exp
exp
2
2
2
2
=
Whats the best
neighborhood for
inference?
Subsampling
Matlab