SlideShare a Scribd company logo
1 of 18
Download to read offline
Robert Collins
CSE486, Penn State




                        Lecture 30:
                Video Tracking: Lucas-Kanade
Robert Collins
CSE486, Penn State
                     Two Popular Tracking Methods


          • Mean-shift color histogram tracking (last time)

          • Lucas-Kanade template tracking (today)
Robert Collins
CSE486, Penn State




                     Lucas-Kanade Tracking
Robert Collins
CSE486, Penn State               Review: Lucas-Kanade
         •   Brightness constancy
         •   One equation two unknowns
                                                                     unknown flow vector

              temporal gradient           spatial gradient

         •   How to get more equations for a pixel?
              – Basic idea: impose additional constraints
                     • one method: pretend the pixel’s neighbors have the same (u,v)
                          – If we use a 5x5 window, that gives us 25 equations per pixel!




                                                                    * From Khurram Hassan-Shafique CAP5415 Computer Vision 2003
Robert Collins
CSE486, Penn State
                        Review: Lucas-Kanade (cont)
     •       Now we have more equations than unknowns



         •    Solution: solve least squares problem
               – minimum least squares solution given by solution (in d) of:




               – The summations are over all pixels in the K x K window
               – This technique was first proposed by Lucas & Kanade (1981)
                     • described in Trucco & Verri reading
                                                             * From Khurram Hassan-Shafique CAP5415 Computer Vision 2003
Robert Collins
CSE486, Penn State
                      Lucas Kanade Tracking
           Traditional Lucas-Kanade is typically run on small,
           corner-like features (e.g. 5x5) to compute optic flow.

           Observation: There’s no reason we can’t use the same
           approach on a larger window around the object being
           tracked.



                                 80x50 pixels
Robert Collins

              Basic LK Derivation for Templates
CSE486, Penn State




                                              template
                                              (model)



   current frame
                          u,v = hypothesized location of
                          template in current frame
Robert Collins

              Basic LK Derivation for Templates
CSE486, Penn State




                                       First order approx



 Take partial derivs and set to zero




   Form matrix equation

                                           solve via
                                           least-squares
Robert Collins
CSE486, Penn State
                     One Problem with this...
        Assumption of constant flow (pure translation) for
        all pixels in a larger window is unreasonable for
        long periods of time.




      However, we can easily generalize Lucas-Kanade
      approach to other 2D parametric motion models
      (like affine or projective) by introducing a “warp”
      function W.
                            generalize

                                 x
                                             [ I (W ([ x, y ]; P))  T ([ x, y ])]2
                                  within image patch
                                  y
                                  
