Sei sulla pagina 1di 44

Chapter 1

THE PROBLEM AND ITS BACKGROUND

This chapter explains the overview of the proposed study, the problems that this study

solved. It also contains the scope and limitation and its significance.

1.1 Introduction

Traffic light system was first implement since 1868 to control the traffic flows at each

road intersection, pedestrian crossings, rail trains, and other locations using light cycle schedules.

It can view our traffic from different perspectives: longer commute time, employee absences,

stress, wasted man-hours, and fuel expenses are just some of them.

At this moment of time, one of the most important challenges in transportation systems

is traffic congestion. So, the government doesn’t know the solution yet about this problem. The

management of traffic has becoming a challenging task. The internal sectors where long queues

of vehicles can be seen stranded because traffic jams during rush hours are becoming a routine

affair.

Hence, efficient road traffic management is more important than ever. Smart Traffic

Light with Monitoring System is capable to potentially reduce road traffic congestion to ensure

better travel experience for drivers especially for commuters that used to monitor and control the

flow of automobiles through the roads and aims to decrease waiting time on every vehicle to

keep the flow of vehicles at the most efficient rate.

The challenge at this time is to create a possible traffic light system that can reduce the

traffic congestions on the road and make a friendly community.

1
1.2. Background of the Study

Nowadays, congestion traffic jams and vehicular increasing are become serious problem

maybe with the increase of number of vehicles at a fast pace, obstruction of carriage way by

number of ongoing works, and the phenomenal growth of population which is not able to match

the infrastructure of the city that leads to dramatic consequences on economy, human health, and

environment. Traffic jams during rush hours are becoming a routine affair, especially in the

internal sectors where long queues of vehicles can be seen stranded. Hence, efficient road traffic

management is more important than ever.

This traffic light system can monitor real time and adjust its behavior based on the

number of the vehicle running on the road. It can adapt to any three lane road with a better light

ambient to detect accurately. This system can mostly useful on the road that where the traffic is

worst especially on the main roads like highways. The real problem on the traffic light system at

this time it is not synchronized thoroughly with each other. Basically the traffic light system that

the community using are hard coded and fixed.

In this paper, the researchers propose a method for determining traffic congestion on

roads using image processing techniques and a model for controlling traffic signals based on

information received from images of roads taken by the camera, then extract traffic density which

corresponds to total area occupied by vehicles on the road in terms of calculating number of

vehicles.

Smart Traffic Control system that sees traffic approaching the road and reacts according

what is needed to keep the flow of vehicles at the most efficient rate. By anticipating the needs

2
of the approaching vehicles, as opposed to reacting to them after they arrive and stop, this system

has the potential to save motorist time while cutting down harmful emissions.

1.3 Statement of the problem

The researchers aim to develop a Smart Traffic Light System to control the traffic flow

and adjust the timing and phasing of every traffic light. It will also find to answer in these

following questions:

1. What are the present situations of traffic in the city?

2. What hardware system design is capable of detecting or counting the vehicles in the

specific area of the road?

3. How the integration of hardware and software system controls the signals and adjusts

the timing and phasing of lights according to the limits that are set in controller programming?

4. How will be the accuracy of the image processing affects the system?

1.4 Scope and limitation of the study

1.4.1 Scope

• The system can adjust the time to reduce traffic jams to reduce travel time for many

commuters and will prevent drivers to get impatient. The timing of the system is based

on the number of vehicles on the road.

• The system covers real-time monitoring of the traffic in particular area. The camera will

serve as the operator to see the vehicles passing through the roadway and to check the

density on the particular area. By monitoring the condition of the road it will help the

authorities to check if there is any accident.

3
• The system can reduce the possibility of traffic congestion. By the help of the system it

will regulate and improve the flow of the vehicles.

• The system can provide real time traffic flow metrics that has an ability to adjust the

timing of every traffic light based on the number of detected vehicle in particular area.

1.4.2 Limitations

 This study is can only work on a one way road. Thru programming the system and

integrating all the hardware and software, the researcher disregard the two way parameter

because of the components used.

 It can only detect the vehicle in fixed position. The reason of this is because the hardware

is limiting the frame rate of the camera used.

 The system is can only apply to a three partitions within a one way road.

1.5 Significance of the Study

Community

The number of vehicles on the road increases as the time goes by and the effect of this

situation are not good for the community. The system will help cut back on the amount of toxins

emitted in the air and they increase productivity. This will also help reducing accident on the

road caused by aggressive driving.

4
Commuters

It reduces the possibility of traffic congestion, thus reducing travel time for many

commuters. Since most people commute to transport them in there work and schools so it is

acceptable to implement this study.

Drivers

The system will prevent drivers get impatient and aggressive when driving. This also will

boost the mindset of the drivers to follow the traffic rules for the reason that it is organize and

well maintain.

Government

This system will lessen the cost value of how to maintain it regularly. Knowing well that

the system will successfully carry out it tasks the government will consider this and maybe

support it.

Overall health

The system will prevent the risk of heart disease and brain damage by the means of traffic

congestion or longer travel time. For example on summer as the traffic congestion goes worsen

some people get irritated and the result is there blood pressure will goes up and that is not good

for health.

Proponents

The system will help them to widen the scope of their knowledge and skills when it comes

to problem solving a real world problem by using the system, it will serve as a guide for them to

discover new system that can answer a specific kind of problem with the help of technology.

5
Future researchers

