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




                            Lecture 22:
                         Camera Motion

                     Readings: T&V Sec 8.1 and 8.2
Robert Collins
CSE486, Penn State
                           Moving Camera

                          t-3               t-2
               t-4

                                                         Tx
                                    pitch
                                                                        t+2
                          t-1                           Ty
                                  roll            yaw              Tz



                                            t                t+1

            Camera takes a sequence of images (frames)
            indexed by time t
            From one time to the next, the camera undergoes
            rotation (roll, pitch, yaw) and translation (tx,ty,tz)
Robert Collins
CSE486, Penn State
                     Motion (Displacement) Fields

               Time t
                                      Displacement field




              Time t+1
Robert Collins
CSE486, Penn State
                     Motion Field vs Optic Flow

          Motion Field: projection of 3D relative velocity
           vectors onto the 2D image plane.

          Optic Flow: observed 2D displacements of
            brightness patterns in the image.

           Motion field is what we want to know.
           Optic flow is what we can estimate.
Robert Collins
CSE486, Penn State
                     Motion Field vs Optic Flow
                Sometimes optic flow is a good approximation
                to the unknown motion flow.




                                                     optic flow field




                We can then infer relative motion between
                the camera and objects in the world.
Robert Collins
                 Warning: Optic Flow ≠ Motion Field
CSE486, Penn State




         Consider a moving light source:




      MF = 0 since the points on the scene are not moving
      OF ≠ 0 since there is a moving pattern in the images
Robert Collins
CSE486, Penn State
                             Motion Field


               We are going to derive an equation relating
                    3D scene structure and velocity
               to the
                    2D motion flow field.
Robert Collins
CSE486, Penn State
                            Motion Field

           What is a Field anyways?

           Image a vector at each point in space. This is a
           vector field. In 3D space, we will look at the field
           of 3D velocity vectors induced by camera motion.

           In 2D, we will be looking at the projections of those
           3D vectors in the image. There will be a 2D flow
           vector at each point in the image. This is the 2D
           motion flow field.
Robert Collins

              Recall : General Projection Equation
CSE486, Penn State




                         Internal
                         params           Projection          Relative R,T




           Strategy:
           1) Assume internal params known (set to identity)
           2) At time t, set R=I, T=0
           3) At time t+1, movement generates a relative R and T
                     simplifying assumption: small motion --> small rotation
           4) Compute 3D velocity vector
           5) Compute 2D velocity vector
                     a function of X,Y,Z,R,T,f
Robert Collins

                 Displacement of 3D World Point
CSE486, Penn State




          Time t: 3D position P
          Time t+1: 3D position RP+T

          3D Displacement = RP+T - P

          Now consider short time period (like time between
          two video frames = 1/30 sec). Can assume a small
          rotation angle in that amount of time. Make a small
          angle approximation and rewrite displacement. In the
          limit (infinitesimal time period), we will get a velocity.
Robert Collins       Write Rotation matrix in terms of Euler Angles
CSE486, Penn State
Robert Collins
CSE486, Penn State
Robert Collins
CSE486, Penn State
                     Small Angle Approx


                                 for small angle x

                                   cos x ≈ 1
                                  sin x ≈ x
                                sin x sin y ≈ 0
                     x
Robert Collins
CSE486, Penn State
Robert Collins
CSE486, Penn State
                                            3D Velocity
          Under small angle approx,
          displacement = RP+T - P
                       = (I+S)P+T-P
                       = SP+T

          Note: SP = [θx, θy, θz]T X P

          In limit, displacement becomes a velocity

                                  V=T+ωXP                                             where
                     3D velocity
                                                           angular velocity
                                     linear velocity
                     Caution: Abuse of notation ==> we are re-using T as a velocity
Robert Collins
CSE486, Penn State
                            3D Relative Velocity

                        V        The relative velocity of P wrt camera:
                            P

            v
           p
       f                    Z   z



                     Note: we change signs of the velocity to be
                     consistent with the book. This should not
                     cause concern. It just depends on whether
                     you want to think of the motion as being due
                     to the camera or the scene.
