Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
linear Filtering
convolution
differential filters
filter types
boundary conditions.
Review: questions
1. Write down a 3x3 filter that returns a positive
value if the average value of the 4-adjacent
neighbors is less than the center and a
negative value otherwise
Slide: Hoiem
Review: questions
Filtering Operator
a) _ = D * B
3. Fill in the blanks: A
b) A = _ * _
c) F = D * _
d) _ = D * D
B
E
G
F C
H I D
Slide: Hoiem
The Frequency Domain (Szeliski 3.4)
F ( ) R( ) iI ( )
1 I ( )
A R( ) I ( )
2 2
tan
R( )
We can always go back:
= +
Frequency Spectra
example : g(t) = sin(2pf t) + (1/3)sin(2p(3f) t)
= +
Frequency Spectra
Usually, frequency is more interesting than the phase
Frequency Spectra
= +
=
Frequency Spectra
= +
=
Frequency Spectra
= +
=
Frequency Spectra
= +
=
Frequency Spectra
= +
=
Frequency Spectra
1
= A sin(2 kt )
k 1 k
Frequency Spectra
Extension to 2D
f(x,y) |F(sx,sy)|
h(x,y) |H(sx,sy)|
g(x,y) |G(sx,sy)|
Filtering in frequency domain
FFT
FFT
Inverse FFT
=
Slide: Hoiem
FFT in Matlab
• Filtering with fft
im = double(imread(‘…'))/255;
im = rgb2gray(im); % “im” should be a gray-scale floating point image
[imh, imw] = size(im);
Slide: Hoiem
Fourier Transform pairs
Low-pass, Band-pass, High-pass filters
low-pass:
High-pass / band-pass:
Edges in images
What does blurring take away?
original
What does blurring take away?
smoothed – original
Image gradient
The gradient of an image:
Laplacian of Gaussian
R G B
Lossy Image Compression (JPEG)
89k 12k
Things to Remember
Sometimes it makes sense to think of
images and filtering in the frequency
domain
• Fourier analysis