The algorithm detects and tracks objects in video using SORT algorithm. For all objects, their projection to road plane is calculated (i.e. camera calibration is necessary). Location of objects on the road plane is filtered by Kalman Filter - which gives us the ability to predict future movement of objects. If the future path of an object strikes warning zone, alarm event is emitted. The event contains detailed description of the offensive behaviour, like location on screen and in the world, relative speed and direction of object, and time of entering the warning zone.
There are few basic requirements for the algorithm itself
numpy
pyyaml
opencv-python
orpy-opencv
if you use condapillow
shapely
filterpy
pytorch
Additional packages are required if you want to use the service as a Network Application within 5G-Era framework/
- TODO
As an example, we use the video posted by u/Big-Replacement-7684 in r/IdiotsInCars showing typical dangerous situation that might result in car crash.
# This will load configurations for video3.mp4 and show visualization.
> python fcw_example.py
Relevant configurations are in videos/video3.yaml
- camera config, and config/config.yaml
algorithm settings.
TODO
We use slightly modified version of SORT tracker from abewley gitub repository.