: 5.1.2 - - PowerPoint PPT Presentation

5 1 2 forsyth ponce
SMART_READER_LITE
LIVE PREVIEW

: 5.1.2 - - PowerPoint PPT Presentation

: 5.1.2 Forsyth & Ponce 18 ! Today Tracking with Dynamics Detection vs.


slide-1
SLIDE 1

הביקע

slide-2
SLIDE 2

רועישב רמוחל תורוקמ

  • דומילה רפס:

– קרפ5.1.2

  • Forsyth & Ponce

– קרפ18

  • םינוש םירמאמ
  • טנרטניאב רמוח!
slide-3
SLIDE 3

Today

  • …Tracking with Dynamics

– Detection vs. Tracking – Tracking as probabilistic inference – Prediction and Correction

  • Linear Dynamic Models
  • The Kalman Filter

– Kalman filter for 1D state – General Kalman filter – Limitations

slide-4
SLIDE 4

Detection vs. Tracking

t=1 t=2 t=20 t=21

slide-5
SLIDE 5

Detection vs. Tracking

  • Detection

– We detect the object independently in each frame and can record its position over time, e.g., based on blob’s centroid

  • r detection window coordinates.

t=1 t=2 t=20 t=21

slide-6
SLIDE 6

Detection vs. Tracking

  • Tracking with dynamics:

– We use image measurements to estimate the object position, but also incorporate the position predicted by dynamics, i.e.,

  • ur expectation of the object’s motion pattern.

t=1 t=2 t=20 t=21

slide-7
SLIDE 7

Tracking with Dynamics

  • Key idea

– Given a model of expected motion, predict where objects will occur in next frame, even before seeing the image. – In next frame, update prediction using actual measurements

slide-8
SLIDE 8

Illustration

update initial position x y x y prediction x y measurement x y

slide-9
SLIDE 9

Tracking with Dynamics

  • Key idea

– Given a model of expected motion, predict where objects will occur in next frame, even before seeing the image. – In next frame, update prediction using actual measurements

  • Goals

– Restrict search for the object – Improved estimates since measurement noise is reduced by trajectory smoothness.

  • Assumption: continuous motion patterns

– Camera is not moving instantly to new viewpoint. – Objects do not disappear and reappear in different places. – Gradual change in pose between camera and scene.

slide-10
SLIDE 10

General Model for Tracking

state state x4 state x3 state x2 state x1

y2 y3 y4 measurement y1

state x4 state x3 state x2 state x1

slide-11
SLIDE 11

General Model for Tracking

  • The moving object of interest is characterized by an

underlying state X

  • State X gives rise to measurements or observations Y
  • At each time t, the state changes to Xt and we get a

new observation Yt

X1 X2 Y1 Y2 Xt Yt

slide-12
SLIDE 12

State vs. Observation

  • Hidden state : parameters of interest (e.g., location of

point, contour of shape, etc.)

  • Measurement : what we get to directly observe (e.g., pixel

values, image features)

slide-13
SLIDE 13

Tracking as Inference

  • Our goal: recover most likely state Xt given

– All observations seen so far. – Knowledge about dynamics of state transitions.

  • In other words maximize
  • Different approaches include:

– HMMs – Kalman filters – Condensation

1...

( | )

t t

p x y

slide-14
SLIDE 14

Steps of tracking

  • Prediction: What is the next state of the object

given past measurements?

 

1 1

, ,

  

t t t

y Y y Y X P 

slide-15
SLIDE 15

Steps of tracking

  • Prediction: What is the next state of the object

given past measurements?

  • Correction: Compute an updated estimate of

the state from prediction and measurements

 

1 1

, ,

  

t t t

y Y y Y X P 

 

t t t t t

y Y y Y y Y X P   

 

, , ,

1 1

slide-16
SLIDE 16

Steps of tracking

  • Prediction: What is the next state of the object

given past measurements?

  • Correction: Compute an updated estimate of

the state from prediction and measurements

 

1 1

, ,

  

t t t

y Y y Y X P 

 

t t t t t

y Y y Y y Y X P   

 

, , ,

