SlideShare a Scribd company logo
Practical 5 - Digital Image
Processing
Aly Osama
‫اﻟﻣﺗﻧﺑﻰ‬
Stages of Computer Vision
Agenda
1. Stereo Images
2. Optical Flow
3. Machine Learning
a. Classification ( KNN - SVM )
b. Clustering ( K-means )
4. Practical Demo
5. Project
6. Assignment
7. AI Companies
Stereo Vision
Depth Map from Stereo Images
https://www.youtube.com/watch?v=O7B2vCsTpC0
Stereo Vision Idea
The diagram contains equivalent triangles. Writing their
equivalent equations will yield us following result:
x and x′ are the distance between points in image plane corresponding
to the scene point 3D and their camera center. B is the distance
between two cameras (which we know) and f is the focal length of
camera (already known).
above equation says that the depth of a point in a scene is
inversely proportional to the difference in distance of
corresponding image points and their camera centers. So
with this information, we can derive the depth of all pixels
in an image.
Depth Map from Stereo Images
Optical Flow
Optical Flow
Optical flow is the pattern of apparent motion of
image objects between two consecutive frames
caused by the movement of object or camera. It is
2D vector field where each vector is a displacement
vector showing the movement of points from first
frame to second.
Optical flow works on several assumptions:
1. The pixel intensities of an object do not change
between consecutive frames.
2. Neighbouring pixels have similar motion.
Consider a pixel I(x,y,t) in first frame It moves by distance (dx,dy) in next frame taken after
dt time. So since those pixels are the same and intensity does not change, we can say,
I(x,y,t)=I(x+dx,y+dy,t+dt)
Then take taylor series approximation:
fx u+fy v+ft=0
where:
fx=∂f/∂x ; fy=∂f/∂y
u=dx/dt ; v=dy/dt
Above equation is called Optical Flow equation. In it, we can find fx and fy, they are image
gradients. Similarly ft is the gradient along time.
But we cannot get u and v from one equation?!
Optical Flow Equations
Lucas-Kanade Method
Lucas-Kanade method takes a 3x3 patch around the point. So all the 9 points
have the same motion. We can find (fx,fy,ft) for these 9 points.
So now our problem becomes solving 9 equations with two unknown variables
which is over-determined.
using least square fit method.
Lucas-Kanade Optical flow in OpenCV
Step 1: Get features points
Step 2: Track extracted features points using Optical flow
Dense Optical flow in OpenCV
Machine Learning
Machine Learning vs Deep Learning
Classification vs Clustering
Some Machine learning algorithms
1. Classification
a. KNN
b. SVM
2. Clustering
a. K-means
b. DBscan
Classification ( KNN - SVM )
Understanding
KNN
Understanding K-Nearest Neighbour
kNN is one of the simplest of classification algorithms available for supervised
learning. The idea is to search for closest match of the test data in feature space.
KNN -> Human Classifier
KNN in OpenCV
Understanding
SVM
Linearly Separable Data
Considering the data given in image, or consider that
We find a line, which divides both
the data to two regions. When we get a new test_data
X just substitute it in f(x).if f(x) > 0 it belongs to blue
group, else it belongs to red group. We can call this
line as Decision Boundary. It is very simple and
memory-efficient. Such data which can be divided
into two with a straight line (or hyperplanes in
higher dimensions) is called Linear Separable.
Linearly Separable Data
So to find this Decision Boundary, you need training
data. Do you need all? NO. Just the ones which are
close to the opposite group are sufficient. In our
image, they are the one blue filled circle and two red
filled squares. We can call them Support Vectors and
the lines passing through them are called Support
Planes. They are adequate for finding our decision
boundary. We need not worry about all the data. It
helps in data reduction.
Clustering ( K-means )
T-Shirt Size
Problem
Consider a company, which is going to release a new model of T-shirt to market.
Obviously they will have to manufacture models in different sizes to satisfy
people of all sizes. So the company make a data of people’s height and weight,
and plot them on to a graph, as below:
Company can’t create t-shirts with all the sizes. Instead, they divide people to
Small, Medium and Large, and manufacture only these 3 models which will fit
into all the people. This grouping of people into three groups can be done by
k-means clustering, and algorithm provides us best 3 sizes, which will satisfy all
the people. And if it doesn’t, company can divide people to more groups, may be
five, and so on. Check image below :
How does it work?
Consider a set of data as below ( You can consider it as t-shirt problem). We need
to cluster this data into two groups.
Step : 1 - Algorithm randomly chooses two
centroids, C1, C2 (sometimes, any two data are
taken as the centroids).
Step : 2 - It calculates the distance from each
point to both centroids. If a test data is more
closer to C1 then that data is labelled with ‘0’. If it
is closer to C2.then labelled as ‘1’ (If more
centroids are there, labelled as ‘2’,‘3’ etc). In our
case, we will color all ‘0’ labelled with red, and ‘1’
labelled with blue. So we get following image after
above operations
Step : 3 - Next we calculate the average of all blue
points and red points separately and that will be
our new centroids. That is C1 and C2 shift to
newly calculated centroids. (Remember, the
images shown are not true values and not to true
scale, it is just for demonstration only). And again,
perform step 2 with new centroids and label data
to ‘0’ and ‘1’.
Now Step - 2 and Step - 3 are iterated until both
centroids are converged to fixed points. (Or it may
be stopped depending on the criteria we provide, like
maximum number of iterations, or a specific
accuracy is reached etc.) These points are such
that sum of distances between test data and their
corresponding centroids are minimum. Or
simply, sum of distances between
Practical Demo
Face Detection using Haar Cascades
https://pythonprogramming.net/haar-c
ascade-face-eye-detection-python-ope
ncv-tutorial/
Beyond Image Processing
Deep Neural Networks
http://cs231n.stanford.edu/
Project
Project
● Deadline: 30th April.
● Submission Form: https://goo.gl/forms/hdmELnD8qmOxVVVh2
a. Demo video on Facebook or Youtube
b. Project source code on github
Assignment
The last assignment ever ( So far )
1. Update your C.V. , Linkedin and Wuzzuf with your projects and assignments
2. Make a list of companies you want to work for and rank them based on your
interest
3. Start to send emails with your C.V. to their HR and their employees (SPAM
their Inbox)
4. Don’t worry “‫رزق‬ ‫”اﻟﻌﻤﻞ‬
AI driven companies in Egypt
(60 Companies)
https://my-interviews-experience-in-egypt.quora.com/AI-Driven-Companies-in-Egypt
Thank you and Good Luck

