Flexible Shape
Matching
Index
• Template Matching Overview
• Deformable Template
• Active Contour (Snake)
• Greedy Algorithm for Snake
17-Aug-162
Index
• Template Matching Overview
• Deformable Template
• Active Contour (Snake)
• Greedy Algorithm for Snake
17-Aug-163
Template Matching -
Problems
• Large number of comparisons.
• Exact match of multiple parameters.
17-Aug-164
Template Matching -
Solution
• Reduce number of matched points.
17-Aug-165
Still fixed and not
adaptable
Index
• Template Matching Overview
• Deformable Template
• Active Contour (Snake)
• Greedy Algorithm for Snake
17-Aug-166
Deformable Template –
Exact Match Solution
• Rather than using a fixed template with fixed
parameters, more flexible template is used.
17-Aug-167
Deformable Template –
Many Comparisons Solution
• Use only key edge points to detect object.
• These points are discriminant points of the object which are
edge points.
𝒓 𝟐
=(𝒙 − 𝑪 𝒄𝒙) 𝟐+(𝒚 − 𝑪 𝒄𝒚) 𝟐
17-Aug-168
Deformable Template –
Dynamic Templates Generation
• The set of parameter values that makes the template
best matches the edge points is the best parameters to
use.
{𝑪 𝒑, 𝒂, 𝒃, 𝒄, 𝑪 𝒄, r}
• Deformable templates may not be completely
autonomous.
17-Aug-169
Template Energy
• Good template parameters is what maximizes the
energy.
• The goal is to find parameters that maximize 𝑬 𝒆.
17-Aug-1612
More Parameters
• More parameters can be used to make results more
accurate.
• By a little eye analysis, it is apparent that usually sclera
is white and iris is darker than it.
• Adding these parameters can enhance results.
Sclera Iris
17-Aug-1613
Combine Parameters
• Combining all parameters, result in this final energy.
• Where 𝑪 𝒆, 𝑪 𝒗, 𝑪 𝒑 are weighting parameters that control
the influence of this parameter over the resultant energy.
• Goal is to maximize E.
17-Aug-1614
Many Parameters –
Problem
• For each parameter, there are a number of values that
needs to be tested until maximum energy reached.
• Say 11 parameters selected and each parameter can
have 100 values, so there are more than
𝟏𝟎 𝟐𝟓
combinations of parameter values needed to be
tested.
17-Aug-1615
Many Parameters –
Solution
• This problem can be solved in two ways:
o Optimization techniques that not reduce number
of combinations but try to make calculations quickly.
o Techniques to reduce number of parameters such
as snakes.
17-Aug-1616
Index
• Template Matching Overview
• Deformable Template
• Active Contour (Snake)
• Greedy Algorithm for Snake
17-Aug-1617
• An active contour is a set of points that aims to enclose a
target object.
Active Contour : Snake
17-Aug-1618
Active Contour : Snake
• Contour is a bounding region of a target object.
• It is active because it is a self-learning process to modify
itself until closely bound the target object.
• Contour changes like a snake.
• Goal of snakes is to find salient image contours that
surround target object.
17-Aug-1619
Snake Spline
• Snake draws a contour surrounding the target object.
• There are many complex objects with complex
boundaries and multiple inflection points.
• Snake uses spline to be able to draw complex shapes
using simple shapes.
• Spline divides complex shapes into small segments that
are easier to graph.
17-Aug-1620
Spline
• Spline is a polynomial or a set of polynomials to
approximates complex shapes.
• Complex shapes has many inflection points that can
be divided into simple segments with fewer inflection
points.
• Because cubic polynomial has a maximum of only two
inflection points, it will be used to approximate complex
shapes.
17-Aug-1621
x(u)=𝒂 𝒙 𝒖 𝟑
+𝒃 𝒙 𝒖 𝟐
+𝒄 𝒙 𝒖 +𝒅 𝒙
y(u)=𝒂 𝒚 𝒖 𝟑
+𝒃 𝒚 𝒖 𝟐
+𝒄 𝒚 𝒖 +𝒅 𝒚
Spline
• Complex shapes are divided into segments of at most
two inflection points.
• These segments are approximated using the cubic
polynomial.
• Collection of segments are then connected together in a
smooth manner.
17-Aug-1622
Contour
• Contour is defined in terms of x and y of all spline cubic
polynomial inflection points used to approximate
complex shape.
𝒗 𝒔 = (𝒙 𝒔 , 𝒚 𝒔 )
17-Aug-1623
Snake Process
• Snake is similar to deformable templates in which they
may be semiautomatic.
• They rely on other mechanisms to place them near the
desired contour.
• User specify the initial contour and snake tries to modify
it to find optimal contour.
17-Aug-1624
Snake Energy Minimization
• Snake changes its contour using different forces:
o Internal forces
o Image forces
o External forces
• To judge contour optimality, snake uses energy
minimization techniques.
17-Aug-1625
Internal Forces –
Internal Energy
• Internal forces is used to modify the spline shape.
• Internal energy of spline is symbolized 𝑬𝒊𝒏𝒕 that just
depends on spline shape.
• It consists of first- and second-order terms of contour
points.
17-Aug-1626
Internal Forces Energy
• Internal energy has two parameters that control snake
shape:
o α controls amount of snake spline stretching.
o β controls amount of snake spline flexing/smoothing.
• The larger α, the more stretch snake contour is.
• The larger β, the smoother snake contour.
17-Aug-1627
Image Forces
17-Aug-1628
• How a snake can know we need to detect eye?
• Image forces guides the snake to a selected image
portion with certain features.
• Examples is to depend on:
o Lines
o Edges
Image Forces Energy
• To measure image force optimality, image energy is
calculated.
• If only line and edge are the features to guide the snake,
thus line energy 𝑬𝒍𝒊𝒏𝒆 and edge energy 𝑬 𝒆𝒅𝒈𝒆 are
calculated.
• There are two parameters used to control image forces:
o 𝒘𝒍𝒊𝒏𝒆 guides snake to align itself to dark regions.
o 𝒘 𝒆𝒅𝒈𝒆guides snake to align itself to sharp edges.
17-Aug-1629
Index
• Template Matching Overview
• Deformable Template
• Active Contour (Snake)
• Greedy Algorithm for Snake
17-Aug-1631
Greedy Algorithm for
Snakes
• Greedy algorithm implements the snake energy
minimization.
17-Aug-1632
Define snake parameters α,β, 𝒘𝒍𝒊𝒏𝒆
and 𝒘 𝒆𝒅𝒈𝒆
Select snake point
Check neighborhood points for
lower energy
Set new snake point to new
minimum
Greedy Algorithm -
Initialization
• Snake parameters are initialized
externally and initial contour is found.
• Say there are 10 points in the initial
contour, then Greedy algorithm will
be applied on all10 points.
17-Aug-1633
Define snake parameters α,β, 𝒘𝒍𝒊𝒏𝒆
and 𝒘 𝒆𝒅𝒈𝒆
Greedy Algorithm – Snake
Point Neighborhood
17-Aug-1634
After Iteration 1After Iteration 2After Iteration 3