1 1

slide-17
SLIDE 17

Simplifying assumptions

  • Only the immediate past matters

   

1 1

, ,

   t t t t

X X P X X X P 

dynamics model

slide-18
SLIDE 18

Simplifying assumptions

  • Only the immediate past matters
  • Measurements depend only on the current state

   

1 1

, ,

   t t t t

X X P X X X P 

   

t t t t t t

X Y P X Y X Y X Y P 

 

, , , ,

1 1

  • bservation model

dynamics model

slide-19
SLIDE 19

Simplifying assumptions

  • Only the immediate past matters
  • Measurements depend only on the current state

   

1 1

, ,

   t t t t

X X P X X X P 

   

t t t t t t

X Y P X Y X Y X Y P 

 

, , , ,

1 1

  • bservation model

dynamics model X1 X2 Y1 Y2 Xt Yt

Xt-1 Yt-1

slide-20
SLIDE 20

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Tracking as Induction

  • Base case:
  • Assume we have initial prior that predicts state in absence of

any evidence: P(X0)

  • At the first frame, correct this given the value of Y0=y0

) ( ) | ( ) ( ) ( ) | ( ) | ( X P X y P y P X P X y P y Y X P   

Posterior prob.

  • f state given

measurement Likelihood of measurement Prior of the state

slide-21
SLIDE 21

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Tracking as Induction

  • Base case:
  • Assume we have initial prior that predicts state in absence of

any evidence: P(X0)

  • At the first frame, correct this given the value of Y0=y0
  • Given corrected estimate for frame t:
  • Predict for frame t+1
  • Correct for frame t+1

predict correct

slide-22
SLIDE 22

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Induction Step: Prediction

  • Prediction involves representing

given

 

1

, ,

 t t

y y X P 

 

1 1

, ,

  t t

y y X P 

 

       

1 1 1 1 1 1 1 1 1 1 1 1

, , | | , , | , , , | , , ,

           

  

  

t t t t t t t t t t t t t t t

dX y y X P X X P dX y y X P y y X X P dX y y X X P    

 

1

, ,

 t t

y y X P 

Law of total probability

   

, P A P A B dB 

slide-23
SLIDE 23

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Induction Step: Prediction

  • Prediction involves representing

given

 

1

, ,

 t t

y y X P 

 

1 1

, ,

  t t

y y X P 

 

       

1 1 1 1 1 1 1 1 1 1 1 1

, , | | , , | , , , | , , ,

           

  

  

t t t t t t t t t t t t t t t

dX y y X P X X P dX y y X P y y X X P dX y y X X P    

 

1

, ,

 t t

y y X P 

Conditioning on Xt–1

     

, | P A B P A B P B 

slide-24
SLIDE 24

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Induction Step: Prediction

  • Prediction involves representing

given

 

1

, ,

 t t

y y X P 

 

1 1

, ,

  t t

y y X P 

 

       

1 1 1 1 1 1 1 1 1 1 1 1

, , | | , , | , , , | , , ,

           

  

  

t t t t t t t t t t t t t t t

dX y y X P X X P dX y y X P y y X X P dX y y X X P    

 

1

, ,

 t t

y y X P 

Independence assumption

slide-25
SLIDE 25

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Induction Step: Correction

  • Correction involves computing

given predicted value

 

t t

y y X P , ,

0 

 

1

, ,

 t t

y y X P 

                   

      

  

t t t t t t t t t t t t t t t t t t t t t t

dX y y X P X y P y y X P X y P y y y P y y X P X y P y y y P y y X P y y X y P

1 1 1 1 1 1 1

, , | | , , | | , , | , , | | , , | , , | , , , |       

 

t t

y y X P , ,

0 

Bayes rule

       

| | P B A P A P A B P B 

slide-26
SLIDE 26

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Induction Step: Correction

  • Correction involves computing

given predicted value

 

t t

y y X P , ,

0 

 

1

, ,

 t t

y y X P 

                   

      

  

t t t t t t t t t t t t t t t t t t t t t t

dX y y X P X y P y y X P X y P y y y P y y X P X y P y y y P y y X P y y X y P

1 1 1 1 1 1 1

, , | | , , | | , , | , , | | , , | , , | , , , |       

 

t t

y y X P , ,

0 

Independence assumption (observation yt depends only on state Xt)

slide-27
SLIDE 27

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Induction Step: Correction

  • Correction involves computing

given predicted value

 

t t

y y X P , ,

0 

 

1

, ,

 t t

y y X P 

                   

      

  

t t t t t t t t t t t t t t t t t t t t t t

dX y y X P X y P y y X P X y P y y y P y y X P X y P y y y P y y X P y y X y P

1 1 1 1 1 1 1

, , | | , , | | , , | , , | | , , | , , | , , , |       

 

t t

y y X P , ,

0 

Conditioning on Xt

slide-28
SLIDE 28

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Induction Step: Correction

  • Correction involves computing

given predicted value

 

t t

y y X P , ,

0 

 

1

, ,

 t t

y y X P 

                   

      

  

t t t t t t t t t t t t t t t t t t t t t t

dX y y X P X y P y y X P X y P y y y P y y X P X y P y y y P y y X P y y X y P

1 1 1 1 1 1 1

, , | | , , | | , , | , , | | , , | , , | , , , |       

 

t t

y y X P , ,

0 

  • bservation

model predicted estimate normalization factor

slide-29
SLIDE 29

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Summary: Prediction and Correction

  • Prediction:

     

1 1 1 1 1

, , | | , , |

    

t t t t t t t

dX y y X P X X P y y X P  

Dynamics model Corrected estimate from previous step

slide-30
SLIDE 30

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Summary: Prediction and Correction

  • Prediction:
  • Correction:

31

  • B. Leibe

     

1 1 1 1 1

, , | | , , |

    

t t t t t t t

dX y y X P X X P y y X P  

Dynamics model Corrected estimate from previous step

         

 

t t t t t t t t t t t

dX y y X P X y P y y X P X y P y y X P

1 1

, , | | , , | | , , |   

Observation model Predicted estimate

slide-31
SLIDE 31

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Topics of This Lecture

  • Tracking with Dynamics
  • Detection vs. Tracking
  • Tracking as probabilistic inference
  • Prediction and Correction
  • Linear Dynamic Models
  • The Kalman Filter
  • Kalman filter for 1D state
  • General Kalman filter
  • Limitations

32

  • B. Leibe
slide-32
SLIDE 32

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Notation Reminder

  • Random variable with Gaussian probability distribution

that has the mean vector μ and covariance matrix Σ.

  • x and μ are d-dimensional, Σ is d x d.

33

  • B. Leibe

) , ( ~ Σ μ x N

d=2 d=1 If x is 1D, we just have one Σ parameter: the variance σ2

slide-33
SLIDE 33

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Linear Dynamic Models

  • Dynamics model
  • State undergoes linear tranformation Dt plus Gaussian noise
  • Observation model
  • Measurement is linearly transformed state plus Gaussian noise

34

  • B. Leibe

 

1

~ ,

t

t t t d

N

 

x D x

 

~ ,

t

t t t m

N  y M x

nn n1 n1 m1 mn n1

slide-34
SLIDE 34

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Example 1: Randomly Drifting Points

  • Consider a stationary object, with state as position.
  • Position is constant, only motion due to random noise term.

 State evolution is described by identity matrix D=I

35

  • B. Leibe

1 t t

p p 

 

t t

x p 

1 1 t t t t

x D x noise Ip noise

 

   

slide-35
SLIDE 35

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Example 2: Constant Velocity (1D Points)

36

  • B. Leibe

time Measurements States

Figure from Forsyth & Ponce

slide-36
SLIDE 36

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Example 2: Constant Velocity (1D Points)

  • State vector: position p and velocity v
  • Measurement is position only

       

   1 1 1

) (

t t t t t

v v v t p p

      

t t t

v p x noise v p t noise x D x

t t t t t

                

   1 1 1

1 1

(greek letters denote noise terms)

 

noise v p noise Mx y

t t t t

          1

slide-37
SLIDE 37

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Example 3: Constant Accel. (1D Points)

38

  • B. Leibe

Figure from Forsyth & Ponce

slide-38
SLIDE 38

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Example 3: Constant Accel. (1D Points)

  • State vector: position p, velocity v, and acceleration a.
  • Measurement is position only

39

            

     1 1 1 1 1

) ( ) (

t t t t t t t t

a a a t v v v t p p

          

t t t t

a v p x

noise a v p t t noise x D x

t t t t t t

                         

    1 1 1 1

1 1 1

(greek letters denote noise terms)

 

noise a v p noise Mx y

t t t t t

              1

slide-39
SLIDE 39

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Topics of This Lecture

  • Tracking with Dynamics
  • Detection vs. Tracking
  • Tracking as probabilistic inference
  • Prediction and Correction
  • Linear Dynamic Models
  • The Kalman Filter
  • Kalman filter for 1D state
  • General Kalman filter
  • Limitations

40

  • B. Leibe
slide-40
SLIDE 40

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

The Kalman Filter

  • Method for tracking linear dynamical models in

Gaussian noise

  • The predicted/corrected state distributions are

Gaussian

  • You only need to maintain the mean and covariance.
  • The calculations are easy (all the integrals can be done in

closed form).

41

  • B. Leibe
slide-41
SLIDE 41

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Propagation of Gaussian densities

slide-42
SLIDE 42

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

The Kalman Filter

43

  • B. Leibe

Know prediction of state, and next measurement Update distribution over current state. Know corrected state from previous time step, and all measurements up to the current one  Predict distribution over next state. Time advances: t++ Time update (“Predict”) Measurement update (“Correct”) Receive measurement

 

1

, ,

 t t

y y X P 

  t t 

 ,

Mean and std. dev.

  • f predicted state:

 

t t

y y X P , ,

0 

  t t 

 ,

Mean and std. dev.

  • f corrected state:
slide-43
SLIDE 43

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Kalman Filter for 1D State

44

  • B. Leibe

Want to represent and update

 

 

2 1

) ( , , ,

    t t t t

N y y x P   

 

 

2

) ( , , ,

 

t t t t

N y y x P   

slide-44
SLIDE 44

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

1D Kalman Filter: Prediction

  • Have linear dynamic model defining predicted state

evolution, with noise

  • Want to estimate predicted distribution for next state
  • Update the mean:
  • Update the variance:

45

  • B. Leibe

    1 t t

d 

 

 

2 1

) ( , , ,

    t t t t

N y y X P   

 

2 1,

~

d t t

dx N X 

2 1 2 2

) ( ) (

  

 

t d t

d  

for derivations, see F&P Chapter 18

slide-45
SLIDE 45

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

1D Kalman Filter: Correction

  • Have linear model defining the mapping of state to

measurements:

  • Want to estimate corrected distribution given latest

measurement:

  • Update the mean:
  • Update the variance:

46

  • B. Leibe

 

2

, ~

m t t

mx N Y 

 

 

2

) ( , , ,

 

t t t t

N y y X P   

2 2 2 2 2

) ( ) (

   

  

t m t t m t t

m my      

2 2 2 2 2 2

) ( ) ( ) (

  

 

t m t m t

m     

Derivations: F&P Chapter 18

slide-46
SLIDE 46

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Prediction vs. Correction

  • What if there is no prediction uncertainty
  • What if there is no measurement uncertainty

47

  • B. Leibe

   t t

  ) (

2   t

2 2 2 2 2

) ( ) (

   

  

t m t t m t t

m my      

2 2 2 2 2 2

) ( ) ( ) (

  

 

t m t m t

m     

? ) ( 

m

? ) ( 

 t

m yt

t  

 ) (

2   t

The measurement is ignored! The prediction is ignored!

slide-47
SLIDE 47

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Recall: Constant Velocity Example

48

  • B. Leibe

State is 2D: position + velocity Measurement is 1D: position measurements state time position

Figure from Forsyth & Ponce

slide-48
SLIDE 48

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Constant Velocity Model

49

  • B. Leibe
  • state

x measurement * predicted mean estimate + corrected mean estimate bars: variance estimates before and after measurements

Figure from Forsyth & Ponce

slide-49
SLIDE 49

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Constant Velocity Model

50

  • B. Leibe
  • state

x measurement * predicted mean estimate + corrected mean estimate bars: variance estimates before and after measurements

Figure from Forsyth & Ponce

slide-50
SLIDE 50

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Constant Velocity Model

51

  • B. Leibe
  • state

x measurement * predicted mean estimate + corrected mean estimate bars: variance estimates before and after measurements

Figure from Forsyth & Ponce

slide-51
SLIDE 51

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Constant Velocity Model

52

  • B. Leibe
  • state

x measurement * predicted mean estimate + corrected mean estimate bars: variance estimates before and after measurements

Figure from Forsyth & Ponce

slide-52
SLIDE 52

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Kalman Filter: General Case (>1dim)

  • What if state vectors have more than one dimension?

53

  • B. Leibe

PREDICT CORRECT

    1 t t t

x D x

t

d T t t t t

D D     

   1

 

  

  

t t t t t t

x M y K x x

 

 

   

t t t t

M K I

 

1   

    

t

m T t t t T t t t

M M M K

More weight on residual when measurement error covariance approaches 0. Less weight on residual as a priori estimate error covariance approaches 0. “residual” for derivations, see F&P Chapter 18

slide-53
SLIDE 53

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Summary: Kalman Filter

  • Pros:
  • Gaussian densities everywhere
  • Simple updates, compact and efficient
  • Very established method, very well understood
  • Cons:
  • Unimodal distribution, only single hypothesis
  • Restricted class of motions defined by linear model

54

  • B. Leibe
slide-54
SLIDE 54

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Why Is This A Restriction?

  • Many interesting cases don’t have linear dynamics
  • E.g. pedestrians walking
  • E.g. a ball bouncing

55

  • B. Leibe
slide-55
SLIDE 55

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Ball Example: What Goes Wrong Here?

  • Assuming constant acceleration model
  • Prediction is too far

from true position to compensate…

  • Possible solution:

Extended Kalman Filter

  • Keeps multiple different

motion models in parallel

  • I.e. would check for

bouncing at each time step

56

  • B. Leibe

Prediction t1 Prediction t3 Prediction t2 Prediction t4 Prediction t5 Correct prediction

slide-56
SLIDE 56

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Tracking issues

  • Deciding on the structure of the model
  • Initialization
  • Specifying the dynamics model
  • Specifying the observation model
  • Data association problem: which measurements tell

us about the object(s) being tracked?

slide-57
SLIDE 57

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Data association

  • Simple strategy: only pay attention to the measurement

that is “closest” to the prediction

slide-58
SLIDE 58

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Data association

  • Simple strategy: only pay attention to the measurement

that is “closest” to the prediction

Doesn’t always work…

slide-59
SLIDE 59

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Data association

  • Simple strategy: only pay attention to the measurement

that is “closest” to the prediction

  • More sophisticated strategy: keep track of multiple

state/observation hypotheses

  • This is a general problem in computer vision, there is no

easy solution

slide-60
SLIDE 60

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Tracking issues

  • Deciding on the structure of the model
  • Initialization
  • Specifying the dynamics model
  • Specifying the observation model
  • Data association problem
  • Prediction vs. correction
  • If the dynamics model is too strong, will end up

ignoring the data

  • If the observation model is too strong, tracking is

reduced to repeated detection

  • Drift
slide-61
SLIDE 61

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

Drift

  • D. Ramanan, D. Forsyth, and A. Zisserman. Tracking People by Learning their
  • Appearance. PAMI 2007.
slide-62
SLIDE 62

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

םויה וניאר המ זא?

slide-63
SLIDE 63

Perceptual and Sensory Augmented Computing Computer Vision WS 08/09

םוכיס

  • תיתורבתסה הקסה תייעבכ הביקע
  • תכרעמ בצמ יונישל םייראניל םילדומ
  • Kalman filtering
  • Particle Filtering
slide-64
SLIDE 64

Good luck!