More Related Content

What's hot

Edge Detection using Hough Transform
Edge Detection using Hough TransformEdge Detection using Hough Transform
Edge Detection using Hough Transform
Mrunal Selokar
 
FEATURE EXTRACTION USING SURF ALGORITHM FOR OBJECT RECOGNITION
FEATURE EXTRACTION USING SURF ALGORITHM FOR OBJECT RECOGNITIONFEATURE EXTRACTION USING SURF ALGORITHM FOR OBJECT RECOGNITION
FEATURE EXTRACTION USING SURF ALGORITHM FOR OBJECT RECOGNITION
International Journal of Technical Research & Application
 
Edge Detection Using Fuzzy Logic
Edge Detection Using Fuzzy LogicEdge Detection Using Fuzzy Logic
Edge Detection Using Fuzzy Logic
IJERA Editor
 
02_atiqa ijaz khan_05_2014
02_atiqa ijaz khan_05_201402_atiqa ijaz khan_05_2014
02_atiqa ijaz khan_05_2014
Atiqa khan
 
Hybrid Technique for Copy-Move Forgery Detection Using L*A*B* Color Space
Hybrid Technique for Copy-Move Forgery Detection Using L*A*B* Color Space Hybrid Technique for Copy-Move Forgery Detection Using L*A*B* Color Space
Hybrid Technique for Copy-Move Forgery Detection Using L*A*B* Color Space
IJEEE
 
Fuzzy Logic Based Edge Detection
Fuzzy Logic Based Edge DetectionFuzzy Logic Based Edge Detection
Fuzzy Logic Based Edge Detection
Dawn Raider Gupta
 