Camps, PSU
Robert Collins
CSE486, Penn State
                         3D Relative Velocity

                     V       The relative velocity of P wrt camera:
                         P

            v
           p
       f                 Z   z




Camps, PSU
Robert Collins
CSE486, Penn State
                             3D Relative Velocity
                     V
                                    Where are we in this lecture?
                         P

              v
                                    • We just derived an equation
          p                         relating R,T and to the 3D
      f                  Z     z    velocity vector at each scene
                                    point.
          • We can think of that velocity as a little vector in
          the scene.

          • Now ask, what does the projection of that vector
          look like in the image? It is a 2D vector. It is one
          of the vectors that make up the Motion Field!
Robert Collins

                Motion Field: the 2D velocity of p
CSE486, Penn State




                     V                            Perspective
                                                  projection
                         P

            v                    Taking derivative wrt time:
           p
       f                 Z   z




Camps, PSU
Robert Collins
CSE486, Penn State
                     Motion Field: the velocity of p

                       V
                           P

            v
           p
       f                   Z   z




Camps, PSU
Robert Collins
CSE486, Penn State
                     Motion Field: the velocity of p

                       V
                           P

            v
           p
       f                   Z   z




Camps, PSU
Robert Collins
CSE486, Penn State
                     Motion Field: the velocity of p

                       V
                           P

            v
           p
       f                   Z   z




Camps, PSU
                     THIS IS THE EQUATION WE WANT!!!!
Robert Collins
CSE486, Penn State
                     Motion Field: the velocity of p

                       V
                           P          Translational
                                       component
            v
           p
       f                   Z   z




Camps, PSU
Robert Collins
CSE486, Penn State
                     Motion Field: the velocity of p

                       V
                           P           Rotational
                                       component
            v
           p
       f                   Z   z




   NOTE: The rotational component is independent of depth Z !
Camps, PSU
Robert Collins

                 Special Case I: Pure Translation
CSE486, Penn State




            Assume Tz ≠ 0

                     Define:




Camps, PSU
Robert Collins

                 Special Case I: Pure Translation
CSE486, Penn State




            What if Tz = 0 ?




    All motion field vectors are parallel to each other and
    inversely proportional to depth !

Camps, PSU
                               TIE IN WITH SIMPLE STEREO!
Robert Collins

                 Special Case I: Pure Translation
CSE486, Penn State




                                    Tz > 0          Tz < 0
          The motion field in this case is RADIAL:
          •It consists of vectors passing through po = (xo,yo)
          •If:
             • Tz > 0, (camera moving towards object)
                • the vectors point away from po
                •po is the POINT OF EXPANSION
             • Tz < 0, (camera moving away from object)
                •the vectors point towards po
                •po is the POINT OF CONTRACTION
Camps, PSU
Robert Collins
CSE486, Penn State
                      Pure Translation:
                     Properties of the MF

         • If Tz≠ 0 the MF is RADIAL with all vectors
           pointing towards (or away from) a single
           point po. If Tz = 0 the MF is PARALLEL.

         • The length of the MF vectors is inversely
           proportional to depth Z. If Tz ≠ 0 it is also
           directly proportional to the distance
           between p and po.


Camps, PSU
Robert Collins
CSE486, Penn State
                      Pure Translation:
                     Properties of the MF

         • po is the vanishing point of the direction of
           translation.

         • po is the intersection of the ray parallel to
           the translation vector and the image plane.




Camps, PSU
Robert Collins
CSE486, Penn State
                     Special Case II: Moving Plane
   Self-study


                      V           Planar surfaces are common
                              n
                          P       in man-made environments

            v
           p
       f                  Z   z


       Question: How does the MF of a moving plane look like?




