Sie sind auf Seite 1von 25

Smart Traffic Signal Control System

(STSCS)

Final Year Project

Session 2017-2019

A project submitted in partial fulfilment for the


requirements of the degree
of
Masters in Computer Science

Department of Computer Sciences


Khwaja Fareed University of Engineering and
Information Technology, Rahim Yar Khan
Project Detail

Type (Nature of project) [ ] Development [ ] Research [ ] R&D

Project Group Members

Sr.# Reg. # Student Name Email ID *Signature

(i) MCS 172054 Shafqat Mahmood Shah shafqatsha456@gmail.com

(ii) MCS 172096 Samina Abdul Karim saminakareem46@gmail.com

Plagiarism Free Certificate


This is to certify that, I am Shafqat Mahmood Shah S/O Sakhi Bad Shah, group leader of FYP under
registration no MCS 172054 at Computer Science Department, Khwaja Fareed University of Engineering and
Information Technology, Rahim Yar Khan. I declare that my FYP proposal is checked by my supervisor and the
similarity index is % that is less than 20%, an acceptable limit by HEC.

Date: 16 September 2019 Name of Group Leader: Shafqat Mahmood Shah Signature: _________________

Name of Supervisor: Mr. Mateen Ahmed Abbasi


Designation: Lecturer
Signature: _________________

HoD: Dr. Saleem Ullah


Signature: _________________

i|P a g e
Abstract

We propose a system for controlling the traffic light by image processing. The automobiles
are detected by the system through images. A camera will be placed alongside the traffic
light. It will capture image orders. Image Processing is a better technique to control the state
variation of the traffic light. It shows that it can decrease the traffic jamming and avoids the
time being wasted by a green light on a bare road.

ii | P a g e
Acknowledgement
We are thankful our Creator Allah Subhana-Watala who gave us an opportunity to
use best of our knowledge and encouraged us to carry out this work. Without his
guidance we wouldn’t have achieved this accomplishment. Whosoever helped us
throughout the course of our project, whether our parents or any other individual was
his will, so indeed none be worthy of praise but him.
We are thankful for our parents for her prayers and blessings. Her wishes to see us
achieve greater heights in our education and career has motivated us throughout our
life.
Our heartily thanks to our supervisor Mr. Mateen Ahmed Abbasi for great kind of
guidance and giving us a great kind of supervision. We owe our deepest gratitude to
our project supervisor for his patient guidance, motivation and appreciation throughout
this work. Our deep gratitude goes to him for showing endless faith in us. We much
esteemed to have worked under his supervision.
We also highly obliged and grateful to our project committee members for their
valuable feedback in our project. We express our gratitude to him for actively
encouraging and for all the support they had provided during the course of this study.
Additionally, we would like to express our gratitude towards everyone who provided
us assistance in any stage of this project.

iii | P a g e
Table of Contents

SMART TRAFFIC SIGNAL CONTROL SYSTEM .................................................................I