Hit and-miss transform
Hit and-miss transformHit and-miss transform
Hit and-miss transform
Krish Everglades
 
Local binary pattern
Local binary patternLocal binary pattern
Local binary pattern
International Islamic University
 
Image feature extraction
Image feature extractionImage feature extraction
Image feature extraction
Rishabh shah
 
Visual realism
Visual realismVisual realism
Visual realism
Patel Punit
 
Point Cloud Segmentation for 3D Reconstruction
Point Cloud Segmentation for 3D ReconstructionPoint Cloud Segmentation for 3D Reconstruction
Point Cloud Segmentation for 3D Reconstruction
Pirouz Nourian
 
Chapter 9 morphological image processing
Chapter 9 morphological image processingChapter 9 morphological image processing
Chapter 9 morphological image processing
asodariyabhavesh
 
Color vs texture feature extraction and matching in visual content retrieval ...
Color vs texture feature extraction and matching in visual content retrieval ...Color vs texture feature extraction and matching in visual content retrieval ...
Color vs texture feature extraction and matching in visual content retrieval ...
IAEME Publication
 
Hough Transform By Md.Nazmul Islam
Hough Transform By Md.Nazmul IslamHough Transform By Md.Nazmul Islam
Hough Transform By Md.Nazmul Islam
Nazmul Islam
 
3D Graphics
3D Graphics3D Graphics
3D GraphicsViTAly
 
Study and Comparison of Various Image Edge Detection Techniques
Study and Comparison of Various Image Edge Detection TechniquesStudy and Comparison of Various Image Edge Detection Techniques
Study and Comparison of Various Image Edge Detection Techniques
CSCJournals
 
Morphology in graphics and image processing
Morphology in graphics and image processingMorphology in graphics and image processing
Morphology in graphics and image processing
Dheeban Smart
 
Camshaft
CamshaftCamshaft
Camshaft
Ahmed Tememe
 
Performance analysis of chain code descriptor for hand shape classification
Performance analysis of chain code descriptor for hand shape classificationPerformance analysis of chain code descriptor for hand shape classification
Performance analysis of chain code descriptor for hand shape classification
ijcga
 

What's hot (20)

Edge Detection using Hough Transform
Edge Detection using Hough TransformEdge Detection using Hough Transform
Edge Detection using Hough Transform
 
FEATURE EXTRACTION USING SURF ALGORITHM FOR OBJECT RECOGNITION
FEATURE EXTRACTION USING SURF ALGORITHM FOR OBJECT RECOGNITIONFEATURE EXTRACTION USING SURF ALGORITHM FOR OBJECT RECOGNITION
FEATURE EXTRACTION USING SURF ALGORITHM FOR OBJECT RECOGNITION
 
Edge Detection Using Fuzzy Logic
Edge Detection Using Fuzzy LogicEdge Detection Using Fuzzy Logic
Edge Detection Using Fuzzy Logic
 
02_atiqa ijaz khan_05_2014
02_atiqa ijaz khan_05_201402_atiqa ijaz khan_05_2014
02_atiqa ijaz khan_05_2014
 
Hybrid Technique for Copy-Move Forgery Detection Using L*A*B* Color Space
Hybrid Technique for Copy-Move Forgery Detection Using L*A*B* Color Space Hybrid Technique for Copy-Move Forgery Detection Using L*A*B* Color Space
Hybrid Technique for Copy-Move Forgery Detection Using L*A*B* Color Space
 
Fuzzy Logic Based Edge Detection
Fuzzy Logic Based Edge DetectionFuzzy Logic Based Edge Detection
Fuzzy Logic Based Edge Detection
 
Hit and-miss transform
Hit and-miss transformHit and-miss transform
Hit and-miss transform
 
Local binary pattern
Local binary patternLocal binary pattern
Local binary pattern
 
Image feature extraction
Image feature extractionImage feature extraction
Image feature extraction
 
Visual realism
Visual realismVisual realism
Visual realism
 
Point Cloud Segmentation for 3D Reconstruction
Point Cloud Segmentation for 3D ReconstructionPoint Cloud Segmentation for 3D Reconstruction
Point Cloud Segmentation for 3D Reconstruction
 
