This projects aims to estimate the velocity of vehicles moving on road from the CCTV footage of the road.
The implementation uses Lucas Kanade algorithm along with Optical Flow for generating a set of good points and tracking then for estimating the velocity of the moving object. Background removal using KNN algorithm is used for instantiating the tracking process whenever a new object is detected.
- OpenCV2
sudo apt-get install python-opencv
- Python2.x
- numpy
sudo pip install numpy
- Inside
global_variables.py
replacevideo_path
with the path of your video - Replace
top_left
andbottom_right
with the coordinates of the box inside which you want to track the object - Run the file named
automatic_track.py
usingpython2
or simplypython automatic_track.py
- Use
ESC
key to exit from the video