SlideShare a Scribd company logo
1 of 67
Download to read offline
Computer Vision: Correlation,
Convolution, and Gradient
MENOUFIA UNIVERSITY
FACULTY OF COMPUTERS AND INFORMATION
INFORMATION TECHNOLOGY
COMPUTER VISION
โ€ซุงู„ู…ู†ูˆููŠุฉโ€ฌ โ€ซุฌุงู…ุนุฉโ€ฌ
โ€ซูˆุงู„ู…ุนู„ูˆู…ุงุชโ€ฌ โ€ซุงู„ุญุงุณุจุงุชโ€ฌ โ€ซูƒู„ูŠุฉโ€ฌ
โ€ซุงู„ู…ุนู„ูˆู…ุงุชโ€ฌ โ€ซุชูƒู†ูˆู„ูˆุฌูŠุงโ€ฌ
โ€ซุจุงู„ุญุงุณุจโ€ฌ โ€ซุงู„ุฑุคูŠุงโ€ฌ
โ€ซุงู„ู…ู†ูˆููŠุฉโ€ฌ โ€ซุฌุงู…ุนุฉโ€ฌ
Ahmed Fawzy Gad
ahmed.fawzy@ci.menofia.edu.eg
Tuesday 3 October 2017
Index
โ€ข Correlation
โ€ข Python Implementation
โ€ข Convolution
โ€ข Python Implementation
โ€ข Gradient
โ€ข Python Implementation
Correlation
Convolution
Gradient Filtering
CORRELATION
Correlation for 2D Image
โ€ข Correlation is used to match a
template to an image.
โ€ข Can you tell where the following
template exactly located in the
image?
โ€ข Using correlation we can find the
image region that best matches
the template.
?
How 2D Correlation Works?
โ€ข Given a template, using correlation the
template will pass through each image part
and a similarity check take place to find
how similar the template and the current
image part being processed.
โ€ข Starting by placing the template top-left
corner on the top-left corner of the image,
a similarity measure is calculated.
How 2D Correlation Works?
โ€ข Given a template, using correlation the
template will pass through each image part
and a similarity check take place to find
how similar the template and the current
image part being processed.
โ€ข Starting by placing the template top-left
corner on the top-left corner of the image,
a similarity measure is calculated.
๐‘ฎ ๐’Š, ๐’‹ =
๐’–=โˆ’๐’Œ
๐’Œ
๐’—=โˆ’๐’Œ
๐’Œ
๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š + ๐’–, ๐’‹ + ๐’—]
How 2D Correlation Works?
โ€ข Given a template, using correlation the
template will pass through each image part
and a similarity check take place to find
how similar the template and the current
image part being processed.
โ€ข Starting by placing the template top-left
corner on the top-left corner of the image,
a similarity measure is calculated.
Correlation for 2D Image
1 3 4 3
2 7 4 1
6 2 5 2
13 6 8 9
Template โ€“ 3x3
2 1 -4
3 2 5
-1 8 1
Correlation for 2D Image
1 3 4 3
2 7 4 1
6 2 5 2
13 6 8 9
Template โ€“ 3x3
2 1 -4
3 2 5
-1 8 1
Correlation for 2D Image
1 3 4 3
2 7 4 1
6 2 5 2
13 6 8 9
Template โ€“ 3x3
2 โˆ— 1 + 1 โˆ— 3 โˆ’ 4 โˆ— 4 + 3 โˆ— 2 + 2 โˆ— 7 + 5 โˆ— 4
โˆ’ 1 โˆ— 6 + 8 โˆ— 2 + 1 โˆ— 5
= ๐Ÿ’๐Ÿ’
Correlation for 2D Image
1 3 4 3
2 7 4 1
6 2 5 2
13 6 8 9
Template โ€“ 3x3
44
Did you get why template
sizes are odd?
Even Template Size
58 3 213 81 78
185 87 32 27 11
70 66 60 2 19
61 91 129 89 38
14 7 58 14 42
Even template sizes has no center.
E.g. 2x3, 2x2, 5x6, โ€ฆ
๐Ÿ–๐Ÿ’
???
Correlation for 2D Image
1 3 4 3
2 7 4 1
6 2 5 2
13 6 8 9
Template โ€“ 3x3
2 1 -4
3 2 5
-1 8 1
44
Correlation for 2D Image
1 3 4 3
2 7 4 1
6 2 5 2
13 6 8 9
Template โ€“ 3x3
2 โˆ— 3 + 1 โˆ— 4 โˆ’ 4 โˆ— 3 + 3 โˆ— 7 + 2 โˆ— 4 + 5 โˆ— 1
โˆ’ 1 โˆ— 2 + 8 โˆ— 5 + 1 โˆ— 2
= ๐Ÿ•๐Ÿ
44
Correlation for 2D Image
1 3 4 3
2 7 4 1
6 2 5 2
13 6 8 9
Template โ€“ 3x3
44 72
Based on the current step, what is the region that
best matches the template?
It is the one corresponding to the highest score in
the result matrix.
Continue Correlating the Template
1 3 4 3
2 7 4 1
6 2 5 2
13 6 8 9
Template โ€“ 3x3
2 1 -4
3 2 5
-1 8 1
44 72
Continue Correlating the Template
1 3 4 3
2 7 4 1
6 2 5 2
13 6 8 9
Template โ€“ 3x3
2 1 -4
3 2 5
-1 8 1
44 72
This will cause the program performing correlation to
fall into index out of bounds exception.
Padding by Zeros
1 3 4 3
2 7 4 1
6 2 5 2
13 6 8 9
Template โ€“ 3x3
44 72 0
0
0
0
It doesn`t affect multiplication.
Why Zero?
Continue Correlating the Template
1 3 4 3
2 7 4 1
6 2 5 2
13 6 8 9
Template โ€“ 3x3
44 72 0
0
0
0
2 1 -4
3 2 5
-1 8 1
Continue Correlating the Template
1 3 4 3
2 7 4 1
6 2 5 2
13 6 8 9
Template โ€“ 3x3
44 72 0
0
0
0
2 โˆ— 4 + 1 โˆ— 3 โˆ’ 4 โˆ— 0 + 3 โˆ— 4 + 2 โˆ— 1 + 5 โˆ— 0
โˆ’ 1 โˆ— 5 + 8 โˆ— 2 + 1 โˆ— 0
= ๐Ÿ‘๐Ÿ”
Continue Correlating the Template
1 3 4 3
2 7 4 1
6 2 5 2
13 6 8 9
Template โ€“ 3x3
44 72 36 0
0
0
0
2 โˆ— 4 + 1 โˆ— 3 โˆ’ 4 โˆ— 0 + 3 โˆ— 4 + 2 โˆ— 1 + 5 โˆ— 0
โˆ’ 1 โˆ— 5 + 8 โˆ— 2 + 1 โˆ— 0
= ๐Ÿ‘๐Ÿ”
Continue Correlating the Template
1 3 4 3
2 7 4 1
6 2 5 2
13 6 8 9
Template โ€“ 3x3
2 1 -4
3 2 5
-1 8 1
44 72 36
Continue Correlating the Template
1 3 4 3
2 7 4 1
6 2 5 2
13 6 8 9
Template โ€“ 3x3
2 1 -4
3 2 5
-1 8 1
44 72 36
Pad by Zeros
1 3 4 3
2 7 4 1
6 2 5 2
13 6 8 9
Template โ€“ 3x3
44 72 36
0 0 0 0
Continue Correlating the Template
1 3 4 3
2 7 4 1
6 2 5 2
13 6 8 9
Template โ€“ 3x3
44 72 36
0 0 0 0
2 1 -4
3 2 5
-1 8 1
Continue Correlating the Template
1 3 4 3
2 7 4 1
6 2 5 2
13 6 8 9
Template โ€“ 3x3
44 72 36
0 0 0 0
2 โˆ— 2 + 1 โˆ— 5 โˆ’ 4 โˆ— 2 + 3 โˆ— 6 + 2 โˆ— 8 + 5 โˆ— 9
โˆ’ 1 โˆ— 0 + 8 โˆ— 0 + 1 โˆ— 0
= ๐Ÿ–๐ŸŽ
Continue Correlating the Template
1 3 4 3
2 7 4 1
6 2 5 2
13 6 8 9
Template โ€“ 3x3
44 72 36
80
Continue till end.
โ€ข It depends on both the template size.
โ€ข For 3x3 template, pad two columns and two
rows. One column to the left and another to
the right. One row at the top and one row
at the bottom.
โ€ข For 5x5? Pad 4 rows (two left & two right)
and 5 columns (two top & two bottom).
โ€ข Generally, for N*N template pad (N-1)/2
columns and rows at each side.
How much Padding Required?
1 3 4 3
2 7 4 1
6 2 5 2
13 6 8 9
0 0 0 0
0 0 0 0
0
0
0
0
0
0
0
0
0
0
0
0
How to do this
Programmatically.?
Implementing Correlation in Python โ€“ 3x3
Template
Implementing Correlation in Python โ€“ 141x141
Template
Implementing Correlation in Python โ€“ 141x141
Template
Implementing Correlation in Python โ€“ 141x141
Template
Implementing Correlation in Python โ€“ 141x141
Template
Is this is the
optimal results?
No. But WHY?
Matching using Correlation
โ€ข Matching depends on just
multiplication.
โ€ข The highest results of
multiplication is the one selected
as best match.
โ€ข But the highest results of
multiplication not always refers
to best match.
Template Result
Matching using
Correlation
โ€ข Make a simple edit on the image
by adding a pure white
rectangular area.
โ€ข Use the previous template.
โ€ข Apply the algorithm.
Template
Matching using Correlation
โ€ข The best matched region is the
white region.
โ€ข The reason is that correlation
depends on multiplication.
โ€ข What gives highest multiplication
results is the best match.
โ€ข Getting high results corresponds to
multiplying by higher numbers.
โ€ข The highest pixel value for gray
images is 255 for white.
Implementing Correlation in Python โ€“ Generic
Code โ€“ Squared Odd Sized Templates
Implementing Correlation in Python โ€“ Generic
Code โ€“ Squared Odd Sized Templates
Implementing Correlation in Python โ€“ Generic
Code โ€“ Squared Odd Sized Templates
Implementing Correlation in Python โ€“ Generic
Code โ€“ Squared Odd Sized Templates
CONVOLUTION
What is Convolution?
โ€ข The primary objective of mathematical convolution is combining two
signals to generate a third signal. Convolution is not limited on digital
image processing and it is a broad term that works on signals.
Input Signal
Impulse Response
Output Signal
System
Convolution
Convolution Formula for 2D Digital Signal
โ€ข Convolution is applied similarly to correlation.
โ€ข Note how similar the formulas for correlation and convolution. The
only difference is that in the signs of ๐’– and ๐’— variables.
โ€ข Correlation formula has positive signs for ๐’– and ๐’— while correlation
has negative signs for them.
๐‘ฎ ๐’Š, ๐’‹ =
๐’–=โˆ’๐’Œ
๐’Œ
๐’—=โˆ’๐’Œ
๐’Œ
๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š โˆ’ ๐’–, ๐’‹ โˆ’ ๐’—]๐‘ฎ ๐’Š, ๐’‹ =
๐’–=โˆ’๐’Œ
๐’Œ
๐’—=โˆ’๐’Œ
๐’Œ
๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š โˆ’ ๐’–, ๐’‹ โˆ’ ๐’—]
Is just changing
signs make sense?
Correlation Vs. Convolution
๐‘ฎ ๐’Š, ๐’‹ =
๐’–=โˆ’๐’Œ
๐’Œ
๐’—=โˆ’๐’Œ
๐’Œ
๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š โˆ’ ๐’–, ๐’‹ โˆ’ ๐’—]๐‘ฎ ๐’Š, ๐’‹ =
๐’–=โˆ’๐’Œ
๐’Œ
๐’—=โˆ’๐’Œ
๐’Œ
๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š + ๐’–, ๐’‹ + ๐’—]
Correlation Convolution
13204
458047
09373
.2.4.1
.5.8.3
.9.5.7
.2.4.1
.5.8.3
.9.5.7
Correlation Vs. Convolution
๐‘ฎ ๐’Š, ๐’‹ =
๐’–=โˆ’๐’Œ
๐’Œ
๐’—=โˆ’๐’Œ
๐’Œ
๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š โˆ’ ๐’–, ๐’‹ โˆ’ ๐’—]๐‘ฎ ๐’Š, ๐’‹ =
๐’–=โˆ’๐’Œ
๐’Œ
๐’—=โˆ’๐’Œ
๐’Œ
๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š + ๐’–, ๐’‹ + ๐’—]
Correlation Convolution
13204
458047
09373
.2.4.1
.5.8.3
.9.5.7
.2.4.1
.5.8.3
.9.5.7
Correlation Vs. Convolution
๐‘ฎ ๐’Š, ๐’‹ =
๐’–=โˆ’๐’Œ
๐’Œ
๐’—=โˆ’๐’Œ
๐’Œ
๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š โˆ’ ๐’–, ๐’‹ โˆ’ ๐’—]๐‘ฎ ๐’Š, ๐’‹ =
๐’–=โˆ’๐’Œ
๐’Œ
๐’—=โˆ’๐’Œ
๐’Œ
๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š + ๐’–, ๐’‹ + ๐’—]
Correlation Convolution
13204
458047
09373
.2.4.1
.5.8.3
.9.5.7
.2.4.1
.5.8.3
.9.5.7
Correlation Vs. Convolution
๐‘ฎ ๐’Š, ๐’‹ =
๐’–=โˆ’๐’Œ
๐’Œ
๐’—=โˆ’๐’Œ
๐’Œ
๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š โˆ’ ๐’–, ๐’‹ โˆ’ ๐’—]๐‘ฎ ๐’Š, ๐’‹ =
๐’–=โˆ’๐’Œ
๐’Œ
๐’—=โˆ’๐’Œ
๐’Œ
๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š + ๐’–, ๐’‹ + ๐’—]
Correlation Convolution
13204
458047
09373
.2.4.1
.5.8.3
.9.5.7
.2.4.1
.5.8.3
.9.5.7
Correlation Vs. Convolution
๐‘ฎ ๐’Š, ๐’‹ =
๐’–=โˆ’๐’Œ
๐’Œ
๐’—=โˆ’๐’Œ
๐’Œ
๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š โˆ’ ๐’–, ๐’‹ โˆ’ ๐’—]๐‘ฎ ๐’Š, ๐’‹ =
๐’–=โˆ’๐’Œ
๐’Œ
๐’—=โˆ’๐’Œ
๐’Œ
๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š + ๐’–, ๐’‹ + ๐’—]
Correlation Convolution
13204
458047
09373
.2.4.1
.5.8.3
.9.5.7
.2.4.1
.5.8.3
.9.5.7
Correlation Vs. Convolution
๐‘ฎ ๐’Š, ๐’‹ =
๐’–=โˆ’๐’Œ
๐’Œ
๐’—=โˆ’๐’Œ
๐’Œ
๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š โˆ’ ๐’–, ๐’‹ โˆ’ ๐’—]๐‘ฎ ๐’Š, ๐’‹ =
๐’–=โˆ’๐’Œ
๐’Œ
๐’—=โˆ’๐’Œ
๐’Œ
๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š + ๐’–, ๐’‹ + ๐’—]
Correlation Convolution
13204
458047
09373
.2.4.1
.5.8.3
.9.5.7
.2.4.1
.5.8.3
.9.5.7
Correlation Vs. Convolution
๐‘ฎ ๐’Š, ๐’‹ =
๐’–=โˆ’๐’Œ
๐’Œ
๐’—=โˆ’๐’Œ
๐’Œ
๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š โˆ’ ๐’–, ๐’‹ โˆ’ ๐’—]๐‘ฎ ๐’Š, ๐’‹ =
๐’–=โˆ’๐’Œ
๐’Œ
๐’—=โˆ’๐’Œ
๐’Œ
๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š + ๐’–, ๐’‹ + ๐’—]
Correlation Convolution
13204
458047
09373
.2.4.1
.5.8.3
.9.5.7
.2.4.1
.5.8.3
.9.5.7
Correlation Vs. Convolution
๐‘ฎ ๐’Š, ๐’‹ =
๐’–=โˆ’๐’Œ
๐’Œ
๐’—=โˆ’๐’Œ
๐’Œ
๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š โˆ’ ๐’–, ๐’‹ โˆ’ ๐’—]๐‘ฎ ๐’Š, ๐’‹ =
๐’–=โˆ’๐’Œ
๐’Œ
๐’—=โˆ’๐’Œ
๐’Œ
๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š + ๐’–, ๐’‹ + ๐’—]
Correlation Convolution
13204
458047
09373
.2.4.1
.5.8.3
.9.5.7
.2.4.1
.5.8.3
.9.5.7
Correlation Vs. Convolution
๐‘ฎ ๐’Š, ๐’‹ =
๐’–=โˆ’๐’Œ
๐’Œ
๐’—=โˆ’๐’Œ
๐’Œ
๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š โˆ’ ๐’–, ๐’‹ โˆ’ ๐’—]๐‘ฎ ๐’Š, ๐’‹ =
๐’–=โˆ’๐’Œ
๐’Œ
๐’—=โˆ’๐’Œ
๐’Œ
๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š + ๐’–, ๐’‹ + ๐’—]
Correlation Convolution
13204
458047
09373
.2.4.1
.5.8.3
.9.5.7
.2.4.1
.5.8.3
.9.5.7
Correlation Vs. Convolution
๐‘ฎ ๐’Š, ๐’‹ =
๐’–=โˆ’๐’Œ
๐’Œ
๐’—=โˆ’๐’Œ
๐’Œ
๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š โˆ’ ๐’–, ๐’‹ โˆ’ ๐’—]๐‘ฎ ๐’Š, ๐’‹ =
๐’–=โˆ’๐’Œ
๐’Œ
๐’—=โˆ’๐’Œ
๐’Œ
๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š + ๐’–, ๐’‹ + ๐’—]
Correlation Convolution
13204
458047
09373
.2.4.1
.5.8.3
.9.5.7
.2.4.1
.5.8.3
.9.5.7
-1, 1-1, 0-1, -1
0, 10, 00, -1
1, 11, 01, -1
1, -11, 01, 1
0, -10, 00, 1
-1, -1-1, 0-1, 1
How to simplify
convolution?
Simplifying Convolution
.2.4.1
.5.8.3
.9.5.7
1, -11, 01, 1
0, -10, 00, 1
-1, -1-1, 0-1, 1
*
13204
458047
09373
.7.5.9
.3.8.5
.1.4.2
13204
458047
09373= -1, 1-1, 0-1, -1
0, 10, 00, -1
1, 11, 01, -1
Just rotate the template with 180 degrees before
multiplying by the image.
*
Applying convolution is similar to correlation except
for flipping the template before multiplication.
Two Many Multiplications & Additions
โ€ข Assume to remove noise from an image, it should be applied to two
filters (filter1 and filter2). Each filter has size of 7x7 pixels and the
image is of size 1024x1024 pixels.
โ€ข A simple approach is to apply filter1 to the image then apply filter2 to
the output of filter1.
โ€ข Too many multiplications and additions due to applying two filters on
the image. 1,024 x 1,024 x 49 multiplication and 1,000 x 1,000 x 49
addition for the single filter.
1024x1024
Image
Filter1
* Temp. Result Filter2
* Result
Convolution Associative Property
โ€ข Using the associative property of convolution, we can reduce the
number of multiplications and additions.
โ€ข To apply two filters f1 and f2 over an image, we can merge the two
filters together then apply the convolution between the resultant new
filter and the image.
โ€ข Finally, there is only 1,024 x 1024 x 49 multiplication and addition.
(Im * ๐’‡ ๐Ÿ) * ๐’‡ ๐Ÿ = Im * (๐’‡ ๐Ÿ * ๐’‡ ๐Ÿ)
For ๐’‡ ๐Ÿ * ๐’‡ ๐Ÿ = ๐’‡ ๐Ÿ‘
Result is Im * ๐’‡ ๐Ÿ‘
Convolution Applications
โ€ข Convolution is used to merge signals.
โ€ข It is used to apply operations like smoothing and filtering images
where the primary task is selecting the appropriate filter template or
mask.
โ€ข Convolution can also be used to find gradients of the image.
Implementing Convolution in Python
โ€ข The implementation of convolution is identical to correlation except
for the new command that rotates the template.
GRADIENT
Image Gradients
โ€ข Image gradients can be defined as change of intensity in some direction.
โ€ข Based on the way gradients were calculated and specifically based on
the template/kernel used, gradients can be horizontal (X direction) or
vertical (Y direction) in direction.
-1-1-1
000
111
Horizontal
10-1
10-1
10-1
Vertical
ฮธ = ๐‘ก๐‘Ž๐‘›โˆ’1
[
๐บ ๐‘ฆ
๐บ ๐‘ฅ
] ๐บ = ๐บ ๐‘ฅ + ๐บ ๐‘ฆ
Image Gradient Calculation Steps
โ€ข Calculate the image gradient in X direction at each pixel.
โ€ข Calculate the image gradient in Y direction at each pixel.
โ€ข Calculate the overall gradient for the pixel.
Implementing Horizontal Gradient in Python
Implementing Horizontal Gradient in Python
Implementing Vertical Gradient in Python
Implementing Vertical Gradient in Python
FILTERING
Example โ€“ Mean Filter
โ€ขMean Filter Kernel.
๐Ÿ
๐Ÿ—
๐Ÿ
๐Ÿ—
๐Ÿ
๐Ÿ—
๐Ÿ
๐Ÿ—
๐Ÿ
๐Ÿ—
๐Ÿ
๐Ÿ—
๐Ÿ
๐Ÿ—
๐Ÿ
๐Ÿ—
๐Ÿ
๐Ÿ—
58 3 213 81 78
185 87 32 27 11
70 66 60 2 19
61 91 129 89 38
14 7 58 14 42
๐Ÿ
๐Ÿ—
โˆ— 58 +
๐Ÿ
๐Ÿ—
โˆ— 3 +
๐Ÿ
๐Ÿ—
โˆ— 213 +
๐Ÿ
๐Ÿ—
โˆ— 185 +
๐Ÿ
๐Ÿ—
โˆ— 87 +
๐Ÿ
๐Ÿ—
โˆ— 32
+
๐Ÿ
๐Ÿ—
โˆ— 70 +
๐Ÿ
๐Ÿ—
โˆ— 66 +
๐Ÿ
๐Ÿ—
โˆ— 60
= 85.67 ~ 86
Implement in Python (Deadline next week starting @ 7 Oct. 2017).
1. Mean Smoothing Filter
2. Gaussian Smoothing Filter
3. Sharpening Filter
4. Median Filter

More Related Content

What's hot

Image trnsformations
Image trnsformationsImage trnsformations
Image trnsformationsJohn Williams
ย 
Enhancement in spatial domain
Enhancement in spatial domainEnhancement in spatial domain
Enhancement in spatial domainAshish Kumar
ย 
Convolutional Neural Network - CNN | How CNN Works | Deep Learning Course | S...
Convolutional Neural Network - CNN | How CNN Works | Deep Learning Course | S...Convolutional Neural Network - CNN | How CNN Works | Deep Learning Course | S...
Convolutional Neural Network - CNN | How CNN Works | Deep Learning Course | S...Simplilearn
ย 
Prim's algorithm
Prim's algorithmPrim's algorithm
Prim's algorithmPankaj Thakur
ย 
Artificial Neural Networks Lect3: Neural Network Learning rules
Artificial Neural Networks Lect3: Neural Network Learning rulesArtificial Neural Networks Lect3: Neural Network Learning rules
Artificial Neural Networks Lect3: Neural Network Learning rulesMohammed Bennamoun
ย 
Computer Vision - Image Filters
Computer Vision - Image FiltersComputer Vision - Image Filters
Computer Vision - Image FiltersYoss Cohen
ย 
Image Processing: Spatial filters
Image Processing: Spatial filtersImage Processing: Spatial filters
Image Processing: Spatial filtersA B Shinde
ย 
Region Splitting and Merging Technique For Image segmentation.
Region Splitting and Merging Technique For Image segmentation.Region Splitting and Merging Technique For Image segmentation.
Region Splitting and Merging Technique For Image segmentation.SomitSamanto1
ย 
[PR12] Inception and Xception - Jaejun Yoo
[PR12] Inception and Xception - Jaejun Yoo[PR12] Inception and Xception - Jaejun Yoo
[PR12] Inception and Xception - Jaejun YooJaeJun Yoo
ย 
Hog and sift
Hog and siftHog and sift
Hog and siftAnandShinde47
ย 
Chapter10 image segmentation
Chapter10 image segmentationChapter10 image segmentation
Chapter10 image segmentationasodariyabhavesh
ย 
Image Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain FiltersImage Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain FiltersKarthika Ramachandran
ย 
Chapter 9 morphological image processing
Chapter 9   morphological image processingChapter 9   morphological image processing
Chapter 9 morphological image processingAhmed Daoud
ย 
Optimization/Gradient Descent
Optimization/Gradient DescentOptimization/Gradient Descent
Optimization/Gradient Descentkandelin
ย 
digital image processing, image processing
digital image processing, image processingdigital image processing, image processing
digital image processing, image processingKalyan Acharjya
ย 
Optimization for Deep Learning
Optimization for Deep LearningOptimization for Deep Learning
Optimization for Deep LearningSebastian Ruder
ย 
Strassen's matrix multiplication
Strassen's matrix multiplicationStrassen's matrix multiplication
Strassen's matrix multiplicationMegha V
ย 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and SegmentationA B Shinde
ย 
Training Neural Networks
Training Neural NetworksTraining Neural Networks
Training Neural NetworksDatabricks
ย 

What's hot (20)

Image trnsformations
Image trnsformationsImage trnsformations
Image trnsformations
ย 
Enhancement in spatial domain
Enhancement in spatial domainEnhancement in spatial domain
Enhancement in spatial domain
ย 
Convolutional Neural Network - CNN | How CNN Works | Deep Learning Course | S...
Convolutional Neural Network - CNN | How CNN Works | Deep Learning Course | S...Convolutional Neural Network - CNN | How CNN Works | Deep Learning Course | S...
Convolutional Neural Network - CNN | How CNN Works | Deep Learning Course | S...
ย 
Prim's algorithm
Prim's algorithmPrim's algorithm
Prim's algorithm
ย 
Artificial Neural Networks Lect3: Neural Network Learning rules
Artificial Neural Networks Lect3: Neural Network Learning rulesArtificial Neural Networks Lect3: Neural Network Learning rules
Artificial Neural Networks Lect3: Neural Network Learning rules
ย 
Computer Vision - Image Filters
Computer Vision - Image FiltersComputer Vision - Image Filters
Computer Vision - Image Filters
ย 
Image Processing: Spatial filters
Image Processing: Spatial filtersImage Processing: Spatial filters
Image Processing: Spatial filters
ย 
Region Splitting and Merging Technique For Image segmentation.
Region Splitting and Merging Technique For Image segmentation.Region Splitting and Merging Technique For Image segmentation.
Region Splitting and Merging Technique For Image segmentation.
ย 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image Processing
ย 
[PR12] Inception and Xception - Jaejun Yoo
[PR12] Inception and Xception - Jaejun Yoo[PR12] Inception and Xception - Jaejun Yoo
[PR12] Inception and Xception - Jaejun Yoo
ย 
Hog and sift
Hog and siftHog and sift
Hog and sift
ย 
Chapter10 image segmentation
Chapter10 image segmentationChapter10 image segmentation
Chapter10 image segmentation
ย 
Image Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain FiltersImage Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain Filters
ย 
Chapter 9 morphological image processing
Chapter 9   morphological image processingChapter 9   morphological image processing
Chapter 9 morphological image processing
ย 
Optimization/Gradient Descent
Optimization/Gradient DescentOptimization/Gradient Descent
Optimization/Gradient Descent
ย 
digital image processing, image processing
digital image processing, image processingdigital image processing, image processing
digital image processing, image processing
ย 
Optimization for Deep Learning
Optimization for Deep LearningOptimization for Deep Learning
Optimization for Deep Learning
ย 
Strassen's matrix multiplication
Strassen's matrix multiplicationStrassen's matrix multiplication
Strassen's matrix multiplication
ย 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and Segmentation
ย 
Training Neural Networks
Training Neural NetworksTraining Neural Networks
Training Neural Networks
ย 

Similar to Computer Vision: Correlation, Convolution, and Gradient

Unit-1 Basic Concept of Algorithm.pptx
Unit-1 Basic Concept of Algorithm.pptxUnit-1 Basic Concept of Algorithm.pptx
Unit-1 Basic Concept of Algorithm.pptxssuser01e301
ย 
MLU_DTE_Lecture_2.pptx
MLU_DTE_Lecture_2.pptxMLU_DTE_Lecture_2.pptx
MLU_DTE_Lecture_2.pptxRahulChaudhry15
ย 
Global and local alignment (bioinformatics)
Global and local alignment (bioinformatics)Global and local alignment (bioinformatics)
Global and local alignment (bioinformatics)Pritom Chaki
ย 
MACHINE LEARNING.pptx
MACHINE LEARNING.pptxMACHINE LEARNING.pptx
MACHINE LEARNING.pptxSOURAVGHOSH623569
ย 
PREDICTION MODELS BASED ON MAX-STEMS Episode Two: Combinatorial Approach
PREDICTION MODELS BASED ON MAX-STEMS Episode Two: Combinatorial ApproachPREDICTION MODELS BASED ON MAX-STEMS Episode Two: Combinatorial Approach
PREDICTION MODELS BASED ON MAX-STEMS Episode Two: Combinatorial Approachahmet furkan emrehan
ย 
Answer SheetInstructions You must show your work to .docx
Answer SheetInstructions  You must show your work to .docxAnswer SheetInstructions  You must show your work to .docx
Answer SheetInstructions You must show your work to .docxjustine1simpson78276
ย 
Direct solution of sparse network equations by optimally ordered triangular f...
Direct solution of sparse network equations by optimally ordered triangular f...Direct solution of sparse network equations by optimally ordered triangular f...
Direct solution of sparse network equations by optimally ordered triangular f...Dimas Ruliandi
ย 
(8) Lesson 9.2
(8) Lesson 9.2(8) Lesson 9.2
(8) Lesson 9.2wzuri
ย 
2014-mo444-practical-assignment-04-paulo_faria
2014-mo444-practical-assignment-04-paulo_faria2014-mo444-practical-assignment-04-paulo_faria
2014-mo444-practical-assignment-04-paulo_fariaPaulo Faria
ย 
Mncs 16-10-1์ฃผ-๋ณ€์Šน๊ทœ-introduction to the machine learning #2
Mncs 16-10-1์ฃผ-๋ณ€์Šน๊ทœ-introduction to the machine learning #2Mncs 16-10-1์ฃผ-๋ณ€์Šน๊ทœ-introduction to the machine learning #2
Mncs 16-10-1์ฃผ-๋ณ€์Šน๊ทœ-introduction to the machine learning #2Seung-gyu Byeon
ย 
Alg 1 ch. 3.5
Alg 1 ch. 3.5Alg 1 ch. 3.5
Alg 1 ch. 3.5Kathy Favazza
ย 
Lecture-1-Algorithms.pptx
Lecture-1-Algorithms.pptxLecture-1-Algorithms.pptx
Lecture-1-Algorithms.pptxxalahama3
ย 
9A Two-Dimensional Geometry
9A Two-Dimensional Geometry9A Two-Dimensional Geometry
9A Two-Dimensional GeometryKayla Smith
ย 
Inequalities
InequalitiesInequalities
InequalitiesKathy Favazza
ย 
cat-quant-cheat-sheet
 cat-quant-cheat-sheet cat-quant-cheat-sheet
cat-quant-cheat-sheettechonomics1
ย 
"SSumM: Sparse Summarization of Massive Graphs", KDD 2020
"SSumM: Sparse Summarization of Massive Graphs", KDD 2020"SSumM: Sparse Summarization of Massive Graphs", KDD 2020
"SSumM: Sparse Summarization of Massive Graphs", KDD 2020KyuhanLee4
ย 

Similar to Computer Vision: Correlation, Convolution, and Gradient (20)

Unit-1 Basic Concept of Algorithm.pptx
Unit-1 Basic Concept of Algorithm.pptxUnit-1 Basic Concept of Algorithm.pptx
Unit-1 Basic Concept of Algorithm.pptx
ย 
MLU_DTE_Lecture_2.pptx
MLU_DTE_Lecture_2.pptxMLU_DTE_Lecture_2.pptx
MLU_DTE_Lecture_2.pptx
ย 
Global and local alignment (bioinformatics)
Global and local alignment (bioinformatics)Global and local alignment (bioinformatics)
Global and local alignment (bioinformatics)
ย 
Curvefitting
CurvefittingCurvefitting
Curvefitting
ย 
MACHINE LEARNING.pptx
MACHINE LEARNING.pptxMACHINE LEARNING.pptx
MACHINE LEARNING.pptx
ย 
PREDICTION MODELS BASED ON MAX-STEMS Episode Two: Combinatorial Approach
PREDICTION MODELS BASED ON MAX-STEMS Episode Two: Combinatorial ApproachPREDICTION MODELS BASED ON MAX-STEMS Episode Two: Combinatorial Approach
PREDICTION MODELS BASED ON MAX-STEMS Episode Two: Combinatorial Approach
ย 
Answer SheetInstructions You must show your work to .docx
Answer SheetInstructions  You must show your work to .docxAnswer SheetInstructions  You must show your work to .docx
Answer SheetInstructions You must show your work to .docx
ย 
Direct solution of sparse network equations by optimally ordered triangular f...
Direct solution of sparse network equations by optimally ordered triangular f...Direct solution of sparse network equations by optimally ordered triangular f...
Direct solution of sparse network equations by optimally ordered triangular f...
ย 
(8) Lesson 9.2
(8) Lesson 9.2(8) Lesson 9.2
(8) Lesson 9.2
ย 
2014-mo444-practical-assignment-04-paulo_faria
2014-mo444-practical-assignment-04-paulo_faria2014-mo444-practical-assignment-04-paulo_faria
2014-mo444-practical-assignment-04-paulo_faria
ย 
Mncs 16-10-1์ฃผ-๋ณ€์Šน๊ทœ-introduction to the machine learning #2
Mncs 16-10-1์ฃผ-๋ณ€์Šน๊ทœ-introduction to the machine learning #2Mncs 16-10-1์ฃผ-๋ณ€์Šน๊ทœ-introduction to the machine learning #2
Mncs 16-10-1์ฃผ-๋ณ€์Šน๊ทœ-introduction to the machine learning #2
ย 
Alg 1 ch. 3.5
Alg 1 ch. 3.5Alg 1 ch. 3.5
Alg 1 ch. 3.5
ย 
Lecture-1-Algorithms.pptx
Lecture-1-Algorithms.pptxLecture-1-Algorithms.pptx
Lecture-1-Algorithms.pptx
ย 
Biological sequences analysis
Biological sequences analysisBiological sequences analysis
Biological sequences analysis
ย 
9A Two-Dimensional Geometry
9A Two-Dimensional Geometry9A Two-Dimensional Geometry
9A Two-Dimensional Geometry
ย 
Inequalities
InequalitiesInequalities
Inequalities
ย 
Cat Quant Cheat Sheet
Cat Quant Cheat SheetCat Quant Cheat Sheet
Cat Quant Cheat Sheet
ย 
cat-quant-cheat-sheet
 cat-quant-cheat-sheet cat-quant-cheat-sheet
cat-quant-cheat-sheet
ย 
"SSumM: Sparse Summarization of Massive Graphs", KDD 2020
"SSumM: Sparse Summarization of Massive Graphs", KDD 2020"SSumM: Sparse Summarization of Massive Graphs", KDD 2020
"SSumM: Sparse Summarization of Massive Graphs", KDD 2020
ย 
Ch06 alignment
Ch06 alignmentCh06 alignment
Ch06 alignment
ย 

More from Ahmed Gad

ICEIT'20 Cython for Speeding-up Genetic Algorithm
ICEIT'20 Cython for Speeding-up Genetic AlgorithmICEIT'20 Cython for Speeding-up Genetic Algorithm
ICEIT'20 Cython for Speeding-up Genetic AlgorithmAhmed Gad
ย 
NumPyCNNAndroid: A Library for Straightforward Implementation of Convolutiona...
NumPyCNNAndroid: A Library for Straightforward Implementation of Convolutiona...NumPyCNNAndroid: A Library for Straightforward Implementation of Convolutiona...
NumPyCNNAndroid: A Library for Straightforward Implementation of Convolutiona...Ahmed Gad
ย 
Python for Computer Vision - Revision 2nd Edition
Python for Computer Vision - Revision 2nd EditionPython for Computer Vision - Revision 2nd Edition
Python for Computer Vision - Revision 2nd EditionAhmed Gad
ย 
Multi-Objective Optimization using Non-Dominated Sorting Genetic Algorithm wi...
Multi-Objective Optimization using Non-Dominated Sorting Genetic Algorithm wi...Multi-Objective Optimization using Non-Dominated Sorting Genetic Algorithm wi...
Multi-Objective Optimization using Non-Dominated Sorting Genetic Algorithm wi...Ahmed Gad
ย 
M.Sc. Thesis - Automatic People Counting in Crowded Scenes
M.Sc. Thesis - Automatic People Counting in Crowded ScenesM.Sc. Thesis - Automatic People Counting in Crowded Scenes
M.Sc. Thesis - Automatic People Counting in Crowded ScenesAhmed Gad
ย 
Derivation of Convolutional Neural Network from Fully Connected Network Step-...
Derivation of Convolutional Neural Network from Fully Connected Network Step-...Derivation of Convolutional Neural Network from Fully Connected Network Step-...
Derivation of Convolutional Neural Network from Fully Connected Network Step-...Ahmed Gad
ย 
Introduction to Optimization with Genetic Algorithm (GA)
Introduction to Optimization with Genetic Algorithm (GA)Introduction to Optimization with Genetic Algorithm (GA)
Introduction to Optimization with Genetic Algorithm (GA)Ahmed Gad
ย 
Derivation of Convolutional Neural Network (ConvNet) from Fully Connected Net...
Derivation of Convolutional Neural Network (ConvNet) from Fully Connected Net...Derivation of Convolutional Neural Network (ConvNet) from Fully Connected Net...
Derivation of Convolutional Neural Network (ConvNet) from Fully Connected Net...Ahmed Gad
ย 
Avoid Overfitting with Regularization
Avoid Overfitting with RegularizationAvoid Overfitting with Regularization
Avoid Overfitting with RegularizationAhmed Gad
ย 
Genetic Algorithm (GA) Optimization - Step-by-Step Example
Genetic Algorithm (GA) Optimization - Step-by-Step ExampleGenetic Algorithm (GA) Optimization - Step-by-Step Example
Genetic Algorithm (GA) Optimization - Step-by-Step ExampleAhmed Gad
ย 
ICCES 2017 - Crowd Density Estimation Method using Regression Analysis
ICCES 2017 - Crowd Density Estimation Method using Regression AnalysisICCES 2017 - Crowd Density Estimation Method using Regression Analysis
ICCES 2017 - Crowd Density Estimation Method using Regression AnalysisAhmed Gad
ย 
Backpropagation: Understanding How to Update ANNs Weights Step-by-Step
Backpropagation: Understanding How to Update ANNs Weights Step-by-StepBackpropagation: Understanding How to Update ANNs Weights Step-by-Step
Backpropagation: Understanding How to Update ANNs Weights Step-by-StepAhmed Gad
ย 
Python for Computer Vision - Revision
Python for Computer Vision - RevisionPython for Computer Vision - Revision
Python for Computer Vision - RevisionAhmed Gad
ย 
Anime Studio Pro 10 Tutorial as Part of Multimedia Course
Anime Studio Pro 10 Tutorial as Part of Multimedia CourseAnime Studio Pro 10 Tutorial as Part of Multimedia Course
Anime Studio Pro 10 Tutorial as Part of Multimedia CourseAhmed Gad
ย 
Brief Introduction to Deep Learning + Solving XOR using ANNs
Brief Introduction to Deep Learning + Solving XOR using ANNsBrief Introduction to Deep Learning + Solving XOR using ANNs
Brief Introduction to Deep Learning + Solving XOR using ANNsAhmed Gad
ย 
Operations in Digital Image Processing + Convolution by Example
Operations in Digital Image Processing + Convolution by ExampleOperations in Digital Image Processing + Convolution by Example
Operations in Digital Image Processing + Convolution by ExampleAhmed Gad
ย 
MATLAB Code + Description : Real-Time Object Motion Detection and Tracking
MATLAB Code + Description : Real-Time Object Motion Detection and TrackingMATLAB Code + Description : Real-Time Object Motion Detection and Tracking
MATLAB Code + Description : Real-Time Object Motion Detection and TrackingAhmed Gad
ย 
MATLAB Code + Description : Very Simple Automatic English Optical Character R...
MATLAB Code + Description : Very Simple Automatic English Optical Character R...MATLAB Code + Description : Very Simple Automatic English Optical Character R...
MATLAB Code + Description : Very Simple Automatic English Optical Character R...Ahmed Gad
ย 
Graduation Project - Face Login : A Robust Face Identification System for Sec...
Graduation Project - Face Login : A Robust Face Identification System for Sec...Graduation Project - Face Login : A Robust Face Identification System for Sec...
Graduation Project - Face Login : A Robust Face Identification System for Sec...Ahmed Gad
ย 
Introduction to MATrices LABoratory (MATLAB) as Part of Digital Signal Proces...
Introduction to MATrices LABoratory (MATLAB) as Part of Digital Signal Proces...Introduction to MATrices LABoratory (MATLAB) as Part of Digital Signal Proces...
Introduction to MATrices LABoratory (MATLAB) as Part of Digital Signal Proces...Ahmed Gad
ย 

More from Ahmed Gad (20)

ICEIT'20 Cython for Speeding-up Genetic Algorithm
ICEIT'20 Cython for Speeding-up Genetic AlgorithmICEIT'20 Cython for Speeding-up Genetic Algorithm
ICEIT'20 Cython for Speeding-up Genetic Algorithm
ย 
NumPyCNNAndroid: A Library for Straightforward Implementation of Convolutiona...
NumPyCNNAndroid: A Library for Straightforward Implementation of Convolutiona...NumPyCNNAndroid: A Library for Straightforward Implementation of Convolutiona...
NumPyCNNAndroid: A Library for Straightforward Implementation of Convolutiona...
ย 
Python for Computer Vision - Revision 2nd Edition
Python for Computer Vision - Revision 2nd EditionPython for Computer Vision - Revision 2nd Edition
Python for Computer Vision - Revision 2nd Edition
ย 
Multi-Objective Optimization using Non-Dominated Sorting Genetic Algorithm wi...
Multi-Objective Optimization using Non-Dominated Sorting Genetic Algorithm wi...Multi-Objective Optimization using Non-Dominated Sorting Genetic Algorithm wi...
Multi-Objective Optimization using Non-Dominated Sorting Genetic Algorithm wi...
ย 
M.Sc. Thesis - Automatic People Counting in Crowded Scenes
M.Sc. Thesis - Automatic People Counting in Crowded ScenesM.Sc. Thesis - Automatic People Counting in Crowded Scenes
M.Sc. Thesis - Automatic People Counting in Crowded Scenes
ย 
Derivation of Convolutional Neural Network from Fully Connected Network Step-...
Derivation of Convolutional Neural Network from Fully Connected Network Step-...Derivation of Convolutional Neural Network from Fully Connected Network Step-...
Derivation of Convolutional Neural Network from Fully Connected Network Step-...
ย 
Introduction to Optimization with Genetic Algorithm (GA)
Introduction to Optimization with Genetic Algorithm (GA)Introduction to Optimization with Genetic Algorithm (GA)
Introduction to Optimization with Genetic Algorithm (GA)
ย 
Derivation of Convolutional Neural Network (ConvNet) from Fully Connected Net...
Derivation of Convolutional Neural Network (ConvNet) from Fully Connected Net...Derivation of Convolutional Neural Network (ConvNet) from Fully Connected Net...
Derivation of Convolutional Neural Network (ConvNet) from Fully Connected Net...
ย 
Avoid Overfitting with Regularization
Avoid Overfitting with RegularizationAvoid Overfitting with Regularization
Avoid Overfitting with Regularization
ย 
Genetic Algorithm (GA) Optimization - Step-by-Step Example
Genetic Algorithm (GA) Optimization - Step-by-Step ExampleGenetic Algorithm (GA) Optimization - Step-by-Step Example
Genetic Algorithm (GA) Optimization - Step-by-Step Example
ย 
ICCES 2017 - Crowd Density Estimation Method using Regression Analysis
ICCES 2017 - Crowd Density Estimation Method using Regression AnalysisICCES 2017 - Crowd Density Estimation Method using Regression Analysis
ICCES 2017 - Crowd Density Estimation Method using Regression Analysis
ย 
Backpropagation: Understanding How to Update ANNs Weights Step-by-Step
Backpropagation: Understanding How to Update ANNs Weights Step-by-StepBackpropagation: Understanding How to Update ANNs Weights Step-by-Step
Backpropagation: Understanding How to Update ANNs Weights Step-by-Step
ย 
Python for Computer Vision - Revision
Python for Computer Vision - RevisionPython for Computer Vision - Revision
Python for Computer Vision - Revision
ย 
Anime Studio Pro 10 Tutorial as Part of Multimedia Course
Anime Studio Pro 10 Tutorial as Part of Multimedia CourseAnime Studio Pro 10 Tutorial as Part of Multimedia Course
Anime Studio Pro 10 Tutorial as Part of Multimedia Course
ย 
Brief Introduction to Deep Learning + Solving XOR using ANNs
Brief Introduction to Deep Learning + Solving XOR using ANNsBrief Introduction to Deep Learning + Solving XOR using ANNs
Brief Introduction to Deep Learning + Solving XOR using ANNs
ย 
Operations in Digital Image Processing + Convolution by Example
Operations in Digital Image Processing + Convolution by ExampleOperations in Digital Image Processing + Convolution by Example
Operations in Digital Image Processing + Convolution by Example
ย 
MATLAB Code + Description : Real-Time Object Motion Detection and Tracking
MATLAB Code + Description : Real-Time Object Motion Detection and TrackingMATLAB Code + Description : Real-Time Object Motion Detection and Tracking
MATLAB Code + Description : Real-Time Object Motion Detection and Tracking
ย 
MATLAB Code + Description : Very Simple Automatic English Optical Character R...
MATLAB Code + Description : Very Simple Automatic English Optical Character R...MATLAB Code + Description : Very Simple Automatic English Optical Character R...
MATLAB Code + Description : Very Simple Automatic English Optical Character R...
ย 
Graduation Project - Face Login : A Robust Face Identification System for Sec...
Graduation Project - Face Login : A Robust Face Identification System for Sec...Graduation Project - Face Login : A Robust Face Identification System for Sec...
Graduation Project - Face Login : A Robust Face Identification System for Sec...
ย 
Introduction to MATrices LABoratory (MATLAB) as Part of Digital Signal Proces...
Introduction to MATrices LABoratory (MATLAB) as Part of Digital Signal Proces...Introduction to MATrices LABoratory (MATLAB) as Part of Digital Signal Proces...
Introduction to MATrices LABoratory (MATLAB) as Part of Digital Signal Proces...
ย 

Recently uploaded

Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
ย 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
ย 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonJericReyAuditor
ย 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
ย 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
ย 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
ย 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
ย 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
ย 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
ย 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
ย 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
ย 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
ย 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
ย 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
ย 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxAnaBeatriceAblay2
ย 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
ย 
18-04-UA_REPORT_MEDIALITERAะกY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAะกY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAะกY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAะกY_INDEX-DM_23-1-final-eng.pdfssuser54595a
ย 
call girls in Kamla Market (DELHI) ๐Ÿ” >เผ’9953330565๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
call girls in Kamla Market (DELHI) ๐Ÿ” >เผ’9953330565๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธcall girls in Kamla Market (DELHI) ๐Ÿ” >เผ’9953330565๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
call girls in Kamla Market (DELHI) ๐Ÿ” >เผ’9953330565๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ9953056974 Low Rate Call Girls In Saket, Delhi NCR
ย 

Recently uploaded (20)

Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
ย 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
ย 
Model Call Girl in Bikash Puri Delhi reach out to us at ๐Ÿ”9953056974๐Ÿ”
Model Call Girl in Bikash Puri  Delhi reach out to us at ๐Ÿ”9953056974๐Ÿ”Model Call Girl in Bikash Puri  Delhi reach out to us at ๐Ÿ”9953056974๐Ÿ”
Model Call Girl in Bikash Puri Delhi reach out to us at ๐Ÿ”9953056974๐Ÿ”
ย 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lesson
ย 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
ย 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
ย 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
ย 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
ย 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
ย 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
ย 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
ย 
Model Call Girl in Tilak Nagar Delhi reach out to us at ๐Ÿ”9953056974๐Ÿ”
Model Call Girl in Tilak Nagar Delhi reach out to us at ๐Ÿ”9953056974๐Ÿ”Model Call Girl in Tilak Nagar Delhi reach out to us at ๐Ÿ”9953056974๐Ÿ”
Model Call Girl in Tilak Nagar Delhi reach out to us at ๐Ÿ”9953056974๐Ÿ”
ย 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
ย 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
ย 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
ย 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
ย 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ย 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
ย 
18-04-UA_REPORT_MEDIALITERAะกY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAะกY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAะกY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAะกY_INDEX-DM_23-1-final-eng.pdf
ย 
call girls in Kamla Market (DELHI) ๐Ÿ” >เผ’9953330565๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
call girls in Kamla Market (DELHI) ๐Ÿ” >เผ’9953330565๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธcall girls in Kamla Market (DELHI) ๐Ÿ” >เผ’9953330565๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
call girls in Kamla Market (DELHI) ๐Ÿ” >เผ’9953330565๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
ย 

Computer Vision: Correlation, Convolution, and Gradient

  • 1. Computer Vision: Correlation, Convolution, and Gradient MENOUFIA UNIVERSITY FACULTY OF COMPUTERS AND INFORMATION INFORMATION TECHNOLOGY COMPUTER VISION โ€ซุงู„ู…ู†ูˆููŠุฉโ€ฌ โ€ซุฌุงู…ุนุฉโ€ฌ โ€ซูˆุงู„ู…ุนู„ูˆู…ุงุชโ€ฌ โ€ซุงู„ุญุงุณุจุงุชโ€ฌ โ€ซูƒู„ูŠุฉโ€ฌ โ€ซุงู„ู…ุนู„ูˆู…ุงุชโ€ฌ โ€ซุชูƒู†ูˆู„ูˆุฌูŠุงโ€ฌ โ€ซุจุงู„ุญุงุณุจโ€ฌ โ€ซุงู„ุฑุคูŠุงโ€ฌ โ€ซุงู„ู…ู†ูˆููŠุฉโ€ฌ โ€ซุฌุงู…ุนุฉโ€ฌ Ahmed Fawzy Gad ahmed.fawzy@ci.menofia.edu.eg Tuesday 3 October 2017
  • 2. Index โ€ข Correlation โ€ข Python Implementation โ€ข Convolution โ€ข Python Implementation โ€ข Gradient โ€ข Python Implementation Correlation Convolution Gradient Filtering
  • 4. Correlation for 2D Image โ€ข Correlation is used to match a template to an image. โ€ข Can you tell where the following template exactly located in the image? โ€ข Using correlation we can find the image region that best matches the template. ?
  • 5. How 2D Correlation Works? โ€ข Given a template, using correlation the template will pass through each image part and a similarity check take place to find how similar the template and the current image part being processed. โ€ข Starting by placing the template top-left corner on the top-left corner of the image, a similarity measure is calculated.
  • 6. How 2D Correlation Works? โ€ข Given a template, using correlation the template will pass through each image part and a similarity check take place to find how similar the template and the current image part being processed. โ€ข Starting by placing the template top-left corner on the top-left corner of the image, a similarity measure is calculated. ๐‘ฎ ๐’Š, ๐’‹ = ๐’–=โˆ’๐’Œ ๐’Œ ๐’—=โˆ’๐’Œ ๐’Œ ๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š + ๐’–, ๐’‹ + ๐’—]
  • 7. How 2D Correlation Works? โ€ข Given a template, using correlation the template will pass through each image part and a similarity check take place to find how similar the template and the current image part being processed. โ€ข Starting by placing the template top-left corner on the top-left corner of the image, a similarity measure is calculated.
  • 8. Correlation for 2D Image 1 3 4 3 2 7 4 1 6 2 5 2 13 6 8 9 Template โ€“ 3x3 2 1 -4 3 2 5 -1 8 1
  • 9. Correlation for 2D Image 1 3 4 3 2 7 4 1 6 2 5 2 13 6 8 9 Template โ€“ 3x3 2 1 -4 3 2 5 -1 8 1
  • 10. Correlation for 2D Image 1 3 4 3 2 7 4 1 6 2 5 2 13 6 8 9 Template โ€“ 3x3 2 โˆ— 1 + 1 โˆ— 3 โˆ’ 4 โˆ— 4 + 3 โˆ— 2 + 2 โˆ— 7 + 5 โˆ— 4 โˆ’ 1 โˆ— 6 + 8 โˆ— 2 + 1 โˆ— 5 = ๐Ÿ’๐Ÿ’
  • 11. Correlation for 2D Image 1 3 4 3 2 7 4 1 6 2 5 2 13 6 8 9 Template โ€“ 3x3 44 Did you get why template sizes are odd?
  • 12. Even Template Size 58 3 213 81 78 185 87 32 27 11 70 66 60 2 19 61 91 129 89 38 14 7 58 14 42 Even template sizes has no center. E.g. 2x3, 2x2, 5x6, โ€ฆ ๐Ÿ–๐Ÿ’ ???
  • 13. Correlation for 2D Image 1 3 4 3 2 7 4 1 6 2 5 2 13 6 8 9 Template โ€“ 3x3 2 1 -4 3 2 5 -1 8 1 44
  • 14. Correlation for 2D Image 1 3 4 3 2 7 4 1 6 2 5 2 13 6 8 9 Template โ€“ 3x3 2 โˆ— 3 + 1 โˆ— 4 โˆ’ 4 โˆ— 3 + 3 โˆ— 7 + 2 โˆ— 4 + 5 โˆ— 1 โˆ’ 1 โˆ— 2 + 8 โˆ— 5 + 1 โˆ— 2 = ๐Ÿ•๐Ÿ 44
  • 15. Correlation for 2D Image 1 3 4 3 2 7 4 1 6 2 5 2 13 6 8 9 Template โ€“ 3x3 44 72 Based on the current step, what is the region that best matches the template? It is the one corresponding to the highest score in the result matrix.
  • 16. Continue Correlating the Template 1 3 4 3 2 7 4 1 6 2 5 2 13 6 8 9 Template โ€“ 3x3 2 1 -4 3 2 5 -1 8 1 44 72
  • 17. Continue Correlating the Template 1 3 4 3 2 7 4 1 6 2 5 2 13 6 8 9 Template โ€“ 3x3 2 1 -4 3 2 5 -1 8 1 44 72 This will cause the program performing correlation to fall into index out of bounds exception.
  • 18. Padding by Zeros 1 3 4 3 2 7 4 1 6 2 5 2 13 6 8 9 Template โ€“ 3x3 44 72 0 0 0 0 It doesn`t affect multiplication. Why Zero?
  • 19. Continue Correlating the Template 1 3 4 3 2 7 4 1 6 2 5 2 13 6 8 9 Template โ€“ 3x3 44 72 0 0 0 0 2 1 -4 3 2 5 -1 8 1
  • 20. Continue Correlating the Template 1 3 4 3 2 7 4 1 6 2 5 2 13 6 8 9 Template โ€“ 3x3 44 72 0 0 0 0 2 โˆ— 4 + 1 โˆ— 3 โˆ’ 4 โˆ— 0 + 3 โˆ— 4 + 2 โˆ— 1 + 5 โˆ— 0 โˆ’ 1 โˆ— 5 + 8 โˆ— 2 + 1 โˆ— 0 = ๐Ÿ‘๐Ÿ”
  • 21. Continue Correlating the Template 1 3 4 3 2 7 4 1 6 2 5 2 13 6 8 9 Template โ€“ 3x3 44 72 36 0 0 0 0 2 โˆ— 4 + 1 โˆ— 3 โˆ’ 4 โˆ— 0 + 3 โˆ— 4 + 2 โˆ— 1 + 5 โˆ— 0 โˆ’ 1 โˆ— 5 + 8 โˆ— 2 + 1 โˆ— 0 = ๐Ÿ‘๐Ÿ”
  • 22. Continue Correlating the Template 1 3 4 3 2 7 4 1 6 2 5 2 13 6 8 9 Template โ€“ 3x3 2 1 -4 3 2 5 -1 8 1 44 72 36
  • 23. Continue Correlating the Template 1 3 4 3 2 7 4 1 6 2 5 2 13 6 8 9 Template โ€“ 3x3 2 1 -4 3 2 5 -1 8 1 44 72 36
  • 24. Pad by Zeros 1 3 4 3 2 7 4 1 6 2 5 2 13 6 8 9 Template โ€“ 3x3 44 72 36 0 0 0 0
  • 25. Continue Correlating the Template 1 3 4 3 2 7 4 1 6 2 5 2 13 6 8 9 Template โ€“ 3x3 44 72 36 0 0 0 0 2 1 -4 3 2 5 -1 8 1
  • 26. Continue Correlating the Template 1 3 4 3 2 7 4 1 6 2 5 2 13 6 8 9 Template โ€“ 3x3 44 72 36 0 0 0 0 2 โˆ— 2 + 1 โˆ— 5 โˆ’ 4 โˆ— 2 + 3 โˆ— 6 + 2 โˆ— 8 + 5 โˆ— 9 โˆ’ 1 โˆ— 0 + 8 โˆ— 0 + 1 โˆ— 0 = ๐Ÿ–๐ŸŽ
  • 27. Continue Correlating the Template 1 3 4 3 2 7 4 1 6 2 5 2 13 6 8 9 Template โ€“ 3x3 44 72 36 80 Continue till end.
  • 28. โ€ข It depends on both the template size. โ€ข For 3x3 template, pad two columns and two rows. One column to the left and another to the right. One row at the top and one row at the bottom. โ€ข For 5x5? Pad 4 rows (two left & two right) and 5 columns (two top & two bottom). โ€ข Generally, for N*N template pad (N-1)/2 columns and rows at each side. How much Padding Required? 1 3 4 3 2 7 4 1 6 2 5 2 13 6 8 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 How to do this Programmatically.?
  • 29. Implementing Correlation in Python โ€“ 3x3 Template
  • 30. Implementing Correlation in Python โ€“ 141x141 Template
  • 31. Implementing Correlation in Python โ€“ 141x141 Template
  • 32. Implementing Correlation in Python โ€“ 141x141 Template
  • 33. Implementing Correlation in Python โ€“ 141x141 Template Is this is the optimal results? No. But WHY?
  • 34. Matching using Correlation โ€ข Matching depends on just multiplication. โ€ข The highest results of multiplication is the one selected as best match. โ€ข But the highest results of multiplication not always refers to best match. Template Result
  • 35. Matching using Correlation โ€ข Make a simple edit on the image by adding a pure white rectangular area. โ€ข Use the previous template. โ€ข Apply the algorithm. Template
  • 36. Matching using Correlation โ€ข The best matched region is the white region. โ€ข The reason is that correlation depends on multiplication. โ€ข What gives highest multiplication results is the best match. โ€ข Getting high results corresponds to multiplying by higher numbers. โ€ข The highest pixel value for gray images is 255 for white.
  • 37. Implementing Correlation in Python โ€“ Generic Code โ€“ Squared Odd Sized Templates
  • 38. Implementing Correlation in Python โ€“ Generic Code โ€“ Squared Odd Sized Templates
  • 39. Implementing Correlation in Python โ€“ Generic Code โ€“ Squared Odd Sized Templates
  • 40. Implementing Correlation in Python โ€“ Generic Code โ€“ Squared Odd Sized Templates
  • 42. What is Convolution? โ€ข The primary objective of mathematical convolution is combining two signals to generate a third signal. Convolution is not limited on digital image processing and it is a broad term that works on signals. Input Signal Impulse Response Output Signal System Convolution
  • 43. Convolution Formula for 2D Digital Signal โ€ข Convolution is applied similarly to correlation. โ€ข Note how similar the formulas for correlation and convolution. The only difference is that in the signs of ๐’– and ๐’— variables. โ€ข Correlation formula has positive signs for ๐’– and ๐’— while correlation has negative signs for them. ๐‘ฎ ๐’Š, ๐’‹ = ๐’–=โˆ’๐’Œ ๐’Œ ๐’—=โˆ’๐’Œ ๐’Œ ๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š โˆ’ ๐’–, ๐’‹ โˆ’ ๐’—]๐‘ฎ ๐’Š, ๐’‹ = ๐’–=โˆ’๐’Œ ๐’Œ ๐’—=โˆ’๐’Œ ๐’Œ ๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š โˆ’ ๐’–, ๐’‹ โˆ’ ๐’—] Is just changing signs make sense?
  • 44. Correlation Vs. Convolution ๐‘ฎ ๐’Š, ๐’‹ = ๐’–=โˆ’๐’Œ ๐’Œ ๐’—=โˆ’๐’Œ ๐’Œ ๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š โˆ’ ๐’–, ๐’‹ โˆ’ ๐’—]๐‘ฎ ๐’Š, ๐’‹ = ๐’–=โˆ’๐’Œ ๐’Œ ๐’—=โˆ’๐’Œ ๐’Œ ๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š + ๐’–, ๐’‹ + ๐’—] Correlation Convolution 13204 458047 09373 .2.4.1 .5.8.3 .9.5.7 .2.4.1 .5.8.3 .9.5.7
  • 45. Correlation Vs. Convolution ๐‘ฎ ๐’Š, ๐’‹ = ๐’–=โˆ’๐’Œ ๐’Œ ๐’—=โˆ’๐’Œ ๐’Œ ๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š โˆ’ ๐’–, ๐’‹ โˆ’ ๐’—]๐‘ฎ ๐’Š, ๐’‹ = ๐’–=โˆ’๐’Œ ๐’Œ ๐’—=โˆ’๐’Œ ๐’Œ ๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š + ๐’–, ๐’‹ + ๐’—] Correlation Convolution 13204 458047 09373 .2.4.1 .5.8.3 .9.5.7 .2.4.1 .5.8.3 .9.5.7
  • 46. Correlation Vs. Convolution ๐‘ฎ ๐’Š, ๐’‹ = ๐’–=โˆ’๐’Œ ๐’Œ ๐’—=โˆ’๐’Œ ๐’Œ ๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š โˆ’ ๐’–, ๐’‹ โˆ’ ๐’—]๐‘ฎ ๐’Š, ๐’‹ = ๐’–=โˆ’๐’Œ ๐’Œ ๐’—=โˆ’๐’Œ ๐’Œ ๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š + ๐’–, ๐’‹ + ๐’—] Correlation Convolution 13204 458047 09373 .2.4.1 .5.8.3 .9.5.7 .2.4.1 .5.8.3 .9.5.7
  • 47. Correlation Vs. Convolution ๐‘ฎ ๐’Š, ๐’‹ = ๐’–=โˆ’๐’Œ ๐’Œ ๐’—=โˆ’๐’Œ ๐’Œ ๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š โˆ’ ๐’–, ๐’‹ โˆ’ ๐’—]๐‘ฎ ๐’Š, ๐’‹ = ๐’–=โˆ’๐’Œ ๐’Œ ๐’—=โˆ’๐’Œ ๐’Œ ๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š + ๐’–, ๐’‹ + ๐’—] Correlation Convolution 13204 458047 09373 .2.4.1 .5.8.3 .9.5.7 .2.4.1 .5.8.3 .9.5.7
  • 48. Correlation Vs. Convolution ๐‘ฎ ๐’Š, ๐’‹ = ๐’–=โˆ’๐’Œ ๐’Œ ๐’—=โˆ’๐’Œ ๐’Œ ๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š โˆ’ ๐’–, ๐’‹ โˆ’ ๐’—]๐‘ฎ ๐’Š, ๐’‹ = ๐’–=โˆ’๐’Œ ๐’Œ ๐’—=โˆ’๐’Œ ๐’Œ ๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š + ๐’–, ๐’‹ + ๐’—] Correlation Convolution 13204 458047 09373 .2.4.1 .5.8.3 .9.5.7 .2.4.1 .5.8.3 .9.5.7
  • 49. Correlation Vs. Convolution ๐‘ฎ ๐’Š, ๐’‹ = ๐’–=โˆ’๐’Œ ๐’Œ ๐’—=โˆ’๐’Œ ๐’Œ ๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š โˆ’ ๐’–, ๐’‹ โˆ’ ๐’—]๐‘ฎ ๐’Š, ๐’‹ = ๐’–=โˆ’๐’Œ ๐’Œ ๐’—=โˆ’๐’Œ ๐’Œ ๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š + ๐’–, ๐’‹ + ๐’—] Correlation Convolution 13204 458047 09373 .2.4.1 .5.8.3 .9.5.7 .2.4.1 .5.8.3 .9.5.7
  • 50. Correlation Vs. Convolution ๐‘ฎ ๐’Š, ๐’‹ = ๐’–=โˆ’๐’Œ ๐’Œ ๐’—=โˆ’๐’Œ ๐’Œ ๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š โˆ’ ๐’–, ๐’‹ โˆ’ ๐’—]๐‘ฎ ๐’Š, ๐’‹ = ๐’–=โˆ’๐’Œ ๐’Œ ๐’—=โˆ’๐’Œ ๐’Œ ๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š + ๐’–, ๐’‹ + ๐’—] Correlation Convolution 13204 458047 09373 .2.4.1 .5.8.3 .9.5.7 .2.4.1 .5.8.3 .9.5.7
  • 51. Correlation Vs. Convolution ๐‘ฎ ๐’Š, ๐’‹ = ๐’–=โˆ’๐’Œ ๐’Œ ๐’—=โˆ’๐’Œ ๐’Œ ๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š โˆ’ ๐’–, ๐’‹ โˆ’ ๐’—]๐‘ฎ ๐’Š, ๐’‹ = ๐’–=โˆ’๐’Œ ๐’Œ ๐’—=โˆ’๐’Œ ๐’Œ ๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š + ๐’–, ๐’‹ + ๐’—] Correlation Convolution 13204 458047 09373 .2.4.1 .5.8.3 .9.5.7 .2.4.1 .5.8.3 .9.5.7
  • 52. Correlation Vs. Convolution ๐‘ฎ ๐’Š, ๐’‹ = ๐’–=โˆ’๐’Œ ๐’Œ ๐’—=โˆ’๐’Œ ๐’Œ ๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š โˆ’ ๐’–, ๐’‹ โˆ’ ๐’—]๐‘ฎ ๐’Š, ๐’‹ = ๐’–=โˆ’๐’Œ ๐’Œ ๐’—=โˆ’๐’Œ ๐’Œ ๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š + ๐’–, ๐’‹ + ๐’—] Correlation Convolution 13204 458047 09373 .2.4.1 .5.8.3 .9.5.7 .2.4.1 .5.8.3 .9.5.7
  • 53. Correlation Vs. Convolution ๐‘ฎ ๐’Š, ๐’‹ = ๐’–=โˆ’๐’Œ ๐’Œ ๐’—=โˆ’๐’Œ ๐’Œ ๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š โˆ’ ๐’–, ๐’‹ โˆ’ ๐’—]๐‘ฎ ๐’Š, ๐’‹ = ๐’–=โˆ’๐’Œ ๐’Œ ๐’—=โˆ’๐’Œ ๐’Œ ๐’‰ ๐’–, ๐’— ๐‘ญ[๐’Š + ๐’–, ๐’‹ + ๐’—] Correlation Convolution 13204 458047 09373 .2.4.1 .5.8.3 .9.5.7 .2.4.1 .5.8.3 .9.5.7 -1, 1-1, 0-1, -1 0, 10, 00, -1 1, 11, 01, -1 1, -11, 01, 1 0, -10, 00, 1 -1, -1-1, 0-1, 1 How to simplify convolution?
  • 54. Simplifying Convolution .2.4.1 .5.8.3 .9.5.7 1, -11, 01, 1 0, -10, 00, 1 -1, -1-1, 0-1, 1 * 13204 458047 09373 .7.5.9 .3.8.5 .1.4.2 13204 458047 09373= -1, 1-1, 0-1, -1 0, 10, 00, -1 1, 11, 01, -1 Just rotate the template with 180 degrees before multiplying by the image. * Applying convolution is similar to correlation except for flipping the template before multiplication.
  • 55. Two Many Multiplications & Additions โ€ข Assume to remove noise from an image, it should be applied to two filters (filter1 and filter2). Each filter has size of 7x7 pixels and the image is of size 1024x1024 pixels. โ€ข A simple approach is to apply filter1 to the image then apply filter2 to the output of filter1. โ€ข Too many multiplications and additions due to applying two filters on the image. 1,024 x 1,024 x 49 multiplication and 1,000 x 1,000 x 49 addition for the single filter. 1024x1024 Image Filter1 * Temp. Result Filter2 * Result
  • 56. Convolution Associative Property โ€ข Using the associative property of convolution, we can reduce the number of multiplications and additions. โ€ข To apply two filters f1 and f2 over an image, we can merge the two filters together then apply the convolution between the resultant new filter and the image. โ€ข Finally, there is only 1,024 x 1024 x 49 multiplication and addition. (Im * ๐’‡ ๐Ÿ) * ๐’‡ ๐Ÿ = Im * (๐’‡ ๐Ÿ * ๐’‡ ๐Ÿ) For ๐’‡ ๐Ÿ * ๐’‡ ๐Ÿ = ๐’‡ ๐Ÿ‘ Result is Im * ๐’‡ ๐Ÿ‘
  • 57. Convolution Applications โ€ข Convolution is used to merge signals. โ€ข It is used to apply operations like smoothing and filtering images where the primary task is selecting the appropriate filter template or mask. โ€ข Convolution can also be used to find gradients of the image.
  • 58. Implementing Convolution in Python โ€ข The implementation of convolution is identical to correlation except for the new command that rotates the template.
  • 60. Image Gradients โ€ข Image gradients can be defined as change of intensity in some direction. โ€ข Based on the way gradients were calculated and specifically based on the template/kernel used, gradients can be horizontal (X direction) or vertical (Y direction) in direction. -1-1-1 000 111 Horizontal 10-1 10-1 10-1 Vertical ฮธ = ๐‘ก๐‘Ž๐‘›โˆ’1 [ ๐บ ๐‘ฆ ๐บ ๐‘ฅ ] ๐บ = ๐บ ๐‘ฅ + ๐บ ๐‘ฆ
  • 61. Image Gradient Calculation Steps โ€ข Calculate the image gradient in X direction at each pixel. โ€ข Calculate the image gradient in Y direction at each pixel. โ€ข Calculate the overall gradient for the pixel.
  • 67. Example โ€“ Mean Filter โ€ขMean Filter Kernel. ๐Ÿ ๐Ÿ— ๐Ÿ ๐Ÿ— ๐Ÿ ๐Ÿ— ๐Ÿ ๐Ÿ— ๐Ÿ ๐Ÿ— ๐Ÿ ๐Ÿ— ๐Ÿ ๐Ÿ— ๐Ÿ ๐Ÿ— ๐Ÿ ๐Ÿ— 58 3 213 81 78 185 87 32 27 11 70 66 60 2 19 61 91 129 89 38 14 7 58 14 42 ๐Ÿ ๐Ÿ— โˆ— 58 + ๐Ÿ ๐Ÿ— โˆ— 3 + ๐Ÿ ๐Ÿ— โˆ— 213 + ๐Ÿ ๐Ÿ— โˆ— 185 + ๐Ÿ ๐Ÿ— โˆ— 87 + ๐Ÿ ๐Ÿ— โˆ— 32 + ๐Ÿ ๐Ÿ— โˆ— 70 + ๐Ÿ ๐Ÿ— โˆ— 66 + ๐Ÿ ๐Ÿ— โˆ— 60 = 85.67 ~ 86 Implement in Python (Deadline next week starting @ 7 Oct. 2017). 1. Mean Smoothing Filter 2. Gaussian Smoothing Filter 3. Sharpening Filter 4. Median Filter