More Related Content

PPTX
Implementing machine learnng at the iot edge
PDF
AI Uninformed Search Strategies by Examples
PDF
Facet and Search API
PDF
Creating a User-Friendly Search UI with Drupal - Presentation at DrupalCamp T...
PPTX
Currency Recognition System for Visually Impaired: Egyp-tian Banknote as a St...
PPTX
Boolean Logic Searching: A Primer
PDF
A version of watershed algorithm for color image segmentation
PDF
The Evolution of Search
Implementing machine learnng at the iot edge
AI Uninformed Search Strategies by Examples
Facet and Search API
Creating a User-Friendly Search UI with Drupal - Presentation at DrupalCamp T...
Currency Recognition System for Visually Impaired: Egyp-tian Banknote as a St...
Boolean Logic Searching: A Primer
A version of watershed algorithm for color image segmentation
The Evolution of Search

Similar to Flexible Shape Matching (16)

PPTX
06 image features
PDF
Dictionary Learning in Games - GDC 2014
PDF
introduction of Data structure with example
PPTX
Recommender Systems.pptx
PDF
Overview and Implementation of Principal Component Analysis
PPT
SVD.ppt
PDF
Scale free network Visualiuzation
PPTX
lec08-numpy.pptx
PPT
Fea 1 /certified fixed orthodontic courses by Indian dental academy
PDF
DAA Notes.pdf
PPTX
Business Analytics Foundation with R Tools - Part 3
PPTX
Stats chapter 4
PDF
AS physics - Physical quantities & units
PPTX
Module-3a.pptx
PPTX
Regression Analysis.pptx
PPTX
Regression Analysis Techniques.pptx
06 image features
Dictionary Learning in Games - GDC 2014
introduction of Data structure with example
Recommender Systems.pptx
Overview and Implementation of Principal Component Analysis
SVD.ppt
Scale free network Visualiuzation
lec08-numpy.pptx
Fea 1 /certified fixed orthodontic courses by Indian dental academy
DAA Notes.pdf
Business Analytics Foundation with R Tools - Part 3
Stats chapter 4
AS physics - Physical quantities & units
Module-3a.pptx
Regression Analysis.pptx
Regression Analysis Techniques.pptx
Ad

