Lec 6
Lec 6
VISION
highpass(F) = F - H⊗F
⊗
Filters are linear operators
That means
H1 ⊗ F + H2 ⊗ F = (H1 + H2) ⊗ F
F-H⊗F = I⊗F-H⊗F
= (I - H) ⊗ F
Filtering demo
https://setosa.io/ev/image-kernels/
Image gradient
-1 1
H[u,v
]
Filtering demo
https://setosa.io/ev/image-kernels/
The Sobel operator
-1 0 1 1 2 1
⅛ -2 0 2 ⅛ 0 0 0
-1 0 1 -1 -2 -1
The standard definitions of these Sobel filters omit the ⅛ term
● ⅛ not needed for edge detection
● ⅛ is needed to correctly compute gradient values
Low pass filtering
What is the digital version of this filter?
?
Is the Gaussian really a low-pass filter?
If so why?
CMOS sensor
And can we do better?
Fourier Transform
Fourier transform
● Decomposes any signal or image into weighted sum of sines and cosines
Fourier Series
≈ +
≈ +
=
Fourier Series
≈ +
=
Fourier Series
≈ +
=
Fourier Series
≈ +
=
Fourier Series
f(x) |F(𝟂)|
signal Fourier transform of signal
Fourier transform as change of basis
* =
The math
http://sharp.bu.edu/~slehar/fourier/fourier.html#filtering
Fourier Transform of an image
f(x,y) |f(𝟂)|
2D Fourier Transform
Low pass filtering in the Fourier domain
h(𝟂) |f(𝟂)|
Low pass filtering in the Fourier domain
h(𝟂) |f(𝟂)|
FT-1 =
FT-1
﹡ FT-1
Applying the convolution theorem
FT-1 =
FT-1
﹡ FT-1
Applying the convolution theorem
FT-1 =
﹡
The “ideal” low pass filter
﹡ =
sinc[u,v] F[x,y] G[x,y]
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0 i h g
0 0 0 1 0 0 0 f e d
0 0 0 0 0 0 0 c b a
H[u,v
0 0 0 0 0 0 0
]
F[x,y G[x,y
0 0 0 0 0 0 0
] ]
This phenomenon with sinc known as “ringing”
Be careful what you wish for...
FT-1 =
﹡
Gaussian(𝛔
)
Gaussian(1/𝛔)
And that’s why filtering with a Gaussian works...
Lesson learned!
● Before you downsample an image, filter with a Gaussian (or similar filter)!
The case
of the
Soiled Van Gogh
SOLVED!
Epilogue
Lots of other types of filters: median