Tracking 2: Particle Filters CS 4495 Computer Vision – A. Bobick CS 4495 Computer Vision Tracking 2: Particle Filters Aaron Bobick School of Interactive Computing
Tracking 2: Particle Filters CS 4495 Computer Vision – A. Bobick Administrivia • PS5 due on Sunday Nov 10, 11:55pm • PS6 out Thurs Nov 14, due Nov 24 th • EXAM: Tues before Thanksgiving, Nov 26 th Covers concepts and basics • Problem set resubmission policy: • Full questions only • You get 50% credit to replace whatever you got last time on that question. • Must be submitted by: DEC 1. NO EXCEPTIONS.
Tracking 2: Particle Filters CS 4495 Computer Vision – A. Bobick First some Matlab flow…
Tracking 2: Particle Filters CS 4495 Computer Vision – A. Bobick Tracking • Slides still “adapted” from Kristen Grauman, Deva Ramanan, but mostly from Svetlana Lazebnik • And now more adaptations from Sebastian Thrun, Dieter Fox and someone who did great particle filter illustrations but whose name is lost to web thievery….
Tracking 2: Particle Filters CS 4495 Computer Vision – A. Bobick Recall: Some examples • http://www.youtube.com/watch?v=InqV34BcheM
Tracking 2: Particle Filters CS 4495 Computer Vision – A. Bobick Detection vs. tracking … t=1 t=2 t=20 t=21
Tracking 2: Particle Filters CS 4495 Computer Vision – A. Bobick 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 or detection window coordinates
Tracking 2: Particle Filters CS 4495 Computer Vision – A. Bobick Detection vs. tracking … Tracking with dynamics : We use image measurements to estimate position of object, but also incorporate position predicted by dynamics, i.e., our expectation of object’s motion pattern.
Tracking 2: Particle Filters CS 4495 Computer Vision – A. Bobick Tracking with dynamics • Use model of expected motion to predict where objects will occur in next frame, even before seeing the image. • Intent : • Do less work looking for the object, restrict the search. • Get improved estimates since measurement noise is tempered by smoothness, dynamics priors. • Assumption : continuous motion patterns: • Camera is not moving instantly to new viewpoint • Objects do not disappear and reappear in different places in the scene • Gradual change in pose between camera and scene
Tracking 2: Particle Filters CS 4495 Computer Vision – A. Bobick Tracking as induction • Base case: • Assume we have initial prior that predicts state in absence of any evidence: P ( X 0 ) • At the first frame , correct this given the value of Y 0 = y 0 • Given corrected estimate for frame t : • Predict for frame t +1 • Correct for frame t +1 predict correct
Tracking 2: Particle Filters CS 4495 Computer Vision – A. Bobick Steps of tracking • Prediction: What is the next state of the object given past measurements? ( ) = − = , , P X Y y Y y − 0 0 1 1 t t t • Correction: Compute an updated estimate of the state from prediction and measurements ( ) = = = , , , P X Y y Y y Y y − − 0 0 1 1 t t t t t • Tracking can be seen as the process of propagating the posterior distribution of state given measurements across time
Tracking 2: Particle Filters CS 4495 Computer Vision – A. Bobick Simplifying assumptions • Only the immediate past matters ( ) ( ) = , , P X X X P X X − − 0 1 1 t t t t dynamics model • Measurements depend only on the current state ( ) ( ) = , , , , P Y X Y X Y X P Y X − − 0 0 1 1 t t t t t t observation model
Tracking 2: Particle Filters CS 4495 Computer Vision – A. Bobick Linear Dynamic Models • Dynamics model: state undergoes linear tranformation plus Gaussian noise ( ) Σ ~ − , X N D x • 1 t t t d t • Observation model: measurement is linearly transformed state plus Gaussian noise ( ) Σ ~ , Y N M x t t t m t
Tracking 2: Particle Filters CS 4495 Computer Vision – A. Bobick Example: Constant velocity (1D) • State vector is position and velocity = + ∆ + ε ( ) (greek letters p p t v p − − 1 1 = t t t t denote noise x = + ξ t v v terms) v − 1 t t t ∆ 1 p t − = + = + 1 t x D x noise noise − 1 t t t 0 1 v − 1 t • Measurement is position only p [ ] = + = + t 1 0 y Mx noise noise t t v t
Tracking 2: Particle Filters CS 4495 Computer Vision – A. Bobick Example: Constant acceleration (1D) • State vector is position, velocity, and acceleration = + ∆ + ε ( ) p p t v p − − 1 1 (greek letters t t t t = + ∆ + ξ = denote noise ( ) v v t a x v − − 1 1 t t t t t terms) = + ζ a a a − t 1 t t ∆ 1 0 t p − 1 t = + = ∆ + 0 1 x D x noise t v noise − − 1 1 t t t t 0 0 1 a − t 1 • Measurement is position only p t [ ] = + = + 1 0 0 y Mx noise v noise t t t a t
Tracking 2: Particle Filters CS 4495 Computer Vision – A. Bobick 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)
Tracking 2: Particle Filters CS 4495 Computer Vision – A. Bobick Propagation of Gaussian densities
Tracking 2: Particle Filters CS 4495 Computer Vision – A. Bobick The Kalman Filter: 1D state Make measurement Given corrected state Given prediction of from previous time state and current step and all the measurement, update measurements up to prediction of state Correct Predict the current one, predict the ( ) distribution over the 0 , , P X y y current step t t ( ) , , P X y y − 0 1 t t Time advances Mean and std. dev. Mean and std. dev. (from t –1 to t ) of predicted state: of corrected state: − − + + µ , t σ µ , t σ t t
Tracking 2: Particle Filters CS 4495 Computer Vision – A. Bobick Tracking with KFs: Gaussians! initial estimte prediction measurement update y y y y x x x x
Tracking 2: Particle Filters CS 4495 Computer Vision – A. Bobick Kalman Filters ∝ ( | ) ( | ) ( ) p x z p z x p x posterior Measurement evidence prior ∫ = ( ' ) ( ' | ) ( ) p x p x x p x dx
Tracking 2: Particle Filters CS 4495 Computer Vision – A. Bobick 1D Kalman filter: Prediction • Linear dynamic model defines predicted state evolution, with noise ( ) σ 2 ~ 1 , X N dx − t t d • Want to estimate distribution for next predicted state ( ) ( ) − − = µ σ 2 , , , ( ) P X y y N − 0 1 t t t t − = + µ d µ • Update the mean: − 1 t t − + σ = σ + d σ 2 2 2 ( ) ( ) • Update the variance: − 1 t d t
Tracking 2: Particle Filters CS 4495 Computer Vision – A. Bobick 1D Kalman filter: Correction ( ) σ 2 ~ , Y N mx • Mapping of state to measurements: t t m ( ) ( ) − − = µ σ 2 , , , ( ) P X y y N • Predicted state: − 0 1 t t t t • Want to estimate corrected distribution ( ) ( ) + + = µ σ 2 , , , ( ) P X y y N 0 t t t t − − µ σ + σ 2 2 ( ) my + µ = • Update the mean: t m t t − σ + σ t 2 2 2 ( ) m m t • Update the variance: − σ σ 2 2 ( ) + σ = 2 m t ( ) − σ + m σ t 2 2 2 ( ) m t
Tracking 2: Particle Filters CS 4495 Computer Vision – A. Bobick A Quiz ∝ ( | ) ( | ) ( ) p x y p y x p x Measurement evidence prior posterior? Does this agree with your intuition?
Tracking 2: Particle Filters CS 4495 Computer Vision – A. Bobick Kalman filter pros and cons • Pros • Simple updates, compact and efficient • Cons • Unimodal distribution, only single hypothesis • Restricted class of motions defined by linear model • So what might we do if not Gaussian? • E.g. Object seems to be detected (noisy) in two locations in the next image that are both plausible in terms of dynamics and belief where the object was in the last image.
Tracking 2: Particle Filters CS 4495 Computer Vision – A. Bobick Propagation of general densities
Tracking 2: Particle Filters CS 4495 Computer Vision – A. Bobick Before we go any further… • In particle filtering the measurements are written as 𝑨 𝑢 and not as 𝑧 𝑢 • So we’ll start seeing z’s
Tracking 2: Particle Filters CS 4495 Computer Vision – A. Bobick Particle Filters: Basic Idea ( x ) p x t set of n (weighted) particles X t Density is represented by both where the particles are and their weight . 𝑞 ( 𝑦 = 𝑦 0 ) is now probability of drawing an x with value 𝑦 0 . Goal: 𝑞 𝑦 𝑢 ∈ 𝑌 𝑢 ≈ 𝑞 𝑦 𝑢 𝑨 1 … 𝑢 with equality when 𝑜 → ∞
Recommend
More recommend