Skip to content

This is a rough estimation of a traffic flow using OpenCV library. It was tested by Python 3.9 and OpenCV 4.5.1.

License

Notifications You must be signed in to change notification settings

saeid-h/Traffic-Tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Traffic Tracker

This is a rough estimation of traffic flow using OpenCV library. It was tested by Python 3.9 and OpenCV 4.0

Requirements

Make sure you have installed the following requirements:

  • Python3.9
  • OpenCV 4.0
  • numpy, imutils, argparse
git clone https://github.com/saeid-h/Traffic-Tracker.git
# If you do not have python3.9, install it. 
# It might be working with other version of Python, but it's not tested before.

# Make virtual environment
virtualenv -p /usr/bin/python3.9 venv
# Activate the environment
source venv/bin/activate
pip install <libraries>

Demo

Try the main.py

python main.py --video-file $YOURVIDEO 

You may turn off the layer by adding the following switches:

python main.py --video-file $YOURVIDEO --no-speed-check
python main.py --video-file $YOURVIDEO --no-heatmap
python main.py --video-file $YOURVIDEO --no-car-detection

There hyper paramers that you can change them:

--blur-window <int>
--threshold <int>
--object-area <int>
--invalid-length <int>
--dilation-kernel <int>
--dilation-iter <int>
--heatmap-threshold <int>
--speed-limit <int>

You may also download a sample video here

About

This is a rough estimation of a traffic flow using OpenCV library. It was tested by Python 3.9 and OpenCV 4.5.1.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages