Lecture160 3
Lecture160 3
Image
processing &
computer
vision
SBES 160
By: Dr. Eman N. Marzban
[email protected]
32
https://medium.com/@bdhuma/6-basic-things-to-know-about-convolution-daef5e1bc411
Convolution vs. Correlation
33
Convolution vs. Correlation
34
https://en.m.wikipedia.org/wiki/File:Comparison_convolution_correlation.svg
Convolution or Correlation:
Outputs
35
Convolution: First Step
First: Flip the kernel around its horizontal and vertical axes
or rotate be 180 degrees
36
Convolution: Second step
37
Convolution: Move the kernel
over the image FULL
First Row = 5 16 28 20 3
38
Convolution: Move image over
the kernel (2)
Second Row = 20 41 43 21 7
39
Convolution: Move image over
the kernel (3)
Using this method:
[5 3] * [3 3] =
[5+3-1 3+3-1] =
[7 5]
40
Convolution: Move the kernel wo
padding VALID
The mask is moved over
the defined points in the
image only, first row is
done in one step yielding
116 and so on.
The output
[5 3] * [3 3] =
[5-3+1 3-3+1]=
[3 1]
41
Convolution: Move the kernel
with padding SAME
Pad the image with [N-1] for every dimension; i.e
increase rows by number of rows of the filter minus one
and increase columns by number of columns of the filter
minus one (zero padding or replicating).
42
Convolution: Move the kernel
with padding (2)
43
Convolution: Move the kernel
with padding (3)
44
Convolution: Move the kernel
with padding (4)
[5 3] * [3 3] =
[max(5,3) max(3,3)]=
[ 5 3]
45
Convolution: Notes
47
Sigma-Size Relationship:
1D, size 11
48
Low pass filters: Smoothing
or denoising
➢ Linear: Gaussian and Box(average)
Linear since each pixel is a linear combination of the neighboring
input pixels
https://ethz.ch/content/dam/ethz/special-interest/mavt/dynamic-systems-n-control/idsc-
49
dam/Lectures/amod/AMOD_2020/20201102-03%20-%20ETHZ%20-%20Image%20Gradients.pdf
Low pass filters: Smoothing
or denoising
➢ Linear: Box(average) and Gaussian
50
Burger and Burge, “Digital Image Processing: An Algorithmic Introduction Using Java”, 2016
Low pass filters: Smoothing
or denoising
➢ Important Gaussian Properties
Less in complexity
Convolution and Correlation are the same
51
Low pass filters: Smoothing
or denoising
➢ Non Linear: Median and Weighted median
52
Sundararajan, “Digital Image Processing: A Signal Processing and Algorithmic Approach”, 2017
Low pass filters: Example
53
Low pass filters: Example (2)
Corner:
Intersection of two
edges
Edge:
Change in intensity
54
Noise
56
Fig 5.2, Gonzalez and Woods, “Digital Image Processing”
Gaussian Noise
59
Uniform Noise
60
Impulse Noise:
Aka salt and pepper
61