(STSCS) ......................................................................................................................................I
FINAL YEAR PROJECT .............................................................................................................. I
SESSION 2017-2019 ................................................................................................................. I
PROJECT DETAIL ...................................................................................................................... I
PLAGIARISM FREE CERTIFICATE .......................................................................................I
ACKNOWLEDGEMENT .............................................................................................................III
TABLE OF CONTENTS.........................................................................................................IV
LIST OF FIGURES .................................................................................................................VI
1 INTRODUCTION .............................................................................................................. 1
1.1 INTRODUCTION ............................................................................................................. 1
1.2 SYSTEM OVERVIEW ...................................................................................................... 1
1.3 OBJECTIVES .................................................................................................................. 2
1.4 PROBLEM DEFINITION .................................................................................................. 2
1.4.1 Heavy Traffic Jam ..................................................................................................... 2
1.4.2 No Traffic but still need to wait ................................................................................. 2
1.5 PROJECT SCOPE ............................................................................................................ 2
1.6 ADVANTAGES ............................................................................................................... 3
1.7 FEATURES .................................................................................................................... 3
2 EXISTING SYSTEMS ....................................................................................................... 4
2.1 EXISTING SYSTEMS ...................................................................................................... 4
2.1.1 Manual Controlling ................................................................................................... 4
2.1.2 Fixed Timing .............................................................................................................. 4
2.1.3 Automatic Controlling ............................................................................................... 4
2.2 DRAWBACKS IN EXISTING SYSTEMS ............................................................................ 4
2.2.1 Heavy Traffic Jam ..................................................................................................... 5
2.2.2 No Traffic but still need to wait ................................................................................. 5
2.3 STAKEHOLDERS LIST .................................................................................................... 5
2.4 PROPOSED SYSTEM ...................................................................................................... 5
2.5 NEED TO REPLACE EXISTING SYSTEM ........................................................................... 6
2.6 UNDERSTANDING THE PROPOSED SYSTEM .................................................................... 6
2.7 REQUIREMENTS ELICITATION ....................................................................................... 6
2.7.1 Functional Requirements ........................................................................................... 6
2.7.2 Use case for admin interface ..................................................................................... 7
2.7.3 Admin ......................................................................................................................... 7
2.7.4 System ........................................................................................................................ 8
2.7.5 Non Functional requirements .................................................................................... 8
CHAPTER 3 ............................................................................................................................ 10
3 PROPOSED SYSTEM ..................................................................................................... 10
3.1 DETAILED DESCRIPTION OF PROPOSED SYSTEM ......................................................... 10
3.2 FEATURES OF PROPOSED SYSTEM .............................................................................. 11

iv | P a g e
3.3 ADVANTAGES OF PROPOSED SYSTEM......................................................................... 11
3.4 SCOPE OF PROPOSED SYSTEM .................................................................................... 11
4 SOFTWARE DESIGN AND MODEL ............................................................................ 13
4.1 SOFTWARE PROCESS MODEL...................................................................................... 13
4.2 SOFTWARE REQUIREMENT ANALYSIS ........................................................................ 14
4.2.1 Functional requirements.......................................................................................... 14
4.2.2 Non Functional requirements .................................................................................. 14
4.3 BENEFITS OF SELECTED MODEL ................................................................................. 15
4.4 LIMITATIONS OF SELECTED MODEL ............................................................................ 15
4.5 USE CASE DIAGRAM .................................................................................................. 15
4.6 SEQUENCE DIAGRAM ................................................................................................. 17
5 IMPLEMENTATION ...................................................................................................... 18
5.1 IMPLEMENTATION ...................................................................................................... 18
5.2 ALGORITHMS ............................................................................................................. 18
5.3 CODE DETAILS ............................................................................................................ 18

v|P a g e
List of Figures

Figure 1 use case admin ............................................................................................................. 7


Figure 2 use case system ............................................................................................................ 8
Figure 4.1 Incremental Model.................................................................................................. 13
Figure 2 use case for admin and system .................................................................................. 16
Figure 3 sequence diagram for STSCS .................................................................................... 17

vi | P a g e
Chapter 1

1 Introduction

1.1 Introduction

Overpopulation is currently one of the biggest problems in the world. When speaking of
truths, population growth means more vehicles on the roads. As a result, traffic
management is a serious problem in many cities today. In many cities, there are many
problems with traffic lights, especially in ambulance vehicles. The lack of efficient traffic
control leads to the death of patients due to delayed ambulances if they get stuck in traffic
congestion. Traffic signal control systems are often used to control the flow of vehicles
through the intersection of many roads. Its objective is to make a smooth movement of
the vehicles on the transport routes. However, the synchronization of multiple traffic light
systems at adjacent intersections is a complicated problem given the various parameters
involved. Conventional systems do not process variable flows that approach
intersections. In addition, the mutual influence of adjacent traffic light systems, the
temporary inequality of automobiles, accidents, the passage of ambulances and
pedestrian crossing are not implemented in the existing traffic system. This leads to
congestion and congestion. The intelligent traffic signal control system (STCS) is based
on a simple principle. The principle is: "A car can only drive if there is space for it" and
"the signal remains green until the current cars are finished". The arrangement of the
camera at the traffic lights makes traffic very efficient. In addition, a portable control
device is designed to solve the problem of emergency vehicles that get stuck in crowded
streets.

