tracking using the kalman filter. point tracking estimate the location of a given point along a...

31
Tracking using the Kalman Filter

Post on 21-Dec-2015

215 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Tracking using the Kalman Filter. Point Tracking Estimate the location of a given point along a sequence of images. (x 0,y 0 ) (x n,y n )

Tracking

using the

Kalman Filter

Page 2: Tracking using the Kalman Filter. Point Tracking Estimate the location of a given point along a sequence of images. (x 0,y 0 ) (x n,y n )

Point Tracking

Estimate the location of a given point along a sequence of images.

(x0,y0)

(xn,yn)

Page 3: Tracking using the Kalman Filter. Point Tracking Estimate the location of a given point along a sequence of images. (x 0,y 0 ) (x n,y n )

Object Tracking

– Generate some conclusions about the motion of the scene, objects, or the camera, given a sequence of images.

– Knowing this motion, predict where things are going to project in the next image, so that we don’t have so much work looking for them.

– For example- unstable camera + Walking man:

a. Stabilize the camera using the dominant motion ( find motion parameters ! )

b. Assume that the man translates horizontally.

Page 4: Tracking using the Kalman Filter. Point Tracking Estimate the location of a given point along a sequence of images. (x 0,y 0 ) (x n,y n )
Page 5: Tracking using the Kalman Filter. Point Tracking Estimate the location of a given point along a sequence of images. (x 0,y 0 ) (x n,y n )
Page 6: Tracking using the Kalman Filter. Point Tracking Estimate the location of a given point along a sequence of images. (x 0,y 0 ) (x n,y n )
Page 7: Tracking using the Kalman Filter. Point Tracking Estimate the location of a given point along a sequence of images. (x 0,y 0 ) (x n,y n )
Page 8: Tracking using the Kalman Filter. Point Tracking Estimate the location of a given point along a sequence of images. (x 0,y 0 ) (x n,y n )
Page 9: Tracking using the Kalman Filter. Point Tracking Estimate the location of a given point along a sequence of images. (x 0,y 0 ) (x n,y n )

Modeling “noise” or “uncertainty”

rotation

Page 10: Tracking using the Kalman Filter. Point Tracking Estimate the location of a given point along a sequence of images. (x 0,y 0 ) (x n,y n )
Page 11: Tracking using the Kalman Filter. Point Tracking Estimate the location of a given point along a sequence of images. (x 0,y 0 ) (x n,y n )

The General Model

kkkk wxAx 1

kkkk vxHz

Dynamics Process noise~N(0,Q)

ProjectionMeasurement noise

~N(0,R)

Page 12: Tracking using the Kalman Filter. Point Tracking Estimate the location of a given point along a sequence of images. (x 0,y 0 ) (x n,y n )

Prediction

kk xAx ˆˆ 1

QApAp Tkk 1

Estimated state

Estimated uncertainty / noise

Page 13: Tracking using the Kalman Filter. Point Tracking Estimate the location of a given point along a sequence of images. (x 0,y 0 ) (x n,y n )

Update

Updated state