Chapter 9 morphological image processing
Chapter 9 morphological image processingChapter 9 morphological image processing
Chapter 9 morphological image processing
 
Color vs texture feature extraction and matching in visual content retrieval ...
Color vs texture feature extraction and matching in visual content retrieval ...Color vs texture feature extraction and matching in visual content retrieval ...
Color vs texture feature extraction and matching in visual content retrieval ...
 
Hough Transform By Md.Nazmul Islam
Hough Transform By Md.Nazmul IslamHough Transform By Md.Nazmul Islam
Hough Transform By Md.Nazmul Islam
 
3 d
3 d3 d
3 d
 
3D Graphics
3D Graphics3D Graphics
3D Graphics
 
Study and Comparison of Various Image Edge Detection Techniques
Study and Comparison of Various Image Edge Detection TechniquesStudy and Comparison of Various Image Edge Detection Techniques
Study and Comparison of Various Image Edge Detection Techniques
 
Morphology in graphics and image processing
Morphology in graphics and image processingMorphology in graphics and image processing
Morphology in graphics and image processing
 
Camshaft
CamshaftCamshaft
Camshaft
 
Performance analysis of chain code descriptor for hand shape classification
Performance analysis of chain code descriptor for hand shape classificationPerformance analysis of chain code descriptor for hand shape classification
Performance analysis of chain code descriptor for hand shape classification
 

Similar to Practical Digital Image Processing 5

Simple Pendulum Experiment and Automatic Survey Grading using Computer Vision
Simple Pendulum Experiment and Automatic Survey Grading using Computer VisionSimple Pendulum Experiment and Automatic Survey Grading using Computer Vision
Simple Pendulum Experiment and Automatic Survey Grading using Computer VisionAnish Patel
 
SVM & KNN Presentation.pptx
SVM & KNN Presentation.pptxSVM & KNN Presentation.pptx
SVM & KNN Presentation.pptx
MohamedMonir33
 
Image Interpolation Techniques with Optical and Digital Zoom Concepts -semina...
Image Interpolation Techniques with Optical and Digital Zoom Concepts -semina...Image Interpolation Techniques with Optical and Digital Zoom Concepts -semina...
Image Interpolation Techniques with Optical and Digital Zoom Concepts -semina...
mmjalbiaty
 
Log polar coordinates
Log polar coordinatesLog polar coordinates
Log polar coordinates
Oğul Göçmen
 
Unit II & III_uncovered topics.doc notes
Unit II & III_uncovered topics.doc notesUnit II & III_uncovered topics.doc notes
Unit II & III_uncovered topics.doc notes
smithashetty24
 
3D Reconstruction from Multiple uncalibrated 2D Images of an Object
3D Reconstruction from Multiple uncalibrated 2D Images of an Object3D Reconstruction from Multiple uncalibrated 2D Images of an Object
3D Reconstruction from Multiple uncalibrated 2D Images of an Object
Ankur Tyagi
 
Introduction to Machine Vision
Introduction to Machine VisionIntroduction to Machine Vision
Introduction to Machine VisionNasir Jumani
 
Advance image processing
Advance image processingAdvance image processing
Advance image processing
AAKANKSHA JAIN
 
One dimensional vector based pattern
One dimensional vector based patternOne dimensional vector based pattern
One dimensional vector based pattern
ijcsit
 
A STUDY AND ANALYSIS OF DIFFERENT EDGE DETECTION TECHNIQUES
A STUDY AND ANALYSIS OF DIFFERENT EDGE DETECTION TECHNIQUESA STUDY AND ANALYSIS OF DIFFERENT EDGE DETECTION TECHNIQUES
A STUDY AND ANALYSIS OF DIFFERENT EDGE DETECTION TECHNIQUES
cscpconf
 
A COMPARATIVE ANALYSIS OF RETRIEVAL TECHNIQUES IN CONTENT BASED IMAGE RETRIEVAL
A COMPARATIVE ANALYSIS OF RETRIEVAL TECHNIQUES IN CONTENT BASED IMAGE RETRIEVALA COMPARATIVE ANALYSIS OF RETRIEVAL TECHNIQUES IN CONTENT BASED IMAGE RETRIEVAL
A COMPARATIVE ANALYSIS OF RETRIEVAL TECHNIQUES IN CONTENT BASED IMAGE RETRIEVAL
cscpconf
 