Camps, PSU
Robert Collins
CSE486, Penn State
                     Special Case II: Moving Plane
   Self-study
                                   Points on the plane must satisfy the
           X                       equation describing the plane.
                           n
                       P           Let
             d
                                      •n be the unit vector normal to the plane.
         O                            •d be the distance from the plane to the
  Y                            Z
                                      origin.
                                      •NOTE: If the plane is moving wrt
                                      camera, n and d are functions of time.
  Then:


                                         where


Camps, PSU
Robert Collins
CSE486, Penn State
                     Special Case II: Moving Plane
   Self-study

              X                                     be the image of P
                                     Let
                             n
                         P           Using the pinhole
                d
                                     projection equation:
                     p

  Y        O                     Z


      Using the plane equation:

      Solving for Z:

Camps, PSU
Robert Collins
CSE486, Penn State
                     Special Case II: Moving Plane
    Self-study
         X
                                  Now consider the MF equations:
                          n
           d          P
               p
Y      O                      Z

    And Plug in:




Camps, PSU
Robert Collins
CSE486, Penn State
                     Special Case II: Moving Plane
    Self-study
         X
                                  The MF equations become:
                          n
           d          P
               p
Y      O                      Z

     where




Camps, PSU
Robert Collins
CSE486, Penn State
                     Special Case II: Moving Plane
    Self-study
         X
                                      MF equations:
                          n
           d          P
               p
Y      O                      Z

    Q: What is the significance of this?
        A: The MF vectors are given by low order (second)
        polynomials.
               •Their coeffs. a1 to a8 (only 8 !) are functions of n, d, T and ω.
               •That is, can estimate 8 param global flow rather than 2 params
                  per pixel! Huge savings in time and robustness.

Camps, PSU
Robert Collins
CSE486, Penn State
                     Application: Time to Collision
   Self-study


                                   An object of height L moves with
                         v
                                   constant velocity v:
                                   •At time t=0 the object is at:
                         L    L
       l(t)                           • D(0) = Do
  f                  t       t=0
                                   •At time t it is at
                Do                    •D(t) = Do – vt
                D(t)               •It will crash into the camera at
                                   time:
                                      • D(τ) = Do – vτ = 0
                                      • τ = Do/v
Camps, PSU
Robert Collins
CSE486, Penn State
                               Time to Collision
   Self-study

                                   The image of the object has size l(t):
                         v


                         L    L
       l(t)
                                     Taking derivative wrt time:
  f                  t       t=0

                Do
                D(t)




Camps, PSU
Robert Collins
CSE486, Penn State
                               Time to Collision
   Self-study


                         v


                         L    L
       l(t)
  f                  t       t=0

                Do
                D(t)




Camps, PSU
Robert Collins
CSE486, Penn State
                               Time to Collision
   Self-study


                         v


                         L    L
       l(t)
  f                  t       t=0

                Do                 And their ratio is:

                D(t)




Camps, PSU
Robert Collins
CSE486, Penn State
                               Time to Collision
   Self-study


                         v                                  Can be
                                                            directly
                                                            measured
                         L    L
       l(t)                                                 from image
  f                  t       t=0

                Do                 And time to collision:

                D(t)


      Can be found, without knowing L or Do or v !!

Camps, PSU
Robert Collins
CSE486, Penn State




        Application: Decomposition of Vehicle Flow Field
         into Rotational and Translational Components

                     Motivation
                       •Estimate steering angles
                       •Computation of scene structure simplifies
                          when rotational motion is removed
Robert Collins
CSE486, Penn State
                      Review: Flow Due to Self-Motion
                         Note: I’ve changed sign again!

     Flow:


                                          Rotation               Translation




                     Rotation component              Translation component
Robert Collins
CSE486, Penn State
                                     Approach

            Use prior knowledge of car’s likely motion to simplify the problem.
            Assume we know approx direction of translation (Tx,Ty,Tz)
               [ e.g. if driving forward, we choose (0,0,1) ]
            Assume roll angle of motion (wz) is 0
            Problem reduces to solving for pitch and yaw angles (wx and wy)


                                                                    known
                                     0
