The system uses image processing to control traffic. Traffic density of lanes is calculated using image processing which is done using images of lanes that are captured using a camera and compared to reference images of lanes with no traffic. According to the traffic densities on all roads, our model will allocate intelligently the time period of green light for each road. We have chosen image processing for calculation of traffic density as cameras are readily available infrastructure on road intersections.
- Raspberry Pi Model 3
- Web Camera
- GSM Module
- Thingspeak Account
- Python 3.4+
- OpenCV 3.2.0 compiled with Python3 support
- RaspberryPi GPIO Libraries for Python
- MySQL
- Raspbian Jessie (or equivalent)
- Log into your ThingSpeak account.
- Create a channel.
- Get the API write key for the channel.
- Paste the value in
sample.py
- Add the
analysis.m
file to the channel. - Once the script is running on the Pi (directions below) the data can be seen on the ThingSpeak dashboard.
To run the script,
ssh
onto a Raspberry Pi and paste the contents of theraspi-scripts
folder onto the Raspberry Pi.- Run
python3 sample.py