More from Ahmed Gad (20)

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

Recently uploaded (20)

PDF
Complications of Minimal Access-Surgery.pdf
PDF
What if we spent less time fighting change, and more time building what’s rig...
PDF
HVAC Specification 2024 according to central public works department
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
PDF
FORM 1 BIOLOGY MIND MAPS and their schemes
PDF
AI-driven educational solutions for real-life interventions in the Philippine...
PDF
Trump Administration's workforce development strategy
PPTX
B.Sc. DS Unit 2 Software Engineering.pptx
PPTX
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
PDF
Weekly quiz Compilation Jan -July 25.pdf
PPTX
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
PPTX
20th Century Theater, Methods, History.pptx
PPTX
History, Philosophy and sociology of education (1).pptx
PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
PDF
IGGE1 Understanding the Self1234567891011
PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 2).pdf
PDF
Environmental Education MCQ BD2EE - Share Source.pdf
PPTX
TNA_Presentation-1-Final(SAVE)) (1).pptx
PDF
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
PDF
Uderstanding digital marketing and marketing stratergie for engaging the digi...
Complications of Minimal Access-Surgery.pdf
What if we spent less time fighting change, and more time building what’s rig...
HVAC Specification 2024 according to central public works department
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
FORM 1 BIOLOGY MIND MAPS and their schemes
AI-driven educational solutions for real-life interventions in the Philippine...
Trump Administration's workforce development strategy
B.Sc. DS Unit 2 Software Engineering.pptx
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
Weekly quiz Compilation Jan -July 25.pdf
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
20th Century Theater, Methods, History.pptx
History, Philosophy and sociology of education (1).pptx
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
IGGE1 Understanding the Self1234567891011
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 2).pdf
Environmental Education MCQ BD2EE - Share Source.pdf
TNA_Presentation-1-Final(SAVE)) (1).pptx
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
Uderstanding digital marketing and marketing stratergie for engaging the digi...

