Multiple point tracker in 2D and 3D using Probability Density Approximation Filters (PDAF)
Using PDAF Filters to predict, track and estimate position of multiple points. It can deal with occlusion, tracking loss, intersection and different point motion profiles.
This code implements multiple target tracking in 2 and 3 dimensions using Numpy only. It is inspired by work of Y. Bar-Shalom related to Probabilistic Data Association Filters (PDAF).
Main file "pdaf_tracker.py" does the following:
- Generates number of points moving on different trajectories.
- Adds clutter and noisy points.
- Initializes the tracking structures.
- Implements multiple target tracking over the time.
- The tracking supports multiple target initiation, occlusion and loss.
- Uses Kalamn filter to track in time.
This code could be extended to multiple dimensions, target moving profiles and noise. The tracking algorithm tries to follow the original PDAF algorithm. However, some shortcuts are made. Several parameters control the behavior of the tracking.
You are invited to try and comment me on this code.
The motion of the points couild have differnt patterns and trajectroies. The trajectory may have noise, missing data and clutter. File "data_generator.py" contains function "init_scenario()" that allows to select the trajectories, noise and clutter as below.
| Simple Trajectory | Trajectories with Missing Data | Trajectories with Noise |
|---|---|---|
Trajectroies of points could vary , which in turn affects velocity and acceleration to be estimated
| Trajectory with Clutter | Multiple Trajectories | Complex Trajectories |
|---|---|---|
Multiple trackers are used to trace the trajectories. Each tracker is initialized from a random starting point. It uses second point to initialize velocity and direction. The same "data_generator.py" contains function "init_scenario()" that allows to select how many trackers, kalman parameters for initialization.
| Crossing Trackers | Crossing Trajectories with Recover | One Trajectory Two trackers |
|---|---|---|
-
In python environment:
python pdaf_tracker.py
-
In the PowerShell:
python.exe -m venv \envs\pdaf
-
Activate environment in Cmd:
\envs\pdaf\Scripts\activate.bat
-
Install packages :
pip install numpy
-
Install packages (just for visualization):
pip install matplotlib