Updated uncertainty / noise

)ˆ(ˆˆ 1111 kkkk xHzKxx

11 )( kk pKHIp

111 )(

RHPHHPK Tk

Tk

The weighting factor

Page 14: Tracking using the Kalman Filter. Point Tracking Estimate the location of a given point along a sequence of images. (x 0,y 0 ) (x n,y n )

kk xAx ˆˆ 1

QApAp Tkk 1

)ˆ(ˆˆ 1111 kkkk xHzKxx

11 )( kk pKHIp

111 )(

RHPHHPK Tk

Tk

Prediction Update

Summery

Page 15: Tracking using the Kalman Filter. Point Tracking Estimate the location of a given point along a sequence of images. (x 0,y 0 ) (x n,y n )

Gaussian: “Normal” distribution

• 1D Gaussian:

• General Gaussian:

),(~ vNx

v

xx

eexp 2

)(

2

)( 2

2

2

)(

TxVxexp )()(2/1 1

)(

),(~ VNx

Page 16: Tracking using the Kalman Filter. Point Tracking Estimate the location of a given point along a sequence of images. (x 0,y 0 ) (x n,y n )

Adding two information sources

• We are given to information sources: Z1 and Z2

• Both are normally distributed (v1 > v2)

• We would like to believe more to Z2, but still use the information from Z1 !

• Mathematically:

),(~)|( 111 vNZxp ),(~)|( 222 vNZxp

)|()|(),|( 2121 zxpzxpzzxp

Page 17: Tracking using the Kalman Filter. Point Tracking Estimate the location of a given point along a sequence of images. (x 0,y 0 ) (x n,y n )

The solution

1

21

2

)(

1)|( v

x

ezxp

2

22

2

)(

2 )|( v

x

ezxp

2

22

1

21

2

)(

2

)(

2121 )()(),( v

zx

v

zx

eexzpxzpxzzp

),(~),|( 21 vNZZxp

221

11

21

2 vv

v

vv

v

21

111

vvv

Page 18: Tracking using the Kalman Filter. Point Tracking Estimate the location of a given point along a sequence of images. (x 0,y 0 ) (x n,y n )

The solution (cont’)

)( 121 k

21

21

vv

vvv

21

1

vv

vK

Page 19: Tracking using the Kalman Filter. Point Tracking Estimate the location of a given point along a sequence of images. (x 0,y 0 ) (x n,y n )

The merging of two Gaussians

A “noisy” measure, be don’t believe it very much

A more reliable measure

Page 20: Tracking using the Kalman Filter. Point Tracking Estimate the location of a given point along a sequence of images. (x 0,y 0 ) (x n,y n )

The merging of two Gaussians (cont’)

The result is a new Gaussian with a smaller variance than the original ones !

Page 21: Tracking using the Kalman Filter. Point Tracking Estimate the location of a given point along a sequence of images. (x 0,y 0 ) (x n,y n )

Why to use the normal distribution?

• Simple to manipulate

• Minimize the squared error.

• The “big numbers” low.

• The distribution of many “natural” things.

Page 22: Tracking using the Kalman Filter. Point Tracking Estimate the location of a given point along a sequence of images. (x 0,y 0 ) (x n,y n )

What happens when we have a “wrong” estimation of the measurements variance ?

The correct variance (The same variance that was used to simulate the points)

The variance is too small:The estimation doesn’t converge

The variance is too large:The convergence is very slow

Page 23: Tracking using the Kalman Filter. Point Tracking Estimate the location of a given point along a sequence of images. (x 0,y 0 ) (x n,y n )

Tracking using the Kalman Filter Two more examples.

Page 24: Tracking using the Kalman Filter. Point Tracking Estimate the location of a given point along a sequence of images. (x 0,y 0 ) (x n,y n )

The General Model

kkkk wxAx 1

kkkk vxHz

Dynamics Process noise

ProjectionMeasurement noise

Page 25: Tracking using the Kalman Filter. Point Tracking Estimate the location of a given point along a sequence of images. (x 0,y 0 ) (x n,y n )

Example 1: Estimating a constant

kk xx 1 )0,( kk wIA

kkk vxz

Measurement noise

)( IHk

1, Rzx kk

Page 26: Tracking using the Kalman Filter. Point Tracking Estimate the location of a given point along a sequence of images. (x 0,y 0 ) (x n,y n )

Prediction: kk xx ˆˆ 1

kk pp 1Update

)ˆ(ˆˆ 1111 kkkk xzKxx

11 )1( kk pKp

11

1

kk

k

VP

PK

Page 27: Tracking using the Kalman Filter. Point Tracking Estimate the location of a given point along a sequence of images. (x 0,y 0 ) (x n,y n )

We can combine the prediction and update

)ˆ(ˆˆ 11 kkkk xzKxx

kk pKp )1(1

1

kk

k

VP

PK

Page 28: Tracking using the Kalman Filter. Point Tracking Estimate the location of a given point along a sequence of images. (x 0,y 0 ) (x n,y n )

Claim1:

Claim2:

Conclusion:The Kalman filter gives a weighted

mean !

k

i ik VP 0

11

i

k

i ik

k ZVP

X

0

i

k

i iik Z

VVX

0

1)

/1

1(ˆ

Page 29: Tracking using the Kalman Filter. Point Tracking Estimate the location of a given point along a sequence of images. (x 0,y 0 ) (x n,y n )

Example 2 : Shihab4

In X: constant velocityIn Y: constant

acceleration

Page 30: Tracking using the Kalman Filter. Point Tracking Estimate the location of a given point along a sequence of images. (x 0,y 0 ) (x n,y n )

Example2 -dynamics

kkk tvyy 1

kkk tavv 1

kk aa 1

kkk tuxx 1

kk uu 1

k

k

k

k

k

k

u

x

a

v

y

X

Page 31: Tracking using the Kalman Filter. Point Tracking Estimate the location of a given point along a sequence of images. (x 0,y 0 ) (x n,y n )

Example2 -measurements

• For each possible location, give a score• Normalize the sum of the scores to 1.• The result is a matrix of “probabilities” for

each location.• Fit a 2D Gaussian to this matrix, whose

center is given by:

Given an image of the missile (or other source of information):

k

kk y

xZ