rlabbe / filterpy

Python Kalman filtering and optimal estimation library. Implements Kalman filter, particle filter, Extended Kalman filter, Unscented Kalman filter, g-h (alpha-beta), least squares, H Infinity, smoothers, and more. Has companion book 'Kalman and Bayesian Filters in Python'.
MIT License
3.23k stars 614 forks source link

Smoothing object trajectories from an object tracker - real time #250

Open wjassim opened 2 years ago

wjassim commented 2 years ago

Hi,

Thank you very much for providing filterpy. It is a great library.

I just wanted to ask about how to smooth real time data with filterpy. I want to smooth the trajectory of an object predicted by an object tracker. For each video frame, the tracker predicts two values which are x- and y- coordinates of the tracked object. Because of some tracking errors, such as noise or occlusion when two objects being tracked occlude each other, the position of the target is slightly changing so I feel jitter most of the time. Is it possible to reduce that jitter online (when new elements appear one by one) to make the path more smooth?

I have seen some examples on https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/blob/master/experiments/1d_kf_compare.ipynb which use KalmanFilter and LeastSquaresFilter for smoothing but I am not sure which algorithm is better. Thanks a million..