Robert Collins
CSE486, Penn State
                          Approach (continued)

            For each observed flow vector, form a linear constraint on wx and wy
            by taking the dot product of the flow equation with a new vector that
            is constructed to “annihilate” the translation component of flow.

                                                            Note: these are all
            This annihilation vector is                     known values!




            Verify:


                                                                            0
Robert Collins
CSE486, Penn State
                           Approach (continued)
           For each observed flow vector, we annihilate the translation component
           to form one linear constraint of the form (ai wx + bi wy + ci ) = 0.

           Given the whole set of n observed flow vectors, we seek wx and wy
           that simultaneously satisfy the set of n linear equations

           Geometric intuition:
                     image space                        solution space
                                              wy




                                                                         wx
Robert Collins
CSE486, Penn State
                              Use Robust Estimator
       Solving using least-squares will be sensitive to outliers (grossly incorrect data).
       Instead, we use a robust estimator (Random Sample Consensus – RANSAC).




                                                                              red: outliers
                                                                              blue: inliers


     least-squares solution




                                              robust solution
Robert Collins
CSE486, Penn State
Robert Collins
CSE486, Penn State
Robert Collins
CSE486, Penn State
Robert Collins
CSE486, Penn State
Robert Collins
CSE486, Penn State
Robert Collins
CSE486, Penn State
Robert Collins
CSE486, Penn State
Robert Collins
CSE486, Penn State

More Related Content

Viewers also liked

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
 
05 cv mil_normal_distribution
05 cv mil_normal_distribution05 cv mil_normal_distribution
05 cv mil_normal_distributionzukun
 
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
 
Lecture15
Lecture15Lecture15
Lecture15zukun
 
Modern features-part-4-evaluation
Modern features-part-4-evaluationModern features-part-4-evaluation
Modern features-part-4-evaluationzukun
 
My lyn tutorial 2009
My lyn tutorial 2009My lyn tutorial 2009
My lyn tutorial 2009zukun
 

Viewers also liked (7)

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
 
05 cv mil_normal_distribution
05 cv mil_normal_distribution05 cv mil_normal_distribution
05 cv mil_normal_distribution
 
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
 
Lecture15
Lecture15Lecture15
Lecture15
 
Modern features-part-4-evaluation
Modern features-part-4-evaluationModern features-part-4-evaluation
Modern features-part-4-evaluation
 
My lyn tutorial 2009
My lyn tutorial 2009My lyn tutorial 2009
My lyn tutorial 2009
 

Similar to Lecture22

Lecture23
Lecture23Lecture23
Lecture23zukun
 
Lecture17
Lecture17Lecture17
Lecture17zukun
 
Lecture28
Lecture28Lecture28
Lecture28zukun
 
Lecture28
Lecture28Lecture28
Lecture28zukun
 
Lecture13
Lecture13Lecture13
Lecture13zukun
 
Lecture21
Lecture21Lecture21
Lecture21zukun
 
Lecture21
Lecture21Lecture21
Lecture21zukun
 
Lecture31
Lecture31Lecture31
Lecture31zukun
 
Lecture12
Lecture12Lecture12
Lecture12zukun
 
Lecture02
Lecture02Lecture02
Lecture02zukun
 
Lecture06
Lecture06Lecture06
Lecture06zukun
 
Lecture24
Lecture24Lecture24
Lecture24zukun
 
Lecture30
Lecture30Lecture30
Lecture30zukun
 
Lecture30
Lecture30Lecture30
Lecture30zukun
 
Lecture20
Lecture20Lecture20
Lecture20zukun
 
Lecture03
Lecture03Lecture03
Lecture03zukun
 
Lecture01
Lecture01Lecture01
Lecture01zukun
 

Similar to Lecture22 (17)