A comparative analysis of retrieval techniques in content based image retrieval
A comparative analysis of retrieval techniques in content based image retrievalA comparative analysis of retrieval techniques in content based image retrieval
A comparative analysis of retrieval techniques in content based image retrieval
csandit
 
Introducing New Parameters to Compare the Accuracy and Reliability of Mean-Sh...
Introducing New Parameters to Compare the Accuracy and Reliability of Mean-Sh...Introducing New Parameters to Compare the Accuracy and Reliability of Mean-Sh...
Introducing New Parameters to Compare the Accuracy and Reliability of Mean-Sh...
sipij
 
Performance Improvement of Vector Quantization with Bit-parallelism Hardware
Performance Improvement of Vector Quantization with Bit-parallelism HardwarePerformance Improvement of Vector Quantization with Bit-parallelism Hardware
Performance Improvement of Vector Quantization with Bit-parallelism Hardware
CSCJournals
 
BMVA summer school MATLAB programming tutorial
BMVA summer school MATLAB programming tutorialBMVA summer school MATLAB programming tutorial
BMVA summer school MATLAB programming tutorial
potaters
 
Automatic Classification Satellite images for weather Monitoring
Automatic Classification Satellite images for weather MonitoringAutomatic Classification Satellite images for weather Monitoring
Automatic Classification Satellite images for weather Monitoring
guest7782414
 
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
Simplilearn
 

Similar to Practical Digital Image Processing 5 (20)

Simple Pendulum Experiment and Automatic Survey Grading using Computer Vision
Simple Pendulum Experiment and Automatic Survey Grading using Computer VisionSimple Pendulum Experiment and Automatic Survey Grading using Computer Vision
Simple Pendulum Experiment and Automatic Survey Grading using Computer Vision
 
SVM & KNN Presentation.pptx
SVM & KNN Presentation.pptxSVM & KNN Presentation.pptx
SVM & KNN Presentation.pptx
 
Image Interpolation Techniques with Optical and Digital Zoom Concepts -semina...
Image Interpolation Techniques with Optical and Digital Zoom Concepts -semina...Image Interpolation Techniques with Optical and Digital Zoom Concepts -semina...
Image Interpolation Techniques with Optical and Digital Zoom Concepts -semina...
 
Log polar coordinates
Log polar coordinatesLog polar coordinates
Log polar coordinates
 
Unit II & III_uncovered topics.doc notes
Unit II & III_uncovered topics.doc notesUnit II & III_uncovered topics.doc notes
Unit II & III_uncovered topics.doc notes
 
3D Reconstruction from Multiple uncalibrated 2D Images of an Object
3D Reconstruction from Multiple uncalibrated 2D Images of an Object3D Reconstruction from Multiple uncalibrated 2D Images of an Object
3D Reconstruction from Multiple uncalibrated 2D Images of an Object
 
Digital.cc
Digital.ccDigital.cc
Digital.cc
 
mini prjt
mini prjtmini prjt
mini prjt
 
Introduction to Machine Vision
Introduction to Machine VisionIntroduction to Machine Vision
Introduction to Machine Vision
 
Advance image processing
Advance image processingAdvance image processing
Advance image processing
 
One dimensional vector based pattern
One dimensional vector based patternOne dimensional vector based pattern
One dimensional vector based pattern
 
A STUDY AND ANALYSIS OF DIFFERENT EDGE DETECTION TECHNIQUES
A STUDY AND ANALYSIS OF DIFFERENT EDGE DETECTION TECHNIQUESA STUDY AND ANALYSIS OF DIFFERENT EDGE DETECTION TECHNIQUES
A STUDY AND ANALYSIS OF DIFFERENT EDGE DETECTION TECHNIQUES
 