1.2 System Overview

We propose a new traffic Control System that will control the congestion problems of
traffic through traffic lights on the basis of current traffic density. The Current traffic
signal system is fixed. It has fixed time interval to pass the traffic from either side of the
road, which creates the cramming problem. Our Smart Traffic Signal Control System
solve this problem on real time basis. It will check the traffic condition on junction and

1|P a g e
then it will take decision that which side of junction is to open for certain period of time
and which one is for shorter time.

1.3 Objectives

Main Objectives of traffic light control is to

 Design a system which controls traffic light on the basis of traffic density using
image processing
 Measurably improve traffic flow
 Minimize the traveling time for vehicles and passengers that minimize pollution
 Reduce environmental pollution caused by traffic
 Minimize the vehicles safety by taking decisions
 Maximize the traffic congestion as possible that save energy and reduction in
emergency response time

1.4 Problem Definition


1.4.1 Heavy Traffic Jam
With increasing number of automobiles on road, heavy traffic cramming has
substantially increased in major cities. This happened usually at the main junctions
commonly in the morning, before office hour and in the evening, after office hours. This
problem wastes the time of people on road. The solution for this problem is to develop a
smart traffic signal control system that control lights using image processing. The wait
for junctions that have high density of traffic should be setting longer than the delay for
the junction that has low of traffic.

1.4.2 No Traffic but still need to wait

On certain junctions even if there is no traffic, people have to wait because the traffic
signal remains red, the people have to wait until the light switches to green. The solution
for this problem is to develop a smart traffic signal control system that control lights
using image processing.

1.5 Project Scope


Smart Traffic Signal Control System is a desktop system which will help to control traffic
congestion using image processing. As compare to other system that are working this

2|P a g e
time for example Fixed Time. Under fixed time operation the traffic lights will display
green to each approach for the same time every cycle regardless of the traffic conditions.
This system is not much good if in some there is no traffic waiting. The system will
automatically decide that which traffic signal should be green for certain time defined by
density of traffic (Low, Medium, High). If density is low, then that side of signal will be
green for 10 seconds. If traffic density is medium, then that side of signal will be green
for 30 seconds. And for high traffic density it will be green for 40 to 50 seconds.
1.6 Advantages

 Smart Traffic Control System helps movement and help conduct an orderly flow
by giving right of way to some cars and not others.
 This system not only makes car traffic a lot safer but also pedestrian traffic.
 It will help reduce the number of accidents and make collisions at intersections a
lot less frequent.
 It increases the traffic handling capacity of a certain intersection.
 Coordinated Timing helps minimize random start and stop, which helps traffic
flow and is less likely to create a traffic jam.
 The system plays a crucial and vital role when it comes to safety in our everyday
lives.

1.7 Features
Some important features are given below.

 Login
 Validation of valid user
 Splash screen
 Image acquisition
 Image preparing
 Image enhancement
 Counting things in image
 Storing in data base
 Time allocation

3|P a g e
Chapter 2

2 Existing Systems
2.1 Existing Systems
2.1.1 Manual Controlling

It requires man power to control the traffic. Depending on the countries and states the
traffic polices are allotted for a required area or city to control traffic. The traffic polices
will carry sign board, sign light and whistle to control the traffic. They will be instructed
to wear specific uniforms in order to control the traffic. In the manual controlling system,
we need more man power. As we have poor strength of traffic police we cannot control
traffic manually in all area of a city or town. So we need a better solution to control the
traffic.

