SlideShare a Scribd company logo
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

SPATIAL FILTERING IN IMAGE PROCESSING
SPATIAL FILTERING IN IMAGE PROCESSINGSPATIAL FILTERING IN IMAGE PROCESSING
SPATIAL FILTERING IN IMAGE PROCESSING
muthu181188
 
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
Ahmed Gad
 
Region based segmentation
Region based segmentationRegion based segmentation
Region based segmentation
Inamul Hossain Imran
 
03 digital image fundamentals DIP
03 digital image fundamentals DIP03 digital image fundamentals DIP
03 digital image fundamentals DIP
babak danyal
 
Data Redundacy
Data RedundacyData Redundacy
Data Redundacy
Poonam Seth
 
Introduction to Image Compression
Introduction to Image CompressionIntroduction to Image Compression
Introduction to Image Compression
Kalyan Acharjya
 
Chapter10 image segmentation
Chapter10 image segmentationChapter10 image segmentation
Chapter10 image segmentation
asodariyabhavesh
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
Md Shabir Alam
 
Image Restoration (Order Statistics Filters)
Image Restoration (Order Statistics Filters)Image Restoration (Order Statistics Filters)
Image Restoration (Order Statistics Filters)
Kalyan Acharjya
 
Basics of pixel neighbor.
Basics of pixel neighbor.Basics of pixel neighbor.
Basics of pixel neighbor.
raheel rajput
 
Spatial domain and filtering
Spatial domain and filteringSpatial domain and filtering
Spatial domain and filtering
University of Potsdam
 
Frequency domain methods
Frequency domain methods Frequency domain methods
Frequency domain methods
thanhhoang2012
 
Hit and-miss transform
Hit and-miss transformHit and-miss transform
Hit and-miss transform
Krish Everglades
 
Sharpening using frequency Domain Filter
Sharpening using frequency Domain FilterSharpening using frequency Domain Filter
Sharpening using frequency Domain Filter
arulraj121
 
Bit plane slicing
Bit plane slicingBit plane slicing
Bit plane slicing
Asad Ali
 
Convolution&Correlation
Convolution&CorrelationConvolution&Correlation
Convolution&Correlation
VenkateshPrasadV1
 
Image filtering in Digital image processing
Image filtering in Digital image processingImage filtering in Digital image processing
Image filtering in Digital image processing
Abinaya B
 

What's hot (20)

SPATIAL FILTERING IN IMAGE PROCESSING
SPATIAL FILTERING IN IMAGE PROCESSINGSPATIAL FILTERING IN IMAGE PROCESSING
SPATIAL FILTERING IN IMAGE PROCESSING
 
SPATIAL FILTER
SPATIAL FILTERSPATIAL FILTER
SPATIAL FILTER
 
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
 
Region based segmentation
Region based segmentationRegion based segmentation
Region based segmentation
 
03 digital image fundamentals DIP
03 digital image fundamentals DIP03 digital image fundamentals DIP
03 digital image fundamentals DIP
 
Data Redundacy
Data RedundacyData Redundacy
Data Redundacy
 
Introduction to Image Compression
Introduction to Image CompressionIntroduction to Image Compression
Introduction to Image Compression
 
Chapter10 image segmentation
Chapter10 image segmentationChapter10 image segmentation
Chapter10 image segmentation
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Image Restoration (Order Statistics Filters)
Image Restoration (Order Statistics Filters)Image Restoration (Order Statistics Filters)
Image Restoration (Order Statistics Filters)
 
Basics of pixel neighbor.
Basics of pixel neighbor.Basics of pixel neighbor.
Basics of pixel neighbor.
 
Spatial domain and filtering
Spatial domain and filteringSpatial domain and filtering
Spatial domain and filtering
 
Frequency domain methods
Frequency domain methods Frequency domain methods
Frequency domain methods
 
image compression ppt
image compression pptimage compression ppt
image compression ppt
 
Hit and-miss transform
Hit and-miss transformHit and-miss transform
Hit and-miss transform
 
Sharpening using frequency Domain Filter
Sharpening using frequency Domain FilterSharpening using frequency Domain Filter
Sharpening using frequency Domain Filter
 
Bit plane slicing
Bit plane slicingBit plane slicing
Bit plane slicing
 