A COMPARATIVE ANALYSIS OF RETRIEVAL TECHNIQUES IN CONTENT BASED IMAGE RETRIEVAL
A COMPARATIVE ANALYSIS OF RETRIEVAL TECHNIQUES IN CONTENT BASED IMAGE RETRIEVALA COMPARATIVE ANALYSIS OF RETRIEVAL TECHNIQUES IN CONTENT BASED IMAGE RETRIEVAL
A COMPARATIVE ANALYSIS OF RETRIEVAL TECHNIQUES IN CONTENT BASED IMAGE RETRIEVAL
 
A comparative analysis of retrieval techniques in content based image retrieval
A comparative analysis of retrieval techniques in content based image retrievalA comparative analysis of retrieval techniques in content based image retrieval
A comparative analysis of retrieval techniques in content based image retrieval
 
Introducing New Parameters to Compare the Accuracy and Reliability of Mean-Sh...
Introducing New Parameters to Compare the Accuracy and Reliability of Mean-Sh...Introducing New Parameters to Compare the Accuracy and Reliability of Mean-Sh...
Introducing New Parameters to Compare the Accuracy and Reliability of Mean-Sh...
 
Performance Improvement of Vector Quantization with Bit-parallelism Hardware
Performance Improvement of Vector Quantization with Bit-parallelism HardwarePerformance Improvement of Vector Quantization with Bit-parallelism Hardware
Performance Improvement of Vector Quantization with Bit-parallelism Hardware
 
BMVA summer school MATLAB programming tutorial
BMVA summer school MATLAB programming tutorialBMVA summer school MATLAB programming tutorial
BMVA summer school MATLAB programming tutorial
 
Automatic Classification Satellite images for weather Monitoring
Automatic Classification Satellite images for weather MonitoringAutomatic Classification Satellite images for weather Monitoring
Automatic Classification Satellite images for weather Monitoring
 
sduGroupEvent
sduGroupEventsduGroupEvent
sduGroupEvent
 
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
 

More from Aly Abdelkareem

An Inductive inference Machine
An Inductive inference MachineAn Inductive inference Machine
An Inductive inference Machine
Aly Abdelkareem
 
Digital Image Processing - Frequency Filters
Digital Image Processing - Frequency FiltersDigital Image Processing - Frequency Filters
Digital Image Processing - Frequency Filters
Aly Abdelkareem
 
Deep learning: Overfitting , underfitting, and regularization
Deep learning: Overfitting , underfitting, and regularizationDeep learning: Overfitting , underfitting, and regularization
Deep learning: Overfitting , underfitting, and regularization
Aly Abdelkareem
 
Pattern recognition 4 - MLE
Pattern recognition 4 - MLEPattern recognition 4 - MLE
Pattern recognition 4 - MLE
Aly Abdelkareem
 
Practical Digital Image Processing 1
Practical Digital Image Processing 1Practical Digital Image Processing 1
Practical Digital Image Processing 1
Aly Abdelkareem
 
Machine Learning for Everyone
Machine Learning for EveryoneMachine Learning for Everyone
Machine Learning for Everyone
Aly Abdelkareem
 
How to use deep learning on biological data
How to use deep learning on biological dataHow to use deep learning on biological data
How to use deep learning on biological data
Aly Abdelkareem
 
Deep Learning using Keras
Deep Learning using KerasDeep Learning using Keras
Deep Learning using Keras
Aly Abdelkareem
 
Object extraction from satellite imagery using deep learning
Object extraction from satellite imagery using deep learningObject extraction from satellite imagery using deep learning
Object extraction from satellite imagery using deep learning
Aly Abdelkareem
 
Pattern recognition Tutorial 2
Pattern recognition Tutorial 2Pattern recognition Tutorial 2
Pattern recognition Tutorial 2
Aly Abdelkareem
 
Android Udacity Study group 1
Android Udacity Study group 1Android Udacity Study group 1
Android Udacity Study group 1
Aly Abdelkareem
 
Java for android developers
Java for android developersJava for android developers
Java for android developers
Aly Abdelkareem
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
Aly Abdelkareem
 

More from Aly Abdelkareem (13)

An Inductive inference Machine
An Inductive inference MachineAn Inductive inference Machine
An Inductive inference Machine
 