2.1.2 Fixed Timing


The fixed timing uses the same current time intervals, which do not change depending
on the traffic

2.1.3 Automatic Controlling


Automatic traffic lights work on simple timers. Depending upon traffic levels at a
particular intersection, the traffic light will cycle through green, yellow, and red at regular
intervals to ensure a consistent flow of traffic in all directions through the intersection.
In automatic traffic controlling system, a traffic light uses timer for every phase. In areas
where traffic can be random and irregular, timer-based systems don't work. For example,
in a rural area, a timer-based system might have drivers stopped unnecessarily when no
traffic is present. All these drawbacks are supposed to be eliminated by using image
processing.

2.2 Drawbacks in Existing Systems


 Time waste on empty road
 Emergency vehicles may have stuck in certain road congestions.

4|P a g e
2.2.1 Heavy Traffic Jam

With increasing number of automobiles on road, heavy traffic cramming has


substantially increased in major cities. This happened usually at the main junctions
commonly in the morning, before office hour and in the evening, after office hours. This
problem wastes the time of people on road. The solution for this problem is to develop a
smart traffic signal control system that control lights using image processing. The wait
for junctions that have high density of traffic should be setting longer than the delay for
the junction that has low of traffic.

2.2.2 No Traffic but still need to wait


On certain junctions even if there is no traffic, people have to wait because the traffic
signal remains red, the people have to wait until the light switches to green. The solution
for this problem is to develop a smart traffic signal control system that control lights
using image processing.

2.3 Stakeholders list


 Developers
Shafqat Mahmood Shah
Samina Abdul Karim
 The Developers that means
 Coder
 Designer
 Editor
 Manager
 Users of this application
2.4 Proposed System

We propose a system for controlling the traffic light by image processing. The vehicles
are detected by the system through images. A camera will be placed alongside the traffic
light. It will capture image sequences. Image processing is a better technique to control
the state change of the traffic light. It shows that it can decrease the traffic congestion
and avoids the time being wasted by a green light on an empty road. It is also more
reliable in estimating vehicle presence because it uses actual traffic images. It visualizes

5|P a g e
the practicality, so it functions much better than those systems that rely on the detection
of the vehicles’ metal content

2.5 Need to replace existing system

While fixed time traffic signal control and actuated time traffic signal control are best to
control traffic in crowded cities. But they still need improvements. Because the fixed
timing system uses the same current time intervals, which do not change depending on
the traffic. And The actuated timing uses a detector that can adapt to the different traffic
volumes. But over smart traffic signal control system helps to minimize start up and stop
traffic signal randomly, promoting traffic flow and causing less traffic jams.

2.6 Understanding the proposed system

The "smart traffic signal control system" proposed by us overcomes all limitations of the
existing (used) traffic control techniques. The use of timers for traffic control has the
disadvantage that the time is wasted by green light on the empty road. This technique
avoids this problem. The project will show that image processing is a much better
technique than traditional methods. A great advantage is the variation of the signal time,
which controls a suitable traffic density using image processing. The proposed system
will control the traffic light according to density using image processing. If a particular
lane is very dense, more traffic flow is given, otherwise less time is given.

2.7 Requirements elicitation


In this section we are describe the requirements that what kind of requirements of users
are being make part in the system so these are following
2.7.1 Functional Requirements
An overview of the Smart Traffic Control is discussed below as user point of view:
 User will login into application through a login prompt by using id and password
 If password is invalid a prompt display to re-enter.
 If password is valid then user will be in profile/ main menu window.
 Main menu consists a bar in which main function are written with name or icons
 User can click and switch between smart and static traffic control.

6|P a g e
 A smart control button or icon will switch traffic signal to dynamically change
according to traffic density.
 Now user select functions in menu bar one by one and result will display at the
provide window.
 A static control button or icon will switch traffic signal to static behaviour in
