38
1 6.869 Computer Vision Prof. Bill Freeman Particle Filter Tracking Particle filtering Readings: F&P Extra Chapter: “Particle Filtering”

Particle Filter Tracking - courses.csail.mit.edu

  • Upload
    others

  • View
    13

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Particle Filter Tracking - courses.csail.mit.edu

1

6.869

Computer Vision

Prof. Bill Freeman

Particle Filter Tracking – Particle filtering

Readings: F&P Extra Chapter: “Particle Filtering”

Page 2: Particle Filter Tracking - courses.csail.mit.edu

2

Schedule

• Tuesday, May 3: – Particle filters, tracking humans, Exam 2 out

• Thursday, May 5: – Tracking humans, and how to write conference papers

& give talks, Exam 2 due

• Tuesday, May 10:– Motion microscopy, separating shading and paint (“fun

things my group is doing”)

• Thursday, May 12: – 5-10 min. student project presentations, projects due.

Page 3: Particle Filter Tracking - courses.csail.mit.edu

3

1D Kalman filter

Page 4: Particle Filter Tracking - courses.csail.mit.edu

4

Kalman filter for computing an on-line average

• What Kalman filter parameters and initial conditions should we pick so that the optimal estimate for x at each iteration is just the average of all the observations seen so far?

Page 5: Particle Filter Tracking - courses.csail.mit.edu

5

Iteration 0 1 2

∞== −−00 0 σx

+

+

i

i

i

i

x

x

σ

σ

0

1,0,1,1 ====ii mdii md σσ

Kalman filter model

Initial conditions

0y

1

0y

1

210 yy +

21

210 yy +

21

3210 yyy ++

31

Page 6: Particle Filter Tracking - courses.csail.mit.edu

6

What happens if the x dynamics are given a non-zero variance?

Page 7: Particle Filter Tracking - courses.csail.mit.edu

7

Iteration 0 1 2

∞== −−00 0 σx

+

+

i

i

i

i

x

x

σ

σ

0

0y

1,1,1,1 ====ii mdii md σσ

Kalman filter model

Initial conditions

1

0y

2

32 10 yy +

32

35

852 210 yyy ++

85

32 10 yy +

Page 8: Particle Filter Tracking - courses.csail.mit.edu

(KF) Distribution propagation

8

prediction from previous time frame

Noise added to

that prediction

Make new measurement at next time frame

[Isard 1998]

Page 9: Particle Filter Tracking - courses.csail.mit.edu

Distribution propagation

9[Isard 1998]

Page 10: Particle Filter Tracking - courses.csail.mit.edu

10

Representing non-linear Distributions

Page 11: Particle Filter Tracking - courses.csail.mit.edu

11

Representing non-linear Distributions

Unimodal parametric models fail to capture real-world densities…

Page 12: Particle Filter Tracking - courses.csail.mit.edu

12

Representing non-linear Distributions

Mixture models are appealing, but very hard to propagate analytically!

Page 13: Particle Filter Tracking - courses.csail.mit.edu

13

Representing Distributions using Weighted Samples

Rather than a parametric form, use a set of samples to represent a density:

Page 14: Particle Filter Tracking - courses.csail.mit.edu

14

Representing Distributions using Weighted Samples

Rather than a parametric form, use a set of samples to represent a density:

Page 15: Particle Filter Tracking - courses.csail.mit.edu

Representing distributions using weighted samples, another picture

15[Isard 1998]

Page 16: Particle Filter Tracking - courses.csail.mit.edu

16

Sampled representation of a probability distribution

You can also think of this as a sum of dirac delta functions, each of weight w:

∑ −=i

iif uxwxp )()( δ

Page 17: Particle Filter Tracking - courses.csail.mit.edu

17

Marginalizing a sampled density

If we have a sampled representation of a joint density

and we wish to marginalize over one variable:

we can simply ignore the corresponding components of the samples (!):

Page 18: Particle Filter Tracking - courses.csail.mit.edu

18

Marginalizing a sampled density

Page 19: Particle Filter Tracking - courses.csail.mit.edu

19

Sampled Bayes Rule

Transforming a Sampled Representation of a Prior into a Sampled Representation of a Posterior:

posterior likelihood, prior

Page 20: Particle Filter Tracking - courses.csail.mit.edu

20

Sampled Bayes rule

Page 21: Particle Filter Tracking - courses.csail.mit.edu

21

Sampled Prediction= ?

~=Drop elements to marginalize to get

Page 22: Particle Filter Tracking - courses.csail.mit.edu

22

Sampled Correction (Bayes rule)

Prior posteriorReweight every sample with the likelihood of the

observations, given that sample:

yielding a set of samples describing the probability distribution after the correction (update) step:

Page 23: Particle Filter Tracking - courses.csail.mit.edu

23

Naïve PF Tracking

• Start with samples from something simple (Gaussian)

• Repeat

But doesn’t work that well because of sample impoverishment…

– Predict

– Correct

Page 24: Particle Filter Tracking - courses.csail.mit.edu

24

Sample impoverishment

Test with linear case:

kf: xpf: o

Page 25: Particle Filter Tracking - courses.csail.mit.edu

25

Sample impoverishment

10 of the 100 particles, along with the true Kalmanfilter track, with variance:

time

Page 26: Particle Filter Tracking - courses.csail.mit.edu

26

Resample the prior

In a sampled density representation, the frequency of samples can be traded off against weight:

These new samples are a representation of the same density.

I.e., make N draws with replacement from the original set of samples, using the weights as the probability of drawing a sample.

s.t.

Page 27: Particle Filter Tracking - courses.csail.mit.edu

27

Resampling concentrates samples

Page 28: Particle Filter Tracking - courses.csail.mit.edu

28

A practical particle filter with resampling

Page 29: Particle Filter Tracking - courses.csail.mit.edu

A variant (predict, then resample, then correct)

29[Isard 1998]

Page 30: Particle Filter Tracking - courses.csail.mit.edu

30

Page 31: Particle Filter Tracking - courses.csail.mit.edu

31

A variant (animation)

[Isard 1998]

Page 32: Particle Filter Tracking - courses.csail.mit.edu

32

Applications

Tracking– hands– bodies– leaves

Page 33: Particle Filter Tracking - courses.csail.mit.edu

Contour tracking

33[Isard 1998]

Page 34: Particle Filter Tracking - courses.csail.mit.edu

Head tracking

34[Isard 1998]

Page 35: Particle Filter Tracking - courses.csail.mit.edu

35

Leaf tracking

[Isard 1998]

Page 36: Particle Filter Tracking - courses.csail.mit.edu

36

Hand tracking

[Isard 1998]

Page 37: Particle Filter Tracking - courses.csail.mit.edu

37

Mixed state tracking

[Isard 1998]

Page 38: Particle Filter Tracking - courses.csail.mit.edu

38

Outline

• Sampling densities• Particle filtering

[Figures from F&P except as noted]