Digital Image Processing - Frequency Filters
Digital Image Processing - Frequency FiltersDigital Image Processing - Frequency Filters
Digital Image Processing - Frequency Filters
 
Deep learning: Overfitting , underfitting, and regularization
Deep learning: Overfitting , underfitting, and regularizationDeep learning: Overfitting , underfitting, and regularization
Deep learning: Overfitting , underfitting, and regularization
 
Pattern recognition 4 - MLE
Pattern recognition 4 - MLEPattern recognition 4 - MLE
Pattern recognition 4 - MLE
 
Practical Digital Image Processing 1
Practical Digital Image Processing 1Practical Digital Image Processing 1
Practical Digital Image Processing 1
 
Machine Learning for Everyone
Machine Learning for EveryoneMachine Learning for Everyone
Machine Learning for Everyone
 
How to use deep learning on biological data
How to use deep learning on biological dataHow to use deep learning on biological data
How to use deep learning on biological data
 
Deep Learning using Keras
Deep Learning using KerasDeep Learning using Keras
Deep Learning using Keras
 
Object extraction from satellite imagery using deep learning
Object extraction from satellite imagery using deep learningObject extraction from satellite imagery using deep learning
Object extraction from satellite imagery using deep learning
 
Pattern recognition Tutorial 2
Pattern recognition Tutorial 2Pattern recognition Tutorial 2
Pattern recognition Tutorial 2
 
Android Udacity Study group 1
Android Udacity Study group 1Android Udacity Study group 1
Android Udacity Study group 1
 
Java for android developers
Java for android developersJava for android developers
Java for android developers
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
 

Recently uploaded

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
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
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
EduSkills OECD
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
Steve Thomason
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
AzmatAli747758
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
rosedainty
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
Nguyen Thanh Tu Collection
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
GeoBlogs
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
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
 
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
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
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
 
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
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
PedroFerreira53928
 

Recently uploaded (20)

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
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
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
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
 
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
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
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 ...
 
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.
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 