which timing for every side of road will be fixed.

So these are the functional requirements that is required from users that what kind of
Interface they want or what type of the front end is look like.
This is shown below in Use case for interface Figure 2.7.3 and 2.7.4
2.7.2 Use case for admin interface
2.7.3 Admin

Figure
Figure
Figure 2.7.3
1 use
2.7.3 use
case
case
admin
foradmin
admin

7|P a g e
2.7.4 System

Figure 2 use case system

2.7.5 Non Functional requirements

The Non Functional Requirements of the System are discussed below.

 Performance
While we are talking about the performance of a system so there are many aspects of
this is considered discussed below that what is response time of the system a system we
ask good to them if it have maximum response time and other aspects like,
 Response Time

While we talk about the response time this is the time that whatever operation is selected
and an operation response to user so it is desired as maximum for better performance.

 Availability
The performance of the system that will be running and able to deliver the required
output to user that he wants.
 Security
System will be secure by different checks and security tools.
 Maintainability
System will be maintained by strong constraints applied by the admin any crash or issue
will be solved as per situation.

8|P a g e
 Portability
Our whole application code will be stored online professional site so we can access
whole application just by installing the basic software anywhere in the world.

9|P a g e
Chapter 3

3 Proposed System

3.1 Detailed description of Proposed System


We all know that green goes, yellow means waiting and red means stopping. However,
many of us do not know anything about the history of traffic light control systems. The
first traffic signal device (as we know today) was installed in a tower on Rue Montmartre
and on Boulevard Grande in Paris. It was administered by a policeman who used it by
hand, but the first tricolour innovation first appeared in Detroit. Behind the invention was
an officer named William Potts, concerned that the officers could not simultaneously
change the lights for which they were responsible. Since then, a lot of history has passed
and there is no doubt that these changes will continue over the years. Before this
discovery, you can imagine that the roads were quite messy. Fortunately, these days are
no longer the case. Among the many benefits of a traffic light control system is the safe
movement of cars to help prevent collisions with cars and people. They help move and
help direct an orderly flow by giving way to some cars and not others. Not only is the
traffic of vehicles much safer, but also that of pedestrians. They help reduce the number
of accidents and make intersection collisions much less frequent. They play a critical and
vigorous role for safety in our daily lives.
The signal synchronization is a very important factor. This really makes this feature and
offers people traffic safety. There are two main types of signal timing, namely fixed
timing and actuated timing. Fixed timing uses the same current time intervals that do not
change depending on traffic. The actuated timing uses a detector that can adjust to
different traffic volumes. The "smart traffic signal control system" proposed by us
overcomes all limitations of the existing (used) traffic control techniques. The use of
timers for traffic control has the disadvantage that the time is wasted by green light on
the empty road. This technique avoids this problem. The project will show that image
processing is a much better technique than traditional methods. A great advantage is the
variation of the signal time, which controls a suitable traffic density using image
processing. The proposed system will control the traffic light according to density using
image processing. If a particular lane is very dense, more traffic flow is given, otherwise
less time is given.

10 | P a g e
3.2 Features of Proposed System
Some important features of proposed system are given below

 Login
 Validation of valid user
 Splash screen
 Image acquisition
 Image preparing
 Image enhancement
 Counting things in image
 Storing in data base
 Time allocation

3.3 Advantages of Proposed System


Some main advantages of proposed are given below.

 Smart Traffic Control System helps movement and help conduct an orderly flow by
giving right of way to some cars and not others.
 This system not only makes car traffic a lot safer but also pedestrian traffic.
 It will help reduce the number of accidents and make collisions at intersections a lot less
frequent.
 It increases the traffic handling capacity of a certain intersection.
 Coordinated Timing helps minimize random start and stop, which helps traffic flow and
is less likely to create a traffic jam.
 The system plays a crucial and vital role when it comes to safety in our everyday lives.

3.4 Scope of Proposed System