Lecture23
Lecture23Lecture23
Lecture23
 
Lecture17
Lecture17Lecture17
Lecture17
 
Lecture28
Lecture28Lecture28
Lecture28
 
Lecture28
Lecture28Lecture28
Lecture28
 
Lecture13
Lecture13Lecture13
Lecture13
 
Lecture21
Lecture21Lecture21
Lecture21
 
Lecture21
Lecture21Lecture21
Lecture21
 
Lecture31
Lecture31Lecture31
Lecture31
 
Lecture12
Lecture12Lecture12
Lecture12
 
Lecture02
Lecture02Lecture02
Lecture02
 
Lecture06
Lecture06Lecture06
Lecture06
 
Lecture24
Lecture24Lecture24
Lecture24
 
Lecture30
Lecture30Lecture30
Lecture30
 
Lecture30
Lecture30Lecture30
Lecture30
 
Lecture20
Lecture20Lecture20
Lecture20
 
Lecture03
Lecture03Lecture03
Lecture03
 
Lecture01
Lecture01Lecture01
Lecture01
 

More from zukun

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
 
Icml2012 learning hierarchies of invariant features
Icml2012 learning hierarchies of invariant featuresIcml2012 learning hierarchies of invariant features
Icml2012 learning hierarchies of invariant featureszukun
 
ECCV2010: Modeling Temporal Structure of Decomposable Motion Segments for Act...
ECCV2010: Modeling Temporal Structure of Decomposable Motion Segments for Act...ECCV2010: Modeling Temporal Structure of Decomposable Motion Segments for Act...
ECCV2010: Modeling Temporal Structure of Decomposable Motion Segments for Act...zukun
 
Quoc le tera-scale deep learning
Quoc le   tera-scale deep learningQuoc le   tera-scale deep learning
Quoc le tera-scale deep learningzukun
 
Deep Learning workshop 2010: Deep Learning of Invariant Spatiotemporal Featur...
Deep Learning workshop 2010: Deep Learning of Invariant Spatiotemporal Featur...Deep Learning workshop 2010: Deep Learning of Invariant Spatiotemporal Featur...
Deep Learning workshop 2010: Deep Learning of Invariant Spatiotemporal Featur...zukun
 
Lecun 20060816-ciar-01-energy based learning
Lecun 20060816-ciar-01-energy based learningLecun 20060816-ciar-01-energy based learning
Lecun 20060816-ciar-01-energy based learningzukun
 
Lecun 20060816-ciar-02-deep learning for generic object recognition
Lecun 20060816-ciar-02-deep learning for generic object recognitionLecun 20060816-ciar-02-deep learning for generic object recognition
Lecun 20060816-ciar-02-deep learning for generic object recognitionzukun
 
P05 deep boltzmann machines cvpr2012 deep learning methods for vision
P05 deep boltzmann machines cvpr2012 deep learning methods for visionP05 deep boltzmann machines cvpr2012 deep learning methods for vision
P05 deep boltzmann machines cvpr2012 deep learning methods for visionzukun
 

More from zukun (20)

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
 
Icml2012 learning hierarchies of invariant features
Icml2012 learning hierarchies of invariant featuresIcml2012 learning hierarchies of invariant features
Icml2012 learning hierarchies of invariant features
 
ECCV2010: Modeling Temporal Structure of Decomposable Motion Segments for Act...
ECCV2010: Modeling Temporal Structure of Decomposable Motion Segments for Act...ECCV2010: Modeling Temporal Structure of Decomposable Motion Segments for Act...
ECCV2010: Modeling Temporal Structure of Decomposable Motion Segments for Act...
 
Quoc le tera-scale deep learning
Quoc le   tera-scale deep learningQuoc le   tera-scale deep learning
Quoc le tera-scale deep learning
 
