SUBJECT:
PERCEPTION AND
LINEAR COMPUTER VISION
FILTERS
CO-
1
LINEAR FILTERS – INTRODUCTION TO DISCRETE TIME SIGNALS
LINEAR FILTERS – IMPULSE RESPONSE
Impulse response of a continuous system
Impulse response of a discrete system
Impulse function
1DIMENSIONAL
CONVOLUTION
BRIEF LOOK
Convolution of two signals f and g
LINEAR FILTERS-TIME DOMAIN VS FREQ DOMAIN
IMPULSE, STEP
AND
FREQUENCY
RESPONSE OF A
LINEAR FILTER
Every linear filter has an impulse response, a step response
and a frequency response
TWO-DIMENSIONAL
FOURIER TRANSFORM
EDGE EFFECTS IN DISCRETE CONVOLUTIONS
Fourier transform is a type of integral transform
The process takes a complex valued function of x, y and returns
a complex valued function of u, v (images are complex valued functions
with zero imaginary component)
EDGE EFFECTS IN DISCRETE
CONVOLUTIONS
These terms are sinusoids on the x, y plane, whose
orientation and frequency are given by u, v
tan θ = v/u
The gradient of this term is perpendicular to lines
where ux+vy is constant, and the frequency of the
sinusoid is 𝑢𝑢2 + 𝑣𝑣2
These sinusoids are often referred to as spatial frequency
components
EDGE EFFECTS IN DISCRETE
CONVOLUTIONS
Inverse Fourier transform , IDFT for discrete
It is useful to be able to recover a signal from its Fourier transform
EDGE EFFECTS IN DISCRETE CONVOLUTIONS
Inverse Fourier transform , IDFT for discrete
It is useful to be able to recover a signal from its Fourier transform
LINEAR FILTERS -1D
& 2D CONVOLUTION
LINEAR FILTERS – INTRODUCTION TO 1D CONVOLUTION
Continuous time convolution
Discrete time convolution
LINEAR FILTERS – INTRODUCTION TO 1D CONVOLUTION
LINEAR FILTERS – INTRODUCTION TO 1D CONVOLUTION
LINEAR FILTERS – INTRODUCTION TO 1D
CONVOLUTION
LINEAR FILTERS – INTRODUCTION TO 1D
CONVOLUTION
LINEAR FILTERS – INTRODUCTION TO 1D
CONVOLUTION
LINEAR FILTERS – INTRODUCTION TO 1D
CONVOLUTION
LINEAR FILTERS – INTRODUCTION TO 1D
CONVOLUTION
LINEAR FILTERS – INTRODUCTION TO 1D
CONVOLUTION
Cross check with the
analytical method
LINEAR FILTERS – INTRODUCTION TO 1D CONVOLUTION
Cross check with the analytical method
LINEAR FILTERS – INTRODUCTION TO 1D CONVOLUTION
Cross check with the analytical method
LINEAR FILTERS - CONVOLUTION
Convolution between two given signals, 𝒇 𝒔
and 𝒉𝒉 𝒔 is given by the following integral,
where
𝒚 denotes the convolution output:
∞
𝒚 = 𝒇𝒇 ∗ 𝒉
𝒉𝒙 � 𝒇 𝒔 . 𝒉𝒉 𝒙 𝒅
= − 𝒔 𝒅𝒔
𝒔
−
∞
= �
∞
𝒉𝒉 𝒔 . 𝒇 𝒙 𝒅
− 𝒔 𝒅𝒔
𝒔
CONVOLUTION –
A CLOSER LOOK
LINEAR FILTERS - CONVOLUTION
Convolution of a discrete- time input signal x[k]
and impulse response h[n- k]. (commutative)
LINEAR FILTERS – FILTER KERNELS
The pattern of weights used
for a linear filter is usually
referred to as the kernel of
the filter
LINEAR FILTERS – 2D CONVOLUTION
Convolution between a kernel (typically a 3x3 or 5x5 matrix)
and an image
Kernel of the
2D filter
Image
DIFFERENT FILTER KERNELS FOR 2D
CONVOLUTION
Sobel Kernel
Gaussian Kernel
Box-blur Kernel
LINEAR FILTERS –
TYPES
LINEAR
FILTERS
– TYPES
LINEAR
FILTERS
– TYPES
LINEAR
FILTERS
– TYPES
LINEAR FILTERS
– TYPES
SMOOTHING BY
AVERAGING
SMOOTHING BY
AVERAGING
Reduce the effects of noise by replacing each pixel with a
weighted average of its neighbours, a process often referred to as
blurrin
smoothing or
g
Original Image Smoothed Image
SMOOTHING BY
AVERAGING
SMOOTHING BY
AVERAGING
Although a uniform local average may
seem to give a good blurring model, it
generates effects that are not usually
seen in defocussing a lens. The images
above compare the effects of a uniform
local average with weighted average
The degree of blurring in each case is
about the same, but the uniform average
produces a set of narrow vertical and
horizontal bars — an effect often known
as ringing
The bottom row shows the weights used to
blur the image, themselves rendered as an
image; bright points represent large
values and dark points represent small
values (in this example the smallest values
THE 2D
GAUSSIAN
SMOOTHING
FILTER
GAUSSIAN SMOOTHING
FILTER
Case of weighted averaging
Coefficients are 2D Gaussian
Gives more weight at the central pixels and less
weights to the neighbors
The farther away the neighbors, the smaller
the weight
1
−
𝑥𝑥 2
+
𝐺𝐺𝜎𝜎(x, y) = 2 exp 𝑦
𝑦 2
2
𝜋𝜋 2𝜋𝜋2
GAUSSIAN SMOOTHING
FILTER
The symmetric Gaussian kernel in
2D. This view shows a kernel scaled so
that its sum is equal to one
Convolution with this kernel forms
a weighted average which stresses
the point at the center of the
convolution window, and
incorporates little contribution
from those at the boundary.
𝐺𝐺𝜎𝜎(x, y) = 1 2 exp − 𝑥𝑥2 +
2
𝜋𝜋
𝑦𝑦2 2𝜋𝜋
GAUSSIAN SMOOTHING FILTER
BOX FILTER VS GAUSSIAN
GAUSSIAN SMOOTHING – DIFFERENT
SCALES
SMOOTHING BY GAUSSIAN FILTER
The standard deviation of
the gaussian determines
the amount of smoothing
Gaussian theoretically has
infinite support, but we
need a filter of finite size
For a 98.76% of the area,
we need +/ -2.5σ
+ / - 3σ covers over 99% of
the area
SHIFT-INVARIANT
LINEAR SYSTEMS
SHIFT INVARIANT LINEAR SYSTEMS
Most imaging systems have, to a good approximation, three
significant properties
SHIFT INVARIANT LINEAR SYSTEMS
Most imaging systems have, to a good approximation,
three significant properties
In a shift invariant system, the response to a translated
stimulus is just a translation of the response to the
stimulus
The response of a shift invariant linear system to a
stimulus is obtained by convolution
END