Smart Traffic Signal Control System is a desktop system which will help to control traffic
congestion using image processing. As compare to other system that are working this
time for example Fixed Time. Under fixed time operation the traffic lights will display
green to each approach for the same time every cycle regardless of the traffic conditions.
This system is not much good if in some there is no traffic waiting. The system will
automatically decide that which traffic signal should be green for certain time defined by
density of traffic (Low, Medium, High). If density is low, then that side of signal will be

11 | P a g e
green for 10 seconds. If traffic density is medium, then that side of signal will be green
for 30 seconds. And for high traffic density it will be green for 40 to 50 seconds.

12 | P a g e
Chapter 4

4 Software Design and Model

4.1 Software Process Model


We are using the Incremental model because of the incremental model approach is best
for updating of system in future. Using the incremental model an initial version is being
delivered to users and as time passed to fulfil the need of users the updated version is
then delivered. In which each from all components is a system.
Incremental Model is a process of software development where requirements are broken
down into multiple standalone modules of software development cycle. Incremental
development is done in steps from analysis design, implementation, testing/verification.

Figure 4.1 Incremental Model

13 | P a g e
4.2 Software Requirement Analysis
In this section we are describe the requirements that what kind of requirements of users
are being make part in the system so these are following.
4.2.1 Functional requirements
An overview of the Voice Recognition System is discussed below as user point of view:
 User will login into application through a login prompt by using id and password
 If password is invalid a prompt display to re-enter.
 If password is valid then user will be in profile/ main menu window.
 Main menu consists a bar in which main function are written with name or icons
 User can click and switch between smart and static traffic control.
 A smart control button or icon will switch traffic signal to dynamically change
according to traffic density.
 Now user select functions in menu bar one by one and result will display at the
provide window.
 A static control button or icon will switch traffic signal to static behaviour in
which timing for every side of road will be fixed.
So these are the functional requirements that is required from users that what kind of
Interface they want or what type of the front end is look like.
4.2.2 Non Functional requirements
The Non Functional Requirements of the System are discussed below.

 Performance
While we are talking about the performance of a system so there are many aspects of
this is considered discussed below that what is response time of the system a system we
ask good to them if it have maximum response time and other aspects like.
 Response Time
While we talk about the response time this is the time that whatever operation is selected
and an operation response to user so it is desired as maximum for better performance.

14 | P a g e
 Availability
The performance of the system that will be running and able to deliver the required
output to user that he wants.
 Security
System will be secure by different checks and security tools.
 Maintainability
System will be maintained by strong constraints applied by the admin any crash or issue
will be solved as per situation.
 Portability
Our whole application code will be stored online professional site so we can access
whole application just by installing the basic software anywhere in the world.

4.3 Benefits of selected Model


 The software will be generated quickly during the software life cycle
 It is flexible and less expensive to change requirements and scope
 Thought the development stages changes can be done
 This model is less costly compared to others
 A customer can respond to each building
 Errors are easy to be identified.
4.4 Limitations of selected Model
 It requires a good planning designing
 Problems might cause due to system architecture as such not all requirements collected
up front for the entire software lifecycle
 Each iteration phase is rigid and does not overlap each other
 Rectifying a problem in one unit requires correction in all the units and consumes a lot
of time.

4.5 Use Case Diagram

This use case is based upon the most important functionality of the system which is
dynamically control the variations in traffic. There are two modes for the admin to switch
between them. These control will help in controlling traffic according to traffic
conditions. The helps in movement and help conduct an orderly flow by giving right of
way to some cars and not others.

15 | P a g e
Figure 2 use case for admin and system

16 | P a g e
4.6 Sequence Diagram

Figure 3 sequence diagram for STSCS

17 | P a g e
Chapter 5

5 Implementation

5.1 Implementation

5.2 Algorithms

5.3 Code details

18 | P a g e

Das könnte Ihnen auch gefallen