Practical Digital Image Processing 5

  • 1. Practical 5 - Digital Image Processing Aly Osama
  • 4. Agenda 1. Stereo Images 2. Optical Flow 3. Machine Learning a. Classification ( KNN - SVM ) b. Clustering ( K-means ) 4. Practical Demo 5. Project 6. Assignment 7. AI Companies
  • 6. Depth Map from Stereo Images https://www.youtube.com/watch?v=O7B2vCsTpC0
  • 7. Stereo Vision Idea The diagram contains equivalent triangles. Writing their equivalent equations will yield us following result: x and x′ are the distance between points in image plane corresponding to the scene point 3D and their camera center. B is the distance between two cameras (which we know) and f is the focal length of camera (already known). above equation says that the depth of a point in a scene is inversely proportional to the difference in distance of corresponding image points and their camera centers. So with this information, we can derive the depth of all pixels in an image.
  • 8. Depth Map from Stereo Images
  • 10. Optical Flow Optical flow is the pattern of apparent motion of image objects between two consecutive frames caused by the movement of object or camera. It is 2D vector field where each vector is a displacement vector showing the movement of points from first frame to second. Optical flow works on several assumptions: 1. The pixel intensities of an object do not change between consecutive frames. 2. Neighbouring pixels have similar motion.
  • 11. Consider a pixel I(x,y,t) in first frame It moves by distance (dx,dy) in next frame taken after dt time. So since those pixels are the same and intensity does not change, we can say, I(x,y,t)=I(x+dx,y+dy,t+dt) Then take taylor series approximation: fx u+fy v+ft=0 where: fx=∂f/∂x ; fy=∂f/∂y u=dx/dt ; v=dy/dt Above equation is called Optical Flow equation. In it, we can find fx and fy, they are image gradients. Similarly ft is the gradient along time. But we cannot get u and v from one equation?! Optical Flow Equations
  • 12. Lucas-Kanade Method Lucas-Kanade method takes a 3x3 patch around the point. So all the 9 points have the same motion. We can find (fx,fy,ft) for these 9 points. So now our problem becomes solving 9 equations with two unknown variables which is over-determined. using least square fit method.
  • 13. Lucas-Kanade Optical flow in OpenCV Step 1: Get features points
  • 14. Step 2: Track extracted features points using Optical flow
  • 15. Dense Optical flow in OpenCV
  • 17. Machine Learning vs Deep Learning
  • 19. Some Machine learning algorithms 1. Classification a. KNN b. SVM 2. Clustering a. K-means b. DBscan
  • 22. Understanding K-Nearest Neighbour kNN is one of the simplest of classification algorithms available for supervised learning. The idea is to search for closest match of the test data in feature space.
  • 23. KNN -> Human Classifier
  • 26. Linearly Separable Data Considering the data given in image, or consider that We find a line, which divides both the data to two regions. When we get a new test_data X just substitute it in f(x).if f(x) > 0 it belongs to blue group, else it belongs to red group. We can call this line as Decision Boundary. It is very simple and memory-efficient. Such data which can be divided into two with a straight line (or hyperplanes in higher dimensions) is called Linear Separable.
  • 27. Linearly Separable Data So to find this Decision Boundary, you need training data. Do you need all? NO. Just the ones which are close to the opposite group are sufficient. In our image, they are the one blue filled circle and two red filled squares. We can call them Support Vectors and the lines passing through them are called Support Planes. They are adequate for finding our decision boundary. We need not worry about all the data. It helps in data reduction.
  • 30. Consider a company, which is going to release a new model of T-shirt to market. Obviously they will have to manufacture models in different sizes to satisfy people of all sizes. So the company make a data of people’s height and weight, and plot them on to a graph, as below:
  • 31. Company can’t create t-shirts with all the sizes. Instead, they divide people to Small, Medium and Large, and manufacture only these 3 models which will fit into all the people. This grouping of people into three groups can be done by k-means clustering, and algorithm provides us best 3 sizes, which will satisfy all the people. And if it doesn’t, company can divide people to more groups, may be five, and so on. Check image below :
  • 32. How does it work? Consider a set of data as below ( You can consider it as t-shirt problem). We need to cluster this data into two groups.
  • 33. Step : 1 - Algorithm randomly chooses two centroids, C1, C2 (sometimes, any two data are taken as the centroids). Step : 2 - It calculates the distance from each point to both centroids. If a test data is more closer to C1 then that data is labelled with ‘0’. If it is closer to C2.then labelled as ‘1’ (If more centroids are there, labelled as ‘2’,‘3’ etc). In our case, we will color all ‘0’ labelled with red, and ‘1’ labelled with blue. So we get following image after above operations
  • 34. Step : 3 - Next we calculate the average of all blue points and red points separately and that will be our new centroids. That is C1 and C2 shift to newly calculated centroids. (Remember, the images shown are not true values and not to true scale, it is just for demonstration only). And again, perform step 2 with new centroids and label data to ‘0’ and ‘1’.
  • 35. Now Step - 2 and Step - 3 are iterated until both centroids are converged to fixed points. (Or it may be stopped depending on the criteria we provide, like maximum number of iterations, or a specific accuracy is reached etc.) These points are such that sum of distances between test data and their corresponding centroids are minimum. Or simply, sum of distances between
  • 37. Face Detection using Haar Cascades https://pythonprogramming.net/haar-c ascade-face-eye-detection-python-ope ncv-tutorial/
  • 41. Project ● Deadline: 30th April. ● Submission Form: https://goo.gl/forms/hdmELnD8qmOxVVVh2 a. Demo video on Facebook or Youtube b. Project source code on github
  • 43. The last assignment ever ( So far ) 1. Update your C.V. , Linkedin and Wuzzuf with your projects and assignments 2. Make a list of companies you want to work for and rank them based on your interest 3. Start to send emails with your C.V. to their HR and their employees (SPAM their Inbox) 4. Don’t worry “‫رزق‬ ‫”اﻟﻌﻤﻞ‬
  • 44. AI driven companies in Egypt (60 Companies) https://my-interviews-experience-in-egypt.quora.com/AI-Driven-Companies-in-Egypt
  • 45. Thank you and Good Luck