Deep Learning workshop 2010: Deep Learning of Invariant Spatiotemporal Featur...
Deep Learning workshop 2010: Deep Learning of Invariant Spatiotemporal Featur...Deep Learning workshop 2010: Deep Learning of Invariant Spatiotemporal Featur...
Deep Learning workshop 2010: Deep Learning of Invariant Spatiotemporal Featur...
 
Lecun 20060816-ciar-01-energy based learning
Lecun 20060816-ciar-01-energy based learningLecun 20060816-ciar-01-energy based learning
Lecun 20060816-ciar-01-energy based learning
 
Lecun 20060816-ciar-02-deep learning for generic object recognition
Lecun 20060816-ciar-02-deep learning for generic object recognitionLecun 20060816-ciar-02-deep learning for generic object recognition
Lecun 20060816-ciar-02-deep learning for generic object recognition
 
P05 deep boltzmann machines cvpr2012 deep learning methods for vision
P05 deep boltzmann machines cvpr2012 deep learning methods for visionP05 deep boltzmann machines cvpr2012 deep learning methods for vision
P05 deep boltzmann machines cvpr2012 deep learning methods for vision
 

Lecture22

  • 1. Robert Collins CSE486, Penn State Lecture 22: Camera Motion Readings: T&V Sec 8.1 and 8.2
  • 2. Robert Collins CSE486, Penn State Moving Camera t-3 t-2 t-4 Tx pitch t+2 t-1 Ty roll yaw Tz t t+1 Camera takes a sequence of images (frames) indexed by time t From one time to the next, the camera undergoes rotation (roll, pitch, yaw) and translation (tx,ty,tz)
  • 3. Robert Collins CSE486, Penn State Motion (Displacement) Fields Time t Displacement field Time t+1
  • 4. Robert Collins CSE486, Penn State Motion Field vs Optic Flow Motion Field: projection of 3D relative velocity vectors onto the 2D image plane. Optic Flow: observed 2D displacements of brightness patterns in the image. Motion field is what we want to know. Optic flow is what we can estimate.
  • 5. Robert Collins CSE486, Penn State Motion Field vs Optic Flow Sometimes optic flow is a good approximation to the unknown motion flow. optic flow field We can then infer relative motion between the camera and objects in the world.
  • 6. Robert Collins Warning: Optic Flow ≠ Motion Field CSE486, Penn State Consider a moving light source: MF = 0 since the points on the scene are not moving OF ≠ 0 since there is a moving pattern in the images
  • 7. Robert Collins CSE486, Penn State Motion Field We are going to derive an equation relating 3D scene structure and velocity to the 2D motion flow field.
  • 8. Robert Collins CSE486, Penn State Motion Field What is a Field anyways? Image a vector at each point in space. This is a vector field. In 3D space, we will look at the field of 3D velocity vectors induced by camera motion. In 2D, we will be looking at the projections of those 3D vectors in the image. There will be a 2D flow vector at each point in the image. This is the 2D motion flow field.
  • 9. Robert Collins Recall : General Projection Equation CSE486, Penn State Internal params Projection Relative R,T Strategy: 1) Assume internal params known (set to identity) 2) At time t, set R=I, T=0 3) At time t+1, movement generates a relative R and T simplifying assumption: small motion --> small rotation 4) Compute 3D velocity vector 5) Compute 2D velocity vector a function of X,Y,Z,R,T,f
  • 10. Robert Collins Displacement of 3D World Point CSE486, Penn State Time t: 3D position P Time t+1: 3D position RP+T 3D Displacement = RP+T - P Now consider short time period (like time between two video frames = 1/30 sec). Can assume a small rotation angle in that amount of time. Make a small angle approximation and rewrite displacement. In the limit (infinitesimal time period), we will get a velocity.
  • 11. Robert Collins Write Rotation matrix in terms of Euler Angles CSE486, Penn State
  • 13. Robert Collins CSE486, Penn State Small Angle Approx for small angle x cos x ≈ 1 sin x ≈ x sin x sin y ≈ 0 x
  • 15. Robert Collins CSE486, Penn State 3D Velocity Under small angle approx, displacement = RP+T - P = (I+S)P+T-P = SP+T Note: SP = [θx, θy, θz]T X P In limit, displacement becomes a velocity V=T+ωXP where 3D velocity angular velocity linear velocity Caution: Abuse of notation ==> we are re-using T as a velocity
  • 16. Robert Collins CSE486, Penn State 3D Relative Velocity V The relative velocity of P wrt camera: P v p f Z z Note: we change signs of the velocity to be consistent with the book. This should not cause concern. It just depends on whether you want to think of the motion as being due to the camera or the scene. Camps, PSU
  • 17. Robert Collins CSE486, Penn State 3D Relative Velocity V The relative velocity of P wrt camera: P v p f Z z Camps, PSU
  • 18. Robert Collins CSE486, Penn State 3D Relative Velocity V Where are we in this lecture? P v • We just derived an equation p relating R,T and to the 3D f Z z velocity vector at each scene point. • We can think of that velocity as a little vector in the scene. • Now ask, what does the projection of that vector look like in the image? It is a 2D vector. It is one of the vectors that make up the Motion Field!
  • 19. Robert Collins Motion Field: the 2D velocity of p CSE486, Penn State V Perspective projection P v Taking derivative wrt time: p f Z z Camps, PSU
  • 20. Robert Collins CSE486, Penn State Motion Field: the velocity of p V P v p f Z z Camps, PSU
  • 21. Robert Collins CSE486, Penn State Motion Field: the velocity of p V P v p f Z z Camps, PSU
  • 22. Robert Collins CSE486, Penn State Motion Field: the velocity of p V P v p f Z z Camps, PSU THIS IS THE EQUATION WE WANT!!!!
  • 23. Robert Collins CSE486, Penn State Motion Field: the velocity of p V P Translational component v p f Z z Camps, PSU
  • 24. Robert Collins CSE486, Penn State Motion Field: the velocity of p V P Rotational component v p f Z z NOTE: The rotational component is independent of depth Z ! Camps, PSU
  • 25. Robert Collins Special Case I: Pure Translation CSE486, Penn State Assume Tz ≠ 0 Define: Camps, PSU
  • 26. Robert Collins Special Case I: Pure Translation CSE486, Penn State What if Tz = 0 ? All motion field vectors are parallel to each other and inversely proportional to depth ! Camps, PSU TIE IN WITH SIMPLE STEREO!
  • 27. Robert Collins Special Case I: Pure Translation CSE486, Penn State Tz > 0 Tz < 0 The motion field in this case is RADIAL: •It consists of vectors passing through po = (xo,yo) •If: • Tz > 0, (camera moving towards object) • the vectors point away from po •po is the POINT OF EXPANSION • Tz < 0, (camera moving away from object) •the vectors point towards po •po is the POINT OF CONTRACTION Camps, PSU
  • 28. Robert Collins CSE486, Penn State Pure Translation: Properties of the MF • If Tz≠ 0 the MF is RADIAL with all vectors pointing towards (or away from) a single point po. If Tz = 0 the MF is PARALLEL. • The length of the MF vectors is inversely proportional to depth Z. If Tz ≠ 0 it is also directly proportional to the distance between p and po. Camps, PSU
  • 29. Robert Collins CSE486, Penn State Pure Translation: Properties of the MF • po is the vanishing point of the direction of translation. • po is the intersection of the ray parallel to the translation vector and the image plane. Camps, PSU
  • 30. Robert Collins CSE486, Penn State Special Case II: Moving Plane Self-study V Planar surfaces are common n P in man-made environments v p f Z z Question: How does the MF of a moving plane look like? Camps, PSU
  • 31. Robert Collins CSE486, Penn State Special Case II: Moving Plane Self-study Points on the plane must satisfy the X equation describing the plane. n P Let d •n be the unit vector normal to the plane. O •d be the distance from the plane to the Y Z origin. •NOTE: If the plane is moving wrt camera, n and d are functions of time. Then: where Camps, PSU
  • 32. Robert Collins CSE486, Penn State Special Case II: Moving Plane Self-study X be the image of P Let n P Using the pinhole d projection equation: p Y O Z Using the plane equation: Solving for Z: Camps, PSU
  • 33. Robert Collins CSE486, Penn State Special Case II: Moving Plane Self-study X Now consider the MF equations: n d P p Y O Z And Plug in: Camps, PSU
  • 34. Robert Collins CSE486, Penn State Special Case II: Moving Plane Self-study X The MF equations become: n d P p Y O Z where Camps, PSU
  • 35. Robert Collins CSE486, Penn State Special Case II: Moving Plane Self-study X MF equations: n d P p Y O Z Q: What is the significance of this? A: The MF vectors are given by low order (second) polynomials. •Their coeffs. a1 to a8 (only 8 !) are functions of n, d, T and ω. •That is, can estimate 8 param global flow rather than 2 params per pixel! Huge savings in time and robustness. Camps, PSU
  • 36. Robert Collins CSE486, Penn State Application: Time to Collision Self-study An object of height L moves with v constant velocity v: •At time t=0 the object is at: L L l(t) • D(0) = Do f t t=0 •At time t it is at Do •D(t) = Do – vt D(t) •It will crash into the camera at time: • D(τ) = Do – vτ = 0 • τ = Do/v Camps, PSU
  • 37. Robert Collins CSE486, Penn State Time to Collision Self-study The image of the object has size l(t): v L L l(t) Taking derivative wrt time: f t t=0 Do D(t) Camps, PSU
  • 38. Robert Collins CSE486, Penn State Time to Collision Self-study v L L l(t) f t t=0 Do D(t) Camps, PSU
  • 39. Robert Collins CSE486, Penn State Time to Collision Self-study v L L l(t) f t t=0 Do And their ratio is: D(t) Camps, PSU
  • 40. Robert Collins CSE486, Penn State Time to Collision Self-study v Can be directly measured L L l(t) from image f t t=0 Do And time to collision: D(t) Can be found, without knowing L or Do or v !! Camps, PSU
  • 41. Robert Collins CSE486, Penn State Application: Decomposition of Vehicle Flow Field into Rotational and Translational Components Motivation •Estimate steering angles •Computation of scene structure simplifies when rotational motion is removed
  • 42. Robert Collins CSE486, Penn State Review: Flow Due to Self-Motion Note: I’ve changed sign again! Flow: Rotation Translation Rotation component Translation component
  • 43. Robert Collins CSE486, Penn State Approach Use prior knowledge of car’s likely motion to simplify the problem. Assume we know approx direction of translation (Tx,Ty,Tz) [ e.g. if driving forward, we choose (0,0,1) ] Assume roll angle of motion (wz) is 0 Problem reduces to solving for pitch and yaw angles (wx and wy) known 0
  • 44. Robert Collins CSE486, Penn State Approach (continued) For each observed flow vector, form a linear constraint on wx and wy by taking the dot product of the flow equation with a new vector that is constructed to “annihilate” the translation component of flow. Note: these are all This annihilation vector is known values! Verify: 0
  • 45. Robert Collins CSE486, Penn State Approach (continued) For each observed flow vector, we annihilate the translation component to form one linear constraint of the form (ai wx + bi wy + ci ) = 0. Given the whole set of n observed flow vectors, we seek wx and wy that simultaneously satisfy the set of n linear equations Geometric intuition: image space solution space wy wx
  • 46. Robert Collins CSE486, Penn State Use Robust Estimator Solving using least-squares will be sensitive to outliers (grossly incorrect data). Instead, we use a robust estimator (Random Sample Consensus – RANSAC). red: outliers blue: inliers least-squares solution robust solution