Convolution&Correlation
Convolution&CorrelationConvolution&Correlation
Convolution&Correlation
 
Ray tracing
 Ray tracing Ray tracing
Ray tracing
 
Image filtering in Digital image processing
Image filtering in Digital image processingImage filtering in Digital image processing
Image filtering in Digital image processing
 

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.pptx
ssuser01e301
 
MLU_DTE_Lecture_2.pptx
MLU_DTE_Lecture_2.pptxMLU_DTE_Lecture_2.pptx
MLU_DTE_Lecture_2.pptx
RahulChaudhry15
 
Global and local alignment (bioinformatics)
Global and local alignment (bioinformatics)Global and local alignment (bioinformatics)
Global and local alignment (bioinformatics)
Pritom Chaki
 
Curvefitting
CurvefittingCurvefitting
Curvefitting
Philberto Saroni
 
MACHINE LEARNING.pptx
MACHINE LEARNING.pptxMACHINE LEARNING.pptx
MACHINE LEARNING.pptx
SOURAVGHOSH623569
 
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
ahmet 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 .docx
justine1simpson78276
 
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.2
wzuri
 
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 #2
Seung-gyu Byeon
 
Lecture-1-Algorithms.pptx
Lecture-1-Algorithms.pptxLecture-1-Algorithms.pptx
Lecture-1-Algorithms.pptx
xalahama3
 
Biological sequences analysis
Biological sequences analysisBiological sequences analysis
Biological sequences analysis
Davide Andrea Guastella
 
9A Two-Dimensional Geometry
9A Two-Dimensional Geometry9A Two-Dimensional Geometry
9A Two-Dimensional Geometry
Kayla Smith
 
CP1-Chp6-Matrices (2).pptx used for revision
CP1-Chp6-Matrices (2).pptx used for revisionCP1-Chp6-Matrices (2).pptx used for revision
CP1-Chp6-Matrices (2).pptx used for revision
rachaelgiwa11
 
Inequalities
InequalitiesInequalities
Inequalities
Kathy Favazza
 
cat-quant-cheat-sheet
 cat-quant-cheat-sheet cat-quant-cheat-sheet
cat-quant-cheat-sheettechonomics1
 
Cat Quant Cheat Sheet
Cat Quant Cheat SheetCat Quant Cheat Sheet
Cat Quant Cheat Sheet
versabit technologies
 
"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
KyuhanLee4
 

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
 
CP1-Chp6-Matrices (2).pptx used for revision
CP1-Chp6-Matrices (2).pptx used for revisionCP1-Chp6-Matrices (2).pptx used for revision
CP1-Chp6-Matrices (2).pptx used for revision
 
Inequalities
InequalitiesInequalities
Inequalities
 
cat-quant-cheat-sheet
 cat-quant-cheat-sheet cat-quant-cheat-sheet
cat-quant-cheat-sheet
 
Cat Quant Cheat Sheet
Cat Quant Cheat SheetCat 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
 

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 Algorithm
Ahmed 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 Edition
Ahmed 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 Scenes
Ahmed 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 Regularization
Ahmed 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 Example
Ahmed 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 Analysis
Ahmed 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-Step
Ahmed Gad
 
Python for Computer Vision - Revision
Python for Computer Vision - RevisionPython for Computer Vision - Revision
Python for Computer Vision - Revision
Ahmed 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 Course
Ahmed 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 ANNs
Ahmed 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 Tracking
Ahmed 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
 
Introduction to Digital Signal Processing (DSP) - Course Notes
Introduction to Digital Signal Processing (DSP) - Course NotesIntroduction to Digital Signal Processing (DSP) - Course Notes
Introduction to Digital Signal Processing (DSP) - Course Notes
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
 
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...
 
Introduction to Digital Signal Processing (DSP) - Course Notes
Introduction to Digital Signal Processing (DSP) - Course NotesIntroduction to Digital Signal Processing (DSP) - Course Notes
Introduction to Digital Signal Processing (DSP) - Course Notes
 

Recently uploaded

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
PedroFerreira53928
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
Fundacja Rozwoju Społeczeństwa Przedsiębiorczego
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 

Recently uploaded (20)

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 

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