The proposed study will give them an idea or backbone to improve it more. The system

will help to improve or develop this study to different cities all over the world.

1.6 Operational Definition of terms

Cascade Trainer. Are trained with several hundred "positive" sample views of a

particular object and arbitrary "negative" images of the same size. After the classifier is trained

it can be applied to a region of an image and detect the object in question. To search for the

object in the entire frame, the search window can be moved across the image and check every

location for the classifier. This process is most commonly used in image processing for object

detection and tracking, primarily facial detection and recognition.

Image Processing. Is any form of processing for which the input is an image or a series

of images or videos, such as photographs or frames of video. The output of image processing

can be either an image or a set of characteristics or parameters related to the image.

OpenCV. Is an open source computer vision and machine learning software library that

was built to provide a common infrastructure for computer vision applications and to accelerate

the use of machine perception in the commercial products.

Python. It is a general purpose programming language used for developing complex

scientific and numeric applications which is designed with features to facilitate data analysis and

visualization.

6
Raspbian OS. A free operating system based on Debian optimied for the Raspberry

Pi hardware that set of basic programs and utilities that make Raspberry Pi run.

Raspberry Pi. It is used to monitor the traffic in a particular area and allow the camera

to check the density on that area so that the people will be aware of the traffic in advance and

change their path to reach their next destination.

Raspberry Pi 16x2 LCD. Is an electronic display module and find a wide range of

applications. A 16x2 LCD display is very basic module and is very commonly used in various

devices and circuits

Smart Traffic Lights. A traffic light control systems that widely used to monitor and

control the flow of automobiles through the junction of many roads.

Raspberry Pi Camera Module v2. An 8 megapixel Sony IMX219 image sensor custom

designed add-on board for Raspberry Pi.

7
Chapter 2

REVIEW OF RELATED LITERATURE

This chapter presents both local and foreign literature and studies from books, thesis,

journals, dissertations and internet articles related to the development of this project, “Smart

traffic light”.

From this study of Badache, Bouabdallah, Challal, Djenouri, Doudou, Kafi (2012), it

focused on the constant increasing of vehicular traffic around the world, especially in urban areas

which is clearly seen in our daily life, like when the students go to school or work, traffic

congestions are more and more serious problem for our daily life. ITS solutions detect vehicles

in fixed position that used wired technologies for communication while WSNs are advances in

embedded systems and wireless technology which are composed of cheap and tiny devices that

communicate wirelessly and sense the surrounding environment. In this study, Wireless Sensor

Networks (WSN) and based Intelligent Transportation Systems (ITS) have developed a cost

effective technology that may be a solution to reduce travel time, fuel consumption and to

improve our daily life. WSN based ITS applications can be categorized according to sensors

placement as well as to the network architecture. So the WSN based ITS application can be

classified regarding the sensors placement into in-vehicles, on-road, or both. Technically, the

WSN helps to join the classical ITS system drawbacks, due to its cheapness and scalability

nature. This technology enables a new broad range of smart city applications around urban

sensing including traffic safety, traffic congestion control, road state monitoring, vehicular

warning services, and parking management.

8
From this research of Boukerche and Younes (2013), traffic signals are required to have

a safe and systematic flow of traffic in road intersections. Though they are required in road

intersections, traffic lights may cause delay in traffic and may heavy traffic in other lanes.

Because of this reason, the researchers developed an Intelligent Traffic Light Controlling

algorithm. The algorithm analyzes real-time traffic data in an intersection while scheduling each

time phase of a traffic light. The researcher aims to decrease waiting time on every vehicle at the

intersection so that many vehicles can cross this section.