Flexible Shape Matching

  • 2. Index • Template Matching Overview • Deformable Template • Active Contour (Snake) • Greedy Algorithm for Snake 17-Aug-162
  • 3. Index • Template Matching Overview • Deformable Template • Active Contour (Snake) • Greedy Algorithm for Snake 17-Aug-163
  • 4. Template Matching - Problems • Large number of comparisons. • Exact match of multiple parameters. 17-Aug-164
  • 5. Template Matching - Solution • Reduce number of matched points. 17-Aug-165 Still fixed and not adaptable
  • 6. Index • Template Matching Overview • Deformable Template • Active Contour (Snake) • Greedy Algorithm for Snake 17-Aug-166
  • 7. Deformable Template – Exact Match Solution • Rather than using a fixed template with fixed parameters, more flexible template is used. 17-Aug-167
  • 8. Deformable Template – Many Comparisons Solution • Use only key edge points to detect object. • These points are discriminant points of the object which are edge points. 𝒓 𝟐 =(𝒙 − 𝑪 𝒄𝒙) 𝟐+(𝒚 − 𝑪 𝒄𝒚) 𝟐 17-Aug-168
  • 9. Deformable Template – Dynamic Templates Generation • The set of parameter values that makes the template best matches the edge points is the best parameters to use. {𝑪 𝒑, 𝒂, 𝒃, 𝒄, 𝑪 𝒄, r} • Deformable templates may not be completely autonomous. 17-Aug-169
  • 10. Template Energy • Good template parameters is what maximizes the energy. • The goal is to find parameters that maximize 𝑬 𝒆. 17-Aug-1612
  • 11. More Parameters • More parameters can be used to make results more accurate. • By a little eye analysis, it is apparent that usually sclera is white and iris is darker than it. • Adding these parameters can enhance results. Sclera Iris 17-Aug-1613
  • 12. Combine Parameters • Combining all parameters, result in this final energy. • Where 𝑪 𝒆, 𝑪 𝒗, 𝑪 𝒑 are weighting parameters that control the influence of this parameter over the resultant energy. • Goal is to maximize E. 17-Aug-1614
  • 13. Many Parameters – Problem • For each parameter, there are a number of values that needs to be tested until maximum energy reached. • Say 11 parameters selected and each parameter can have 100 values, so there are more than 𝟏𝟎 𝟐𝟓 combinations of parameter values needed to be tested. 17-Aug-1615
  • 14. Many Parameters – Solution • This problem can be solved in two ways: o Optimization techniques that not reduce number of combinations but try to make calculations quickly. o Techniques to reduce number of parameters such as snakes. 17-Aug-1616
  • 15. Index • Template Matching Overview • Deformable Template • Active Contour (Snake) • Greedy Algorithm for Snake 17-Aug-1617
  • 16. • An active contour is a set of points that aims to enclose a target object. Active Contour : Snake 17-Aug-1618
  • 17. Active Contour : Snake • Contour is a bounding region of a target object. • It is active because it is a self-learning process to modify itself until closely bound the target object. • Contour changes like a snake. • Goal of snakes is to find salient image contours that surround target object. 17-Aug-1619
  • 18. Snake Spline • Snake draws a contour surrounding the target object. • There are many complex objects with complex boundaries and multiple inflection points. • Snake uses spline to be able to draw complex shapes using simple shapes. • Spline divides complex shapes into small segments that are easier to graph. 17-Aug-1620
  • 19. Spline • Spline is a polynomial or a set of polynomials to approximates complex shapes. • Complex shapes has many inflection points that can be divided into simple segments with fewer inflection points. • Because cubic polynomial has a maximum of only two inflection points, it will be used to approximate complex shapes. 17-Aug-1621 x(u)=𝒂 𝒙 𝒖 𝟑 +𝒃 𝒙 𝒖 𝟐 +𝒄 𝒙 𝒖 +𝒅 𝒙 y(u)=𝒂 𝒚 𝒖 𝟑 +𝒃 𝒚 𝒖 𝟐 +𝒄 𝒚 𝒖 +𝒅 𝒚
  • 20. Spline • Complex shapes are divided into segments of at most two inflection points. • These segments are approximated using the cubic polynomial. • Collection of segments are then connected together in a smooth manner. 17-Aug-1622
  • 21. Contour • Contour is defined in terms of x and y of all spline cubic polynomial inflection points used to approximate complex shape. 𝒗 𝒔 = (𝒙 𝒔 , 𝒚 𝒔 ) 17-Aug-1623
  • 22. Snake Process • Snake is similar to deformable templates in which they may be semiautomatic. • They rely on other mechanisms to place them near the desired contour. • User specify the initial contour and snake tries to modify it to find optimal contour. 17-Aug-1624
  • 23. Snake Energy Minimization • Snake changes its contour using different forces: o Internal forces o Image forces o External forces • To judge contour optimality, snake uses energy minimization techniques. 17-Aug-1625
  • 24. Internal Forces – Internal Energy • Internal forces is used to modify the spline shape. • Internal energy of spline is symbolized 𝑬𝒊𝒏𝒕 that just depends on spline shape. • It consists of first- and second-order terms of contour points. 17-Aug-1626
  • 25. Internal Forces Energy • Internal energy has two parameters that control snake shape: o α controls amount of snake spline stretching. o β controls amount of snake spline flexing/smoothing. • The larger α, the more stretch snake contour is. • The larger β, the smoother snake contour. 17-Aug-1627
  • 26. Image Forces 17-Aug-1628 • How a snake can know we need to detect eye? • Image forces guides the snake to a selected image portion with certain features. • Examples is to depend on: o Lines o Edges
  • 27. Image Forces Energy • To measure image force optimality, image energy is calculated. • If only line and edge are the features to guide the snake, thus line energy 𝑬𝒍𝒊𝒏𝒆 and edge energy 𝑬 𝒆𝒅𝒈𝒆 are calculated. • There are two parameters used to control image forces: o 𝒘𝒍𝒊𝒏𝒆 guides snake to align itself to dark regions. o 𝒘 𝒆𝒅𝒈𝒆guides snake to align itself to sharp edges. 17-Aug-1629
  • 28. Index • Template Matching Overview • Deformable Template • Active Contour (Snake) • Greedy Algorithm for Snake 17-Aug-1631
  • 29. Greedy Algorithm for Snakes • Greedy algorithm implements the snake energy minimization. 17-Aug-1632 Define snake parameters α,β, 𝒘𝒍𝒊𝒏𝒆 and 𝒘 𝒆𝒅𝒈𝒆 Select snake point Check neighborhood points for lower energy Set new snake point to new minimum
  • 30. Greedy Algorithm - Initialization • Snake parameters are initialized externally and initial contour is found. • Say there are 10 points in the initial contour, then Greedy algorithm will be applied on all10 points. 17-Aug-1633 Define snake parameters α,β, 𝒘𝒍𝒊𝒏𝒆 and 𝒘 𝒆𝒅𝒈𝒆
  • 31. Greedy Algorithm – Snake Point Neighborhood 17-Aug-1634 After Iteration 1After Iteration 2After Iteration 3