2. TRAFFIC CONGESTION
Traffic congestion and an irregularity of traffic laws are the
major problems of our system that needs to be addressed
Traffic congestion is a result of mismanagement of the
traffic system
3. OUR CONSIDERATION
The consideration of traffic lights for controlling traffic
congestion, can play an important role in the traffic
management system .
It can decrease vehicle accidents.
Our project is Raspberry Pi based shall revitalize the existing
system with some innovation.
It counts the number of vehicles on a two-way road which
helps us to calculate the density of the vehicles on that
particular road, which in turn possibly gets us an idea to
manage the traffic management system.
4. PROCEDURE
This system capable of detecting motion of the vehicles
along with their speeds on a two-way road using Raspberry
Pi model 3B.
Our model is programmed with the help of Python
programming language and it uses OpenCV library that
provides webcam to the microprocessor for image
processing.
It uses video streaming that detects fast moving vehicles
and tracks their motional activity.
5. LIVE STREAMING OPEN
CV
VEHICLE COUNTING SPEED TRACKING
Tracking Motion
Activity
Horizontal Lines for
roads
Image Processing
Records Image date
& time
CSV file & WEB
database
In Selected Area
Restricted Motion
Photo with Speed
Captured
Directions of wrong way going cars are
noted
Detect largest moving
Object
Bar Graph of all Speeds
SQL, WEB and CSV
database
Mobile Notifications
USB WebcamRaspberry Pi 3
6. METHODOLOGY
System is designed for getting images from the webcam
where moving objects in the video are framed and
processed.
A vehicle is considered as a rectangular shape. To identify
each vehicle, a rectangular shape of known dimension is
drawn on the street so as to align the vehicle on that
particular rectangle on the road.
Whenever a vehicle passes, An OpenCV background
segmentation algorithm (Mixture of Gaussians Segmenter,
BackgroundSubtractorMOG2) is run.
7. We decided to track entering or leaving Activity when they cross
a vertical or horizontal center line.
At first, it was a simple counter but now it also allows for options
to take an image and update a csv file.
You can add more features if you are familiar with python
programming.
MAIN IDEA: IMPLEMENTATION
OF CONCEPT # 1
Enter: 0 Leave: 0
8. Enter: 1 Leave: 0
On passing the vertical or horizontal lines (both modes are available)
the counter value is changed.
On passing of a single vehicle or more the camera also captured the
image and save it in its database.
On a two way road, it can notify about the heavy traffic on any route
where the system is installed.
9. When the vehicles on the road side increases it will generate an
automatic notification.
The notification is linked to the command of the signal.
Through a set of loops we can calculate the density of traffic on both
sides of the roads.
As per the notification the signal timer is adjusted using seven
segment display counter.
The whole process is automated. There is no need of human
intervention in it.
Image Processing
(Vehicle Counter)
Density
Calculation
Signal Timer
Adjustment
11. MAIN IDEA: IMPLEMENTATION
OF CONCEPT # 2
The system not only track entering or leaving Activity when they cross
the area, but it also records the location and movement.
At first, it was a simple counter but now it also allows for options to
detect if intruder is on wrong way.
The database recorded indicates the movement of a car from right to
left and left to right.
If there is a one-way road, it will generate a notification to traffic
controller for breaking of rules.
Enter: 0 Leave: 0
Right to Left
12. Here we have attached the screenshot of readings of the vehicle
movement
13. MAIN IDEA: IMPLEMENTATION OF
CONCEPT # 3
The system also measures the speed of a moving vehicle in a certain
area.
At first, it was a simple counter and movement indicator but now it can
measure the speed of vehicles using opencv and image processing.
The image of every vehicle with time and date stamp is recorded on a
web database
There is also the bar graph plot to indicate the highest speed
The system is capable of generating alerts in all such cases
We track the x,y coordinates of the largest moving object in the camera
view above a minimum pixel area. Motion detection is restricted
between y_upper, y_lower, x_left, x_right variables (road or area of
interest). If a track is longer than track_len_trig variable then average
speed will be calculated and a speed photo will be taken and saved in
media/images.
14. RESULT
The bar graph shows the data collected after
implementation of our project, showing the number of
vehicles passing hour by hour in a day.
It shows the testing of the algorithm on different images
processed for tracking and counting vehicle extracted from
the video made by our webcam place on the road.
This will incorporate us the calculation of the speed of
vehicles passing along the road, with their time and date of
passing.
15. Here we have attached the screenshot of readings of the vehicle
movement