Robert Collins
CSE486, Penn State
                        Step-by-Step Derivation
       The key to the derivation is Taylor series approximation:
                                                                    W
            [ I (W ([ x, y ]; P  P)) ~ [ I (W ([ x, y ]; P))  I
                                       ~                               P
                                                                    P
     We will derive this step-by-step. First, we need two background formula:
Robert Collins
CSE486, Penn State
                       Step-by-Step Derivation
        First consider the expansion for a single variable p
Robert Collins
CSE486, Penn State
                      Step-by-Step Derivation




        Note that each variable parameter pi contributes a term of the form
Robert Collins
CSE486, Penn State
                      Step-by-Step Derivation
       Now let’s rewrite the expression as a matrix equation. For each term,
       we can rewrite:




        So that we have:
Robert Collins
CSE486, Penn State
                           Step-by-Step Derivation
       Further collecting the dw/dpi terms into a matrix, we can write:




       which are the terms in the matrix equation:
                                             ~                                W
                [ I (W ([ x, y ]; P  P))   ~   [ I (W ([ x, y ]; P))  I      P
                                                                              P
Robert Collins

              Example: Jacobian of Affine Warp
CSE486, Penn State


                                              Let W([x, y]; P)  [Wx , Wy ]

      general equation of Jacobian                Wx      Wx    Wx   Wx 
                                                                       
                                              W  P       P     P    P 
                                                 1          2      3     n
                                                                             
                                              P Wy       Wy    Wy   Wy 
                                                                       
                                                  P
                                                  1         P2   P3   P 
                                                                           n 



      affine warp function (6 parameters)
                                                              x  xP  yP3  P5 
                                                                     1
                                                            
                                        x             W     xP2  y  yP4  P6 
                    1  p1
 W ([ x, y ]; P )  
                            p3    p5   
                                      y                                      
                                 p6                 P            P
                     p2 1  p4       1
                                                            x 0 y 0 1 0
                                                            
                                                              0 x 0 y 0 1         
Source: “Lucas-Kanade 20 years on: A unifying framework” Baker and Mathews, IJCV 04
Robert Collins
CSE486, Penn State
      Iterate               Warp I to obtain I(W([x y];P))

                            Compute the error image T(x) – I(W([x y]; P))

                            Warp the gradient I with W([x y]; P)
                                        W
                            Evaluate           at ([x y]; P)          (Jacobian)
                                        P
                                                                                W
                            Compute steepest descent images I
                                                                                P
                                                                          W T     W
                            Compute Hessian matrix               (I     P
                                                                             ) (I
                                                                                   P
                                                                                      )

                                                   W T
                            Compute        ( I   P
                                                      ) (T ( x, y )  I (W ([ x, y ]; P )))

                            Compute P

                            Update P           P + P

        Until P magnitude is negligible

Dr. Ng Teck Khim
Robert Collins
CSE486, Penn State             Algorithm At a Glance




          Source: “Lucas-Kanade 20 years on: A unifying framework” Baker and Mathews, IJCV 04
Robert Collins
             State of the Art Lucas Kanade Tracking
CSE486, Penn State

        Tracking facial mesh models (piecewise affine)




                                    QuickTime™ and a
                              YUV420 codec decompressor
                             are needed to see this picture.




Baker, Matthews, CMU

More Related Content

Similar to Lecture30

Lecture23
Lecture23Lecture23
Lecture23zukun
 
Lecture13
Lecture13Lecture13
Lecture13zukun
 
Lecture12
Lecture12Lecture12
Lecture12zukun
 
L03 ai - knowledge representation using logic
L03 ai - knowledge representation using logicL03 ai - knowledge representation using logic
L03 ai - knowledge representation using logicManjula V
 
Lecture20
Lecture20Lecture20
Lecture20zukun
 
Lecture22
Lecture22Lecture22
Lecture22zukun
 
Pwl rewal-slideshare
Pwl rewal-slidesharePwl rewal-slideshare
Pwl rewal-slidesharepalvaro
 
Methods of Manifold Learning for Dimension Reduction of Large Data Sets
Methods of Manifold Learning for Dimension Reduction of Large Data SetsMethods of Manifold Learning for Dimension Reduction of Large Data Sets
Methods of Manifold Learning for Dimension Reduction of Large Data SetsRyan B Harvey, CSDP, CSM
 
Principal component analysis and matrix factorizations for learning (part 1) ...
Principal component analysis and matrix factorizations for learning (part 1) ...Principal component analysis and matrix factorizations for learning (part 1) ...
Principal component analysis and matrix factorizations for learning (part 1) ...zukun
 
Lecture16
Lecture16Lecture16
Lecture16zukun
 
POST’s CORRESPONDENCE PROBLEM
POST’s CORRESPONDENCE PROBLEMPOST’s CORRESPONDENCE PROBLEM
POST’s CORRESPONDENCE PROBLEMRajendran
 

Similar to Lecture30 (12)

Lecture23
Lecture23Lecture23
Lecture23
 
Lecture13
Lecture13Lecture13
Lecture13
 
Lecture12
Lecture12Lecture12
Lecture12
 
L03 ai - knowledge representation using logic
L03 ai - knowledge representation using logicL03 ai - knowledge representation using logic
L03 ai - knowledge representation using logic
 
Lecture20
Lecture20Lecture20
Lecture20
 
Lecture22
Lecture22Lecture22
Lecture22
 
Pwl rewal-slideshare
Pwl rewal-slidesharePwl rewal-slideshare
Pwl rewal-slideshare
 
chapter9.ppt
chapter9.pptchapter9.ppt
chapter9.ppt
 
Methods of Manifold Learning for Dimension Reduction of Large Data Sets
Methods of Manifold Learning for Dimension Reduction of Large Data SetsMethods of Manifold Learning for Dimension Reduction of Large Data Sets
Methods of Manifold Learning for Dimension Reduction of Large Data Sets
 
Principal component analysis and matrix factorizations for learning (part 1) ...
Principal component analysis and matrix factorizations for learning (part 1) ...Principal component analysis and matrix factorizations for learning (part 1) ...
Principal component analysis and matrix factorizations for learning (part 1) ...
 
Lecture16
Lecture16Lecture16
Lecture16
 
POST’s CORRESPONDENCE PROBLEM
POST’s CORRESPONDENCE PROBLEMPOST’s CORRESPONDENCE PROBLEM
POST’s CORRESPONDENCE PROBLEM
 

More from zukun

My lyn tutorial 2009
My lyn tutorial 2009My lyn tutorial 2009
My lyn tutorial 2009zukun
 
ETHZ CV2012: Tutorial openCV
ETHZ CV2012: Tutorial openCVETHZ CV2012: Tutorial openCV
ETHZ CV2012: Tutorial openCVzukun
 
ETHZ CV2012: Information
ETHZ CV2012: InformationETHZ CV2012: Information
ETHZ CV2012: Informationzukun
 
Siwei lyu: natural image statistics
Siwei lyu: natural image statisticsSiwei lyu: natural image statistics
Siwei lyu: natural image statisticszukun
 
Lecture9 camera calibration
Lecture9 camera calibrationLecture9 camera calibration
Lecture9 camera calibrationzukun
 
Brunelli 2008: template matching techniques in computer vision
Brunelli 2008: template matching techniques in computer visionBrunelli 2008: template matching techniques in computer vision
Brunelli 2008: template matching techniques in computer visionzukun
 
Modern features-part-4-evaluation
Modern features-part-4-evaluationModern features-part-4-evaluation
Modern features-part-4-evaluationzukun
 
Modern features-part-3-software
Modern features-part-3-softwareModern features-part-3-software
Modern features-part-3-softwarezukun
 
Modern features-part-2-descriptors
Modern features-part-2-descriptorsModern features-part-2-descriptors
Modern features-part-2-descriptorszukun
 
Modern features-part-1-detectors
Modern features-part-1-detectorsModern features-part-1-detectors
Modern features-part-1-detectorszukun
 
Modern features-part-0-intro
Modern features-part-0-introModern features-part-0-intro
Modern features-part-0-introzukun
 
Lecture 02 internet video search
Lecture 02 internet video searchLecture 02 internet video search
Lecture 02 internet video searchzukun
 
Lecture 01 internet video search
Lecture 01 internet video searchLecture 01 internet video search
Lecture 01 internet video searchzukun
 
Lecture 03 internet video search
Lecture 03 internet video searchLecture 03 internet video search
Lecture 03 internet video searchzukun
 
Icml2012 tutorial representation_learning
Icml2012 tutorial representation_learningIcml2012 tutorial representation_learning
Icml2012 tutorial representation_learningzukun
 
Advances in discrete energy minimisation for computer vision
Advances in discrete energy minimisation for computer visionAdvances in discrete energy minimisation for computer vision
Advances in discrete energy minimisation for computer visionzukun
 
Gephi tutorial: quick start
Gephi tutorial: quick startGephi tutorial: quick start
Gephi tutorial: quick startzukun
 
EM algorithm and its application in probabilistic latent semantic analysis
EM algorithm and its application in probabilistic latent semantic analysisEM algorithm and its application in probabilistic latent semantic analysis
EM algorithm and its application in probabilistic latent semantic analysiszukun
 
Object recognition with pictorial structures
Object recognition with pictorial structuresObject recognition with pictorial structures
Object recognition with pictorial structureszukun
 
Iccv2011 learning spatiotemporal graphs of human activities
Iccv2011 learning spatiotemporal graphs of human activities Iccv2011 learning spatiotemporal graphs of human activities
Iccv2011 learning spatiotemporal graphs of human activities zukun
 

More from zukun (20)

My lyn tutorial 2009
My lyn tutorial 2009My lyn tutorial 2009
My lyn tutorial 2009
 
ETHZ CV2012: Tutorial openCV
ETHZ CV2012: Tutorial openCVETHZ CV2012: Tutorial openCV
ETHZ CV2012: Tutorial openCV
 
ETHZ CV2012: Information
ETHZ CV2012: InformationETHZ CV2012: Information
ETHZ CV2012: Information
 
Siwei lyu: natural image statistics
Siwei lyu: natural image statisticsSiwei lyu: natural image statistics
Siwei lyu: natural image statistics
 
Lecture9 camera calibration
Lecture9 camera calibrationLecture9 camera calibration
Lecture9 camera calibration
 
Brunelli 2008: template matching techniques in computer vision
Brunelli 2008: template matching techniques in computer visionBrunelli 2008: template matching techniques in computer vision
Brunelli 2008: template matching techniques in computer vision
 
Modern features-part-4-evaluation
Modern features-part-4-evaluationModern features-part-4-evaluation
Modern features-part-4-evaluation
 
Modern features-part-3-software
Modern features-part-3-softwareModern features-part-3-software
Modern features-part-3-software
 
Modern features-part-2-descriptors
Modern features-part-2-descriptorsModern features-part-2-descriptors
Modern features-part-2-descriptors
 
Modern features-part-1-detectors
Modern features-part-1-detectorsModern features-part-1-detectors
Modern features-part-1-detectors
 
Modern features-part-0-intro
Modern features-part-0-introModern features-part-0-intro
Modern features-part-0-intro
 
Lecture 02 internet video search
Lecture 02 internet video searchLecture 02 internet video search
Lecture 02 internet video search
 
Lecture 01 internet video search
Lecture 01 internet video searchLecture 01 internet video search
Lecture 01 internet video search
 
Lecture 03 internet video search
Lecture 03 internet video searchLecture 03 internet video search
Lecture 03 internet video search
 
Icml2012 tutorial representation_learning
Icml2012 tutorial representation_learningIcml2012 tutorial representation_learning
Icml2012 tutorial representation_learning
 
Advances in discrete energy minimisation for computer vision
Advances in discrete energy minimisation for computer visionAdvances in discrete energy minimisation for computer vision
Advances in discrete energy minimisation for computer vision
 
Gephi tutorial: quick start
Gephi tutorial: quick startGephi tutorial: quick start
Gephi tutorial: quick start
 
EM algorithm and its application in probabilistic latent semantic analysis
EM algorithm and its application in probabilistic latent semantic analysisEM algorithm and its application in probabilistic latent semantic analysis
EM algorithm and its application in probabilistic latent semantic analysis
 
Object recognition with pictorial structures
Object recognition with pictorial structuresObject recognition with pictorial structures
Object recognition with pictorial structures
 
Iccv2011 learning spatiotemporal graphs of human activities
Iccv2011 learning spatiotemporal graphs of human activities Iccv2011 learning spatiotemporal graphs of human activities
Iccv2011 learning spatiotemporal graphs of human activities
 

Recently uploaded

Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQuiz Club NITW
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...DhatriParmar
 
ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6Vanessa Camilleri
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptxmary850239
 
ARTERIAL BLOOD GAS ANALYSIS........pptx
ARTERIAL BLOOD  GAS ANALYSIS........pptxARTERIAL BLOOD  GAS ANALYSIS........pptx
ARTERIAL BLOOD GAS ANALYSIS........pptxAneriPatwari
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfPrerana Jadhav
 
Sulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesSulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesVijayaLaxmi84
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17Celine George
 
Indexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfIndexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfChristalin Nelson
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxSayali Powar
 
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxCLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxAnupam32727
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseCeline George
 

Recently uploaded (20)

Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
 
ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx
 
ARTERIAL BLOOD GAS ANALYSIS........pptx
ARTERIAL BLOOD  GAS ANALYSIS........pptxARTERIAL BLOOD  GAS ANALYSIS........pptx
ARTERIAL BLOOD GAS ANALYSIS........pptx
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdf
 
Sulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesSulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their uses
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17
 
prashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Professionprashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Profession
 
Indexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfIndexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdf
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
 
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxCLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
 
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of EngineeringFaculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 Database
 

Lecture30

  • 1. Robert Collins CSE486, Penn State Lecture 30: Video Tracking: Lucas-Kanade
  • 2. Robert Collins CSE486, Penn State Two Popular Tracking Methods • Mean-shift color histogram tracking (last time) • Lucas-Kanade template tracking (today)
  • 3. Robert Collins CSE486, Penn State Lucas-Kanade Tracking
  • 4. Robert Collins CSE486, Penn State Review: Lucas-Kanade • Brightness constancy • One equation two unknowns unknown flow vector temporal gradient spatial gradient • How to get more equations for a pixel? – Basic idea: impose additional constraints • one method: pretend the pixel’s neighbors have the same (u,v) – If we use a 5x5 window, that gives us 25 equations per pixel! * From Khurram Hassan-Shafique CAP5415 Computer Vision 2003
  • 5. Robert Collins CSE486, Penn State Review: Lucas-Kanade (cont) • Now we have more equations than unknowns • Solution: solve least squares problem – minimum least squares solution given by solution (in d) of: – The summations are over all pixels in the K x K window – This technique was first proposed by Lucas & Kanade (1981) • described in Trucco & Verri reading * From Khurram Hassan-Shafique CAP5415 Computer Vision 2003
  • 6. Robert Collins CSE486, Penn State Lucas Kanade Tracking Traditional Lucas-Kanade is typically run on small, corner-like features (e.g. 5x5) to compute optic flow. Observation: There’s no reason we can’t use the same approach on a larger window around the object being tracked. 80x50 pixels
  • 7. Robert Collins Basic LK Derivation for Templates CSE486, Penn State template (model) current frame u,v = hypothesized location of template in current frame
  • 8. Robert Collins Basic LK Derivation for Templates CSE486, Penn State First order approx Take partial derivs and set to zero Form matrix equation solve via least-squares
  • 9. Robert Collins CSE486, Penn State One Problem with this... Assumption of constant flow (pure translation) for all pixels in a larger window is unreasonable for long periods of time. However, we can easily generalize Lucas-Kanade approach to other 2D parametric motion models (like affine or projective) by introducing a “warp” function W. generalize x  [ I (W ([ x, y ]; P))  T ([ x, y ])]2   within image patch  y  
  • 10. Robert Collins CSE486, Penn State Step-by-Step Derivation The key to the derivation is Taylor series approximation: W [ I (W ([ x, y ]; P  P)) ~ [ I (W ([ x, y ]; P))  I ~ P P We will derive this step-by-step. First, we need two background formula:
  • 11. Robert Collins CSE486, Penn State Step-by-Step Derivation First consider the expansion for a single variable p
  • 12. Robert Collins CSE486, Penn State Step-by-Step Derivation Note that each variable parameter pi contributes a term of the form
  • 13. Robert Collins CSE486, Penn State Step-by-Step Derivation Now let’s rewrite the expression as a matrix equation. For each term, we can rewrite: So that we have:
  • 14. Robert Collins CSE486, Penn State Step-by-Step Derivation Further collecting the dw/dpi terms into a matrix, we can write: which are the terms in the matrix equation: ~ W [ I (W ([ x, y ]; P  P)) ~ [ I (W ([ x, y ]; P))  I P P
  • 15. Robert Collins Example: Jacobian of Affine Warp CSE486, Penn State Let W([x, y]; P)  [Wx , Wy ] general equation of Jacobian  Wx Wx Wx Wx   W  P P P P   1 2 3 n  P Wy Wy Wy Wy    P  1 P2 P3 P  n  affine warp function (6 parameters)  x  xP  yP3  P5  1   x W xP2  y  yP4  P6  1  p1 W ([ x, y ]; P )   p3 p5     y      p6    P P  p2 1  p4  1    x 0 y 0 1 0    0 x 0 y 0 1 
  • 16. Source: “Lucas-Kanade 20 years on: A unifying framework” Baker and Mathews, IJCV 04 Robert Collins CSE486, Penn State Iterate Warp I to obtain I(W([x y];P)) Compute the error image T(x) – I(W([x y]; P)) Warp the gradient I with W([x y]; P) W Evaluate at ([x y]; P) (Jacobian) P W Compute steepest descent images I P W T W Compute Hessian matrix  (I P ) (I P ) W T Compute  ( I P ) (T ( x, y )  I (W ([ x, y ]; P ))) Compute P Update P P + P Until P magnitude is negligible Dr. Ng Teck Khim
  • 17. Robert Collins CSE486, Penn State Algorithm At a Glance Source: “Lucas-Kanade 20 years on: A unifying framework” Baker and Mathews, IJCV 04
  • 18. Robert Collins State of the Art Lucas Kanade Tracking CSE486, Penn State Tracking facial mesh models (piecewise affine) QuickTime™ and a YUV420 codec decompressor are needed to see this picture. Baker, Matthews, CMU