From this of Collotta, Giuffr’e, Pau and Scat`a (2014), Wireless Sensor Networks (WSN)

are being widely used in Intelligent Transportation System (ITS) optimization, specifically on

management and analyzing certain intersection. The aim of the researchers is to design

transportation products, services and systems based on the current technologies available. The

researchers used a wireless sensor networks to analyze the data acquired from the sensors and

develop a solution to determine go signals and phase sequence of traffic lights. The researchers’

main aim is to reduce the waiting time of every vehicle in an intersection.

According to the study of Kanungo, Sharma and Singla (2014) that focused on daily

traffic congestions everywhere. This paper presents the all the method to use live video feed from

the cameras at traffic junctions for real time traffic density calculation using video and image

processing. This system consists of video cameras on the traffic light where the traffic

conjunctions may appear. There will be four video cameras will be installed over the red lights

facing the road. Cameras would be capturing the video and will be broadcast it to the servers

where using video and image processing, the vehicle density on every side of the road is

calculated and an algorithm is employed to switch the traffic lights accordingly. Hardware also

includes connection of these cameras to the server to receive live feed and a server capable

9
enough for handling the processing requirements. Software used in the system includes

MATLAB video and image processing toolbox and C++ compiler to generate algorithmic

results.

From this journal of Bell (2008) that based on Stereoscopic Pictures Natural scenes

represent a noteworthy challenge to traditional optical character acknowledgment methods since

they regularly contain noise, occlusions, distortions, or moderately small measures of

exceedingly styled content. In this work, the researchers develop a probabilistic framework

which binds together the undertakings of content detection and acknowledgment with a language

representation. The researchers utilize an effective multi-scale character detector to find

characters inside a picture without performing division. This is trailed by a diagram based inquiry

which bunches the detection into words and evaluates their relative probabilities, to avoid two

fold choices aside from where computationally is important. Since acquiring a huge

informational collection with ground truth is troublesome and tedious, the researcher depended

on a synthetically produced informational index, which marks ground truth for several phases of

the pipeline. This approach was utilized effectively by Neumann et al. in to prepare character

classifiers for natural pictures utilizing just computer's produced information.

From this study of Maseleno annd Mulung (2015) which simultaneously collects event-

based high resolution traffic data from multiple intersections and generates real-time signal

performance measures, including arterial travel time, number of stops, queue length, intersection

delay and level of service. This research verifies data to examine all the raw records to see

whether there are some errors in the data set while generating some basic measures from the raw

records. In this part, aggregated volume, delay, queue size, queue length, travel time are derived

from pre-processed data using different algorithms. Finally, the generated measures can be

10
visualized and published through various techniques for road users and traffic engineers. Based

on the different types of performance measures, diagnosis and fine-tune of traffics, signals can

be achieved.

According to this research of Nataraj and Vijetha (2017), which is for detecting the

specific location of the traffic and gives the traffic report also in the travelers wherein the traffic

is based on the density of the vehicles on each side the time period or displacement for that road.

With the help Raspberry Pi, it will monitor the traffic in a particular area, it will allow the camera

to check the density on that area so that the people will be aware of the traffic in advance and

change their path to reach their next destination. The traffic density will divided into 4 direction

i.e,East, West, North and South. In each direction there are two instruction register pairs ( IR

Transmitter and IR receiver). If the traffic density is low IR sensor serves for certain time for

example 10secs, if density is medium IR serves for 20secs and if the traffic density is high IR

serves for 40secs. Every time camera is rotated by 90 degrees. The system consists of Raspberry

Pi, Camera, IR sensors, Dc gear motor.

From this literature of Kennedy and Sexton (2009), for road safety traffic signals and

signalized crossing. Traffic signals and signalized crossing are an important road safety issue.

Between 2004 and 2006 19% of collision in London so the signal has control junctions. But in

the same period 17% of all pedestrian casualties recorded in STATS 19 occur on signalized

pedestrian crossing.

From this research of Nataraj and Vijetha (2017), IOT means Internet On Things. A

traffic controller is designed like Raspberry Pi, IR sensors and RFID. To know the density of the

traffic you will use the IR sensor. IR sensors are used to identify the density of traffic. And to

identify the entry of ambulance and lost automobiles RFID is used. Camera used in system takes

11
still pics of traffic. By seeing this picture which authorized person in control room will take

decision in manual mode of operation. To track the stolen automobile RFID cards will also be

programmed in all vehicles. The Information identity of card must be known by all owner. If the

automobile is lost, the owner of automobile will give this ID to police and to control room. By

using RFID it will read the road signal when it encounters the sensor then it will email into the

owner and when emergency vehicles arrived the RFID reader will read the RFID card. The

number reached by the card after that it will compare in control room system, if same then it will

output automatically green light will be turned on. The sensor will place the at certain

displacement on specific area or in between the signal light and if only first sensor output is high

the ‘traffic is low’ so only for 30 sec green light is turn on.

Based on the research of Felicio, Grepo, Reyes, and Yupingkun (2015) that is for traffic

light displays and driver behaviors, this test examined the driver behaviour toward to four type

of traffic light warning schemes currently in use across in Karuhatan to Monumento. The

proponets observed the drivers to know what they do upon reaching the red, yellow and green

lights in the intersection. The surveys showed that 99.5% of the drivers claimed they stop at the

red lights. Then 76.3% of the drivers was slow down in the yellow lights, and 98.2% of the

drivers either speed up or maintain the speed in the green lights

In relation to the study of Bagyamani and Janet (2015) which is based on Image

Processing and the main goal is to count the vehicles in the specific area of road by using Image

processing. Image acquisition in image processing can be broadly defined as the action of

retrieving an image from some source, usually a hardware-based source, so it can be passed

through whatever processes need to occur afterward. The first step in this process is image

acquisition, to acquire a digital image. To do so, it requires an image sensor and the capability to

12
digitize the signal produced by sensor. One of the forms of image acquisition in image processing

is known as real-time image acquisition. This usually involves retrieving images from a source

that is automatically capturing images. Real-time image acquisition creates a stream of files that

can be automatically processed, queued for later work, or stitched into a single media format.

One common technology that is used with real-time image processing is known as background

image acquisition, which describes both software and hardware that can quickly preserve the

images to detect the vehicles passes on that lane. It is very important to verify the type of a

detected object (vehicles, pedestrian) in order to track and analyze its activities correctly. It is

very important to recognize the type of a detected object (vehicles, pedestrian) in order to track

and analyze its activities correctly.

According to the journal of Maglad (2012) that is for a vehicle license plate detection and

recognition system as a result of the changing characteristics of the plate number from country

to country like numbering system, tints, vernacular of characters, also examine is up 'til now

required around there. The usage for plate number detection has not been applied to this study

however the plate number recognition was been applied by the helped of artificial neural

network. Radial Basis Function (RBF) neural framework is used both for the recognizable proof

and affirmation of Saudi Center Eastern tag. : In by far most of the inside East countries, they

use the blend of Arabic and English letters. Along these lines, the partition among Arabic and

English letters and logo's challenge in conclusion the affirmation of those characters end up being

all the more troublesome research task. The proposed approach has been attempted on 200 front

pictures of national tag of Saudi Arabia. A higher level of precision has been acquired to

demonstrate that the noteworthy of this approach.

13
According to the study of Wang and Lin which is to developed currency detector that can

solve their problem. The researcher used SEK and Chinese RMB as an example to illustrate the

technique. The color and shape of the currency can detect the researcher’s prototype for their

algorithms. The researcher’s procedure was they scan first the currency using money scanner

then the digital signal will send to the computer using the digital processing, now it will do the

math using the system they made in Matlab software, the algorithm will do solve there, and last

is the result of what is the money that the researchers used as a test subject. (Wang and Lin, 2010)

2.5 Synthesis

Smart traffic light’s main goal main is to reduce the waiting time of every vehicle in the

road that will cause daily traffic congestion everywhere. Because of this reason, the researchers

developed the system that can analyze real-time traffic data in road while scheduling each time

phase of a traffic light.

According to the gathered studies and literatures from a different source the researchers

were able to conduct and commence the proposed study. The researchers used different

techniques to analyze the acquired data and develop a solution to determine go signals and phase

sequence of traffic lights. Based on the study of Wang and Lin entitled Currency Recognition

System Using Image Processing, they proposed a study that can detect and recognize a certain

paper based currency. They used image processing for their research and used Matlab software

that can compute the algorithm needed. According to the study entitled Smart Traffic Lights

Switching and Traffic Density Calculation using video processing. This system consists of video

cameras includes connection to the server to receive live feed and server capable enough for

14
handling the processing requirements on the traffic junctions. Cameras would be capturing video

and broadcasting it to the servers using video and image processing techniques the vehicle

density on every side of the road is calculated and an algorithm is employed to switch the traffic

lights accordingly.

With the help Raspberry Pi, it will monitor the traffic in a particular area, it will allow

the camera to check the density on that area so that the people will be aware of the traffic in

advance and change their path to reach their next destination.

2.6 Conceptual framework

Figure 2.1 – Conceptual framework

15
Figure 2.1 shows the conceptual framework that will serve as the representation of the

process of the research project from input, process and the output. For the input it consist the

hardware and software to be used on this project. The Raspberry pi will serve as the brain of the

researcher’s project and the main hardware. The camera module will serve as the eye that will

capture the real time video on the road and once a vehicle captured it will send to the main board

which is the raspberry pi and it will be process as the data. For the software the Raspbian Os will

setup the researcher’s main board. The Python will serve as the calculator of the width and height

of the vehicles ( X, Y, W, H ) coordinates. To finish the research study and the prototypes the

researchers planned every step and gathered the data and analyze later on. The researcher’s

prototype “Smart Traffic Light with monitoring system” will help to reduce the heavy traffic

cause by cars on our country especially nowadays a lot of people are using vehicles for

transportation.

16
Chapter 3

RESEARCH METHODOLOGY

This chapter discusses the researchers’ research method and project development process

to solve the problems discussed in the previous chapters.

3.1 Research Method

The researchers used agile method because it is a type of project management process

that anticipate change and allows for much more flexibility and effective to follow. An agile is

the process flow model that the proponent has used for which its process is just like a repeating

step.

3.2 Project Development Process

Analysis Design Implementation

Maintenance Evaluation Testing

Figure 3.1 – Project Development Process

17
Figure 3.1 shows the order to start and create the proposed research, the researchers

decided to follow the created flow chart step by step to finish the research project. The flowchart

model that the researcher used is the agile method that is based on giving high priority to human

participation. If there are defects or challenges, then changes can be made during production

cycles to fix the issue.

The new method in reducing traffic must be formulated in order to solve these growing

problems. In this study, the researcher expected to have an output of having Smart Traffic Light

with Monitoring System that uses image processing.

3.2.1 Analysis

The first step of the researcher on how start the project is to gather and analyze the data

about image processing, what are the possible software and hardware will be used on this

research, how the system will develop where to place the output prototype.

3.2.2 Design

In this step the researchers developed and created program by using camera module that

will monitor all the vehicles that will pass through the traffic light lane and will send the gathered

input data to the next lane.

3.2.3 Implementation

The researchers implemented the suitable software designs and hardware designs of the

system.

18
3.2.4 Testing

Complex testing of hardware and software will include traffic lights and actual traffic.

3.2.5 Evaluation

The proponents will evaluate system using specific software that would simulate different

traffic situations. Also humans will be involved to ensure protection of possible human mistakes

and to see how good communication between human and the system.

3.2.6 Maintenance

The proponents will use continuous integration to constantly improve the system and

minimize number of bugs and possible errors.

3.3 Project Planning

Table 3.1 – Project Planning

Table 3.1 shows the Gantt chart for the development progress of the research study.

19
3.4 Software Components

Figure 3.2 – Cascade Trainer Logo

Figure 3.2 shows the Haar Cascade which Is basically a classifier which is used to an

object by training it manually. This software used as trainer of the sample portrait of an object

that needs to detect by image processing.

Figure 3.3 – Python Logo

Figure 3.3 shows the Python that is designed with features to facilitate data analysis and

visualization that also used to build the software application directly from the prototype simply

by refactoring the Python code to serve as the calculator of the width and height of the vehicles

( X, Y, W, H ) coordinates.

20
Figure 3.4 - Raspbian OS Logo

Figure 3.4 shows the Raspbian OS that comes from pre-installed with plenty of software

for education, programming and general use. This operating system is compatible with Python,

Scratch, Sonic Pi, Java, Mathematica and more. This will serve to setup the raspberry pi just like

personal computers.

3.5 Hardware Components

Figure 3.5 – Raspberry Pi

21
Figure 3.5 shows the Raspberry Pi which is the main hardware and serves as the brain of

the proposed study which stores all the important hardware and software system like operating

system, source code, mouse, keyboard, monitor, etc. The raspberry pi also interconnects other

hardware used by receiving and sending data to be displayed the results after it process. The

researcher used this microprocessor device for the simulation to have the portable ability and to

less the cost of other hardware will use.

The short specification of this hardware is it can connect to the four universal serial bus

port, and Ethernet ports. The white flat ribbon as shown in Figure 3.5 is the flex cable connecting

to the camera. The jumping wires connecting the LCD to display the definite process output.

Lastly to power up this hardware it draws 2.5 ampere with 5 voltages to enable it to use properly.

Figure 3.6 – Raspberry Pi Pinout

The figure 3.6 shows the pin configuration of the raspberry pi and used it as the basis of

where to connect the components used. It comes with 40 pins in total including the voltage source

with 3.3 volts and 5 volts and the grounding to switch it up the main board.

22
Figure 3.7 – Raspberry Pi Camera Module

Figure 3.6 shows the Raspberry Pi Camera Module which is a high quality 8 megapixel

Sony IMX219 image sensor custom designed add-on board for Raspberry Pi. The camera module

will serve as the eye that will capture the vehicles in real time and get important data that will

send to raspberry pi, the researcher used the most recent version that is compatible to the main

board and placed as higher as possible where it can capture the vehicles clear and visible so that

it can detects it accurately.

The short specifications of this hardware it can capture videos at 30 frame rate per

seconds with a maximum of 8 mega pixels and a resolution of 1080p.

This camera comes with a short flex cable that is supposed to connect to the main board

but unfortunately it was too short that it can’t reach the main board underneath the experimental

road. The solution of that, the researcher finds 1.5 meter flex cable to change the short one and

it can freely move the camera to adjust its viewing.

23
Figure 3.8 – Raspberry Pi 16x2 LCD

Figure 3.8 shows Raspberry Pi 16x2 LCD which indicates for the stop and go time in

seconds where the system formulated and process while the LEDs change the color

simultaneously based on what the LCD is displaying. The system formulated and process the

researcher used the LCD and tiny led light bulbs (red for stop, yellow and green for go) serves

as the traffic light to display outputs.

The used of jumping wires are needed to have interaction and connectivity between the

main board and this components. It has a vcc and grounding connection meaning a positive and

negative to power up the LCD. The LCD has a pin for the SCL to be connected on the pin 5 of

the raspberry pi to have a clock line on the system meaning it can change the output every

process. The SDA connected at pin 3 of the main board works as the one who transfer the data

from the board to the LCD that’s why it has time a time counting.

For the tiny led light bulbs it is connected at the general purpose input and output pin the

GPIOs shows in figure 3.6 to have the connectivity between the raspberry pi. The positive

connection of the bulbs is connected to the other general purpose input and output pins to have

a different output.

24
3.6 System flowchart

Figure 3.9a – Image Process and Data Collection

Figure 3.9b – Algorithm for Controlling Vehicles

25
Figure 3.9a shows the flowchart that will be the guide and the possible process for the

system. The first process is camera on for all the partitions. By the help of the camera it will

capture all the vehicles that will pass through each partition from first to the last lane of the

experimental road. Next it will read the image and convert it as a data that needs to process by

the system. After the image processing it will now it will now store the data collection and send

it to the next process.

Figure 3.9b shows here the traffic analysis. It displayed here the possible conditions that

the system will base. The system will only stop or proceed back to the starting point of the process

if it accomplished and meets the conditions correctly.

26
Chapter 4

RESULTS, ANALYSIS AND DISCUSSION

This chapter presents graph of results, analysis and interpretation of data gathered

through the entire project making and to answer the problem stated in chapter 1.

4.1 Project Description

In this paper, Smart Traffic Light was built to make the best or most effective use of the

road using the Raspberry Pi microprocessor board that tries to reduce traffic jam which cause by

traffic lights, as possible. The system is based on microprocessor which represents the brain of

the system. The objective of this study is to design a Traffic Light that will determine the traffic

jams on the roads using image processing techniques and create an algorithm that will control

traffic signals based on information received from images taken by the camera module. The

system will combine traditional traffic lights to intelligently route vehicle and pedestrian traffic.

It recorded the vehicle numbers on the road and makes changes in real time to avoid congestion

wherever possible. The creation of the system helps reduces traffic jams.

4.2 Project Result

The researcher discussed the following tables and figures in order to answer the specific

questions discussed in chapter 1 for the purpose of clarity.

Research Question 1: What are the present situations of traffic in the city?

The current traffic management which supposed to ease traffic congestion has becoming

a challenging task where long queues of vehicles can be seen stranded, but what if traffic lights

are actually doing the opposite, and creating more irritating than calm. The outcomes are some

27
of the drivers will cause a fight and misunderstanding among the other drivers also it will change

the flow of the traffic because of the delays.

By researching on different sources, here are some of the problems, issues and the effect

that can cause delay of traffics on the road using the current traffic light system:

 The current traffic signal countdown timer is automated, which pointed that the

time is fixed. The result is, for example there is a huge traffic on the road, the

traffic light system display stop meaning the signal is red then afterward it will

go with a little amount of time resulting of traffic jam and accumulation of

vehicles.

 Traffic light at this times used man power and manual monitoring which means

that there is a miscalculation or man error.

 The timing is not properly synchronized to each other. The consequences of this

are some of the drivers will not follow the traffic rule and just do what they want.

 The traffic light system nowadays based only by traffic demands. Meaning the

timing where based only by monitoring and the authorities only predicts the

number of vehicles.

 The traffic light system that currently using today is not well maintained that

can’t use on a long period of time, resulting of no one controlling the traffic flow.

To conduct and help on how to have an idea to produce a traffic light system that

can perform opposite or prevent the listed problems, the researcher consider this

down sides as a problem and make it as solution.

Research Question 2: What hardware system design is capable of detecting or counting the
vehicles in the specific area of the road?

28
With the application of Raspberry Pi board technology which serve as the brain of the

proposed study and the main hardware with the help of Raspberry Pi Camera Module which

serve as the eye that will capture the real time image on the road and once a vehicle captured it

will send to the main board and will process as data. The number of vehicles on the road makes

changes in real time to avoid congestion wherever possible. After the integration of hardware

and software components, the following results are achieved.

Figure 4.1 - Detection of

vehicles

The Figure 4.1 shows the captured image and broadcasting it to the monitors using image

processing techniques. The vehicle on every side of the road is calculated and an algorithm is

employed to switch the traffic signals accordingly to shows the detected vehicle taken by the

camera module.

The researcher considered the light intensity of a room that can affect the reading of the

system as the brightness goes up. To have a better and well balance view, the camera was placed

as higher as possible where it can capture the vehicles accurately and the exact distance of the

experimental road.

29
Figure 4.2 – Data received to control traffic light

The figure 4.2 shows the data received for countdown and traffic signals to control to

intelligently route and control the flows of the traffic. In this figure the researcher used LCD and

tiny led light bulbs to display the system output that processed by the raspberry pi board. The

16x2 LCD shows the stop and go time in seconds while the bulbs change the color

simultaneously based on the displaying time. The connections between the main board and the

other hardware used according to the figure 4.2, the researcher used breadboard and female to

male jumping wires instead of using a printed circuit board to have space in mistake and can

correct it.

30
Figure 4.3 – Overview of smart traffic light

The Figure 4.3 shows the relationship of all elements involved in the study. It includes

the association of each component required for the system to work. This setup uses a toy car as

the data for the system to easily arrange the possible results. The system uses raspberry pi which

represents the brain of the system and the camera module to capture the image of vehicles. The

Raspberry pi also the one that integrates all software and other hardware used.

31
Figure 4.4 – Smart Traffic Light with Monitoring System

Figure 4.4 shows the Smart Traffic Light with Monitoring System which is the system

that analyzes real-time traffic data in the road while scheduling each time phase of a traffic light

to reduce the heavy traffic and waiting time on every vehicle to keep the flow of vehicles at the

most efficient rate and develop a solution to determine go signals and phase sequence of traffic

lights.

After all the components where setup correctly, the figure 4.4 shows the complete design

of the road including all the important components for the system to perform perfectly. The road

flows in a single lane manner. Making it in a three layers per lane and put three partitions on the

road.

Research Question 3: How the integration of hardware and software system controls the
signals and adjusts the timing and phasing of lights according to the
limits that are set in controller programming?
Raspberry Pi requires custom Python scripts to get the project up and running and

successfully perform the function for each elements for the development of community-based

traffic. The Python will serve as the calculator of the width and height of the vehicles (X, Y,W,

H ) coordinates. The camera will capture vehicles for all the partitions and there will be an

estimated time that depends on the volume of the vehicles shown in Table 4.2.1. Once the

estimated time finished, it will now count the number of vehicles by image processing by using

python and send it to the data collection connected on the raspberry pi and will analyze what is

the traffic condition.

32
Figure 4.2.5 – Cascade Trainer (Input Tab)

The proponents used Cascade Trainer GUI to train, test and improve cascade classifier

models to be able to meet the best accuracy using HAAR algorithm. Cascade Trainer uses a

graphical interface to set the parameters and make it easy to use OpenCV tools for training and

testing classifier. To train classifiers, it needs to provide the function with thousands of positive

and negative image samples. To start the training, it needs to create a folder for the classifier and

create another two folders inside it. One should be “p” for positive images and the other must be

“n” for negative images. The positive images must be the image of different sizes/types of cars

to maximize the accuracy depending on the cascading and the negative images must be anything

33
excluding cars. Common, cascade and Boost tabs can be used for setting the parameters for

customizing the classifier training.

Figure 4.2.6 – Cascade Trainer (Common Tab)

Figure 4.2.6, shows the recommended settings for modifying the cascading. Cascade

Trainer GUI sets the parameters by default. But the pre-calculation indices and values buffer size

will be 2048MB to help the speed training of the cascading classifiers. The number of threads is

a execution or sequence of the data processed that can be managed by the cascading classifier.

The proponents set up the number of threads into 5 values. The number of stages is a first step

to do the cascading classifier the first stage will be mount of multiple negative images and it

compare to the one positive image until reaching the 15th stages.

34
Figure 4.2.7 – Cascade Trainer (Cascade Tab)

Figure 4.2.7, This section will set the maximum sizes of the positive and negative images

samples. The proponents used 30x45 size of images to fit in detecting the cars and it’s safe

to set the value for recommended image size. In cascading tab, it shows the Haar-like

features.

Haar-like Features

Haar-like features are image that will used in object recognition, Haar-like features has

haar-wavelet to rescaled square-shaped functions and its very similar to fourier analysis in digital

signal processing. Haar features having an edge features and line features. Edge features can

detect the edges quite effectively and the line features also can detect the lines quite effectively.

In the square shaped, they exactly white pixel and black pixel. In real image, there’s no

completely white or black pixel because the image was grayscale image. Every single pixel has

35
the value of (0,255). There’s a horizontal surface and vertical surface of line features and it’s the

same as edge features.

Haar classifiers in Cascade tab are very accurate than HOG and LBP but it requires more

time to train while in HOG and LBP the provide classifiers are quicker to train and it requires

less time to train but it’s less accurate so the proponents used HAAR classifier.

Figure 4.2.8 – Cascade Trainer (Boost Tab)

Figure 4.2.8. It shows the different attributes/rates to train the classifier, the proponents

used default because it can cause changes and it will affect the stages in cascading the classifier.

The minimal desired hit rate per stage and it will estimate as 0.9950000. These parameters show

that this is the limits of counting the week trees, specifies whether trimming should be used in

weight, the maximal of the desired false alarm rate, for every cascade stage.

Research Question 4: How will be the accuracy of the image processing affects the
system?

36
Table 4.1 – Relationship of Vehicle Amount and Time

Volume Analyzation Go Time Go Time Stop Stop Time

of of traffic (Actual) (Program) Time (Program)

Vehicles in in seconds (Actual) in seconds

seconds in

seconds

0-4 Low traffic 5 5 15 15

5-7 Medium 10 10 10 10

Traffic

8 above High Traffic 15 15 5 5

The tabulation listed on table 4.1, it shows the analyzation and the relationships from first to

the last column. It shows here the exact number of vehicles for the analyzation of the traffic on

road whether it’s a low, medium and high traffic. For the timing in the system the researcher

equal the max time to have synchronization for the three lanes. For example the reading on the

system is low, high and high traffic respectively from first lane to the third lane, the output will

display the “stop” time on all screen will be 15, 5 and 5 seconds then later on the second and

third lane will transition to “go” time which it should display 15 seconds and the first lane will

remain at “stop”. Then afterwards when the first lane reaches at 0 seconds of “stop” time it will

now count as “go” with 5 seconds to equal the counting with the second and third lane. On the

go and stop time there is two classifications the program means the supposedly time that the

37
system should do and display while the actual is the displayed counting on the LCD while the

system is running.

Table 4.2 – Accuracy of Image Processing

In table 4.2 it shows that the system can detect the vehicles in fixed position but due to
Number Number of Cars Detected Accuracy

of Testing Vehicles

1 10 10 100%

2 9 6 66.67%

3 8 5 62.5%

4 10 7 70%

5 3 2 66.67%

6 5 3 60%

7 7 3 42.86%

8 6 3 50%

9 4 4 100%

10 2 2 100%

Overall Accuracy: 71.87%

blurry of camera module, this problem occurs when low ambient light conditions prevent an

imaging system from using sufficiently short exposure times, resulting in having hard time to

detect vehicles in some area.

The researcher conducts ten number of testing to have information about on the system

whether it performs well and to know the limitation and other factors affecting the accuracy of

the system. On the first testing there are 10 cars placed on the road and it detects perfectly and

38
100% accurate. The main reason of that is because the light ambient there is good and the system

accept it. On the second to the last number of the testing the road transferred on another place

which the lighting is not good resulting of low percentage in accuracy. Summing all the

percentage from test 1 to test 10 and divided it to 10 to get the average percentage of accuracy,

the researcher gets 71.87%.

Chapter 5

SUMMARY, CONCLUSIONS AND RECOMMENDATION

This chapter presents findings, conclusion and recommendation of the entire project. It

also concentrates on answering the problems from the previous chapter.

Research Question 1: What are the present situations of traffic in the city?

Today, the community used a time based traffic light that will trigger the lights to change

when the timer reached zero. Traffic lights are manually operated where there’s is an operator

that is assigned to change the traffic lights depending on the load of the vehicles. The

researchers developed the Smart Traffic Light with Monitoring System that analyzes real-

time traffic data in the road while scheduling each time phase of a traffic light.

Research Question 2: What hardware system design is capable of detecting or counting the
vehicles in the specific area of the road?
The project used image processing using Raspberry Pi Camera Module to be able to

detect vehicles/cars. This study will have concept of the previous traffic light where there is

an operator, but in this project it will have a camera that will serve as operator. To have a

better and well balance view, the camera was placed as higher as possible where it can capture

the vehicles accurately and the exact distance of the experimental road. While, Raspberry Pi

serves as the brain of the proposed study which stores all the important hardware and

39
software system that interconnects other hardware used by receiving and sending data to be

displayed the results after it process. The number of vehicles on the road makes changes in

the countdown to avoid congestion wherever possible. Hardware also includes connection of

these cameras to the server to receive live feed which is capable enough for handling the

processing requirements. The Raspberry pi also the one that integrates all software and other

hardware used.

Research Question 3: How the integration of hardware and software system controls the
signals and adjusts the timing and phasing of lights according to the
limits that are set in controller programming?
The proponents must have proper learning on how to manipulate the software called

Python. The proponents acquired an idea on how to manipulate the said software through

continuous research and reading on related literature and studies to make proponents make

strategies on the proposed study. Image processing used mathematical operations by using

any form of signal processing for which the input is an image taken from the camera module.

The output of image processing may be either an image or a set of characteristics or

parameters related on the image. The system will detect every vehicle in fixed position, after

that it will determine the time allotted for traffic lights to let the vehicles to go or to stop. By

this method, it is more efficient for every roadway thru reducing the number of accumulated

vehicles to reduce traffic.

Research Question 4: How will be the accuracy of the image processing affects the system?
The researcher aims to decrease waiting time on every vehicle to keep the flow of

vehicles at the most efficient rate and develop a solution to determine go signals and phase

sequence of traffic lights. To know the density of the traffic, it will use the camera module

to identify the density of traffic. Cameras would be capturing video and broadcasting it to

40
the servers where using video and image processing techniques the vehicle density on every

side of the road is calculated and an algorithm is employed to switch the traffic lights

accordingly. For the timing in the system the researcher equal the max time to have

synchronization for the three lanes.

5.2 Conclusion

1. The Smart Traffic Light with Monitoring System helps reduced traffic jam by using the

Raspberry Pi Camera Module which captured image on the road. The traffic light will

automatically adjust based on the number of captured vehicle sent by the camera to the

main board using the developed algorithm.

2. Smart Traffic Light with Monitoring System reduces human efforts and increases the

efficiency of traffic signal for detecting the vehicle and helps to produce smooth motion

of automobiles in the transportation routes.

3. The aim of the researchers is to design transportation products, services and systems to

decrease waiting time on every vehicle to keep the flow of vehicles at the most efficient

rate and ensure better travel experience for drivers especially for commuters that used to

monitor and control the flow of automobiles based on the current technologies available.

4. The study proved that image processing programmed by using python can be used to

determine the number of vehicles in the road. The said amount of vehicles is the one to

be used in the algorithm of smart traffic light.

5.3 Recommendation

The proponents recommend to the future researchers with the similar project to improve

and enhance the following features of the Smart Traffic Light with Monitoring System.

41
1. Make the system in a 2 way road to increase the efficiency and order of traffic to reduce

the number of traffic congestion and accidents.

2. Make the system works with intersections to provide clear guidelines regarding when

vehicles should stop or go.

3. Use a higher hardware specification of the proposed study to make the system more

efficiently and accurately like a high quality sensor or camera module that has a high

percentage of functionality.

4. Additional feature of placing a GSM Module to act as guide to it’s subscribers and the

enforcers or authority and informing the daily updates of the flow of traffic. Also adding

features for informing if there is a collision or accident.

5. References

Badache, Bouabdallah, Challal, Doudou, Djenouri, Kafi. (2012). Wireless Networks for

Urban Traffic Monitoring: Applications and Architectures. Retrieved from

https://www.researchgate.net/publication/257719808_A_Study_of_Wireless_Sensor_N

etworks_for_Urban_Traffic_Monitoring_Applications_and_Architectures.pdf

Bagyamani, Janet. (2015). Traffic Analysis on Highways based on Image Processing.

Retrieved from

http://www.periyaruniversity.ac.in/ijcii/issue/Vol5No1June2015/IJCII%205-1-172.pdf

Boukerche, Yournes. (2013). An Intelligent Traffic Light scheduling algorithm through

VANETs. Retrieved from

42
https://www.researchgate.net/publication/272025351_An_Intelligent_Traffic_Light_sc

heduling_algorithm_through_VANETs.pdf

Collotta, Giuffr'e, Pau, Scat'a. (2014). Smart Traffic Light Junction Mangement Using

Wireless Sensor Networks. Retrieved from

http://www.wseas.org/multimedia/journals/communications/2014/a305704-343.pdf

Felicio, Grepo, Reyes & Yupingkun. (2015). Traffic Light Display and Driver

Behaviors. Retrieved from

https://www.sciencedirect.com/science/article/pii/S235197891500880X.pdf

Kanungo, Sharma, Singla. (2014). Smart Traffic Lights Switching and Traffic Density

Calculation using Video Processing. Retrieved from

https://www.researchgate.net/profile/Anurag_Kanungo/publication/269310721_Smart_t

raffic_lights_switching_and_traffic_density_calculation_using_video_processing/links/

563e5ec108ae45b5d28c563a/Smart-traffic-lights-switching-and-traffic-density-

calculation-u

Lin, Wang. (2010). Currency Recognition System Using Image Processing. Retrieved

from

http://www.academia.edu/19281558/Currency_Recognition_System_Using_Image_Pro

cessing

Maglad. (2012). A Vehicle License Plate Detection and Recognition System. Retrieved

from

https://pdfs.semanticscholar.org/86a2/d55f5ecd0b2b19d7b7019dd0740628db3935.pdf

43
Maseleno, Mulung. (2015). SMART Traffic Signal Control in Brunei Darussalam.

Retrieved from

https://www.researchgate.net/publication/308460014_Proposed_SMART_Traffic_Sign

al_Control_in_Brunei_Darussalam

Mrovlje & Vraneie. (2008). Distance Measuring Based on Stereostopic Pictures.

Retrieved from Retrieved from: http://dsc.ijs.si/files/papers/S101%20Mrovlje.pdf

44

Potrebbero piacerti anche