A Smart Driving Assistance System to Elevate the Driving
Experience of Drivers in Sri Lanka
18-018
Software Requirements Specification
Nuwan Kodagoda
Kiruthiga Balendran
BSc. (Hons) in Information Technology
Department of Software Engineering
Sri Lanka Institute of Information Technology
Sri Lanka
May 2018
ii
A Smart Driving Assistance System to Elevate the Driving
Experience of Drivers in Sri Lanka
18-018
Software Requirements Specification
(SRS documentation submitted in partial fulfilment of the requirement for the Degree
of Bachelor of Science Special (honors)
In Information Technology)
BSc. (Hons) in Information Technology
Department of Software Engineering
Sri Lanka Institute of Information Technology
Sri Lanka
May 2018
3
DECLARATION
I declare that this is our own work and this SRS does not incorporate without
acknowledgement any material previously submitted for a degree or diploma in any
other university or Institute of higher learning and to the best of our knowledge and
belief it does not contain any material previously published or written by another
person except where the acknowledgement is made in the text.
The supervisor/s should certify the SRS report with the following declaration.
The above candidate is carrying out research for the undergraduate dissertation under
my supervision.
……………………………………….. …..…...………….………………
Signature of the supervisor Date
……………………………………….. …..…...………….………………
Signature of the co-supervisor Date
Name Student ID Signature
B. Kiruthiga IT15135308
4
TABLE OF CONTENTS DECLARATION ......................................................................................................... 3
INDEX ......................................................................................................................... 6
LIST OF FIGURES ..................................................................................................... 7
LIST OF TABLES ....................................................................................................... 8
1 Introduction .......................................................................................................... 9
1.1 Purpose .......................................................................................................... 9
1.2 Scope ............................................................................................................. 9
1.3 Definitions, Acronyms, and Abbreviations ................................................. 10
1.4 Overview ..................................................................................................... 10
1.4.1 Main goals ............................................................................................ 10
1.4.2 Specific goals ....................................................................................... 11
1.4.3 Users .................................................................................................... 11
1.4.4 Organization of SRS ............................................................................ 11
2 Overall Descriptions .......................................................................................... 12
2.1 Product perspective ..................................................................................... 13
2.1.1 System interfaces ................................................................................. 15
2.1.2 User interfaces...................................................................................... 15
2.1.3 Hardware interfaces ............................................................................. 15
2.1.4 Software interfaces ............................................................................... 15
2.1.5 Communication interfaces ................................................................... 15
2.1.6 Memory constraints ............................................................................. 16
2.1.7 Operations ............................................................................................ 16
2.1.8 Site adaptation requirements ................................................................ 16
2.2 Product functions ......................................................................................... 16
2.2.1 High level diagram of lane departure warning system ........................ 17
5
2.2.2 Use case diagram of lane departure warning system ........................... 17
2.2.3 Use case scenarios ................................................................................ 18
2.3 User characteristics ..................................................................................... 19
2.4 Constraints ................................................................................................... 19
2.5 Assumptions and dependencies ................................................................... 19
2.6 Apportioning of requirements ..................................................................... 20
3 Specific Requirements ....................................................................................... 21
3.1 External interface requirements .................................................................. 21
3.1.1 User interfaces...................................................................................... 21
3.1.2 Hardware interfaces ............................................................................. 21
3.1.3 Software interfaces ............................................................................... 21
3.1.4 Communication interfaces ................................................................... 21
3.2 Classes/Objects ............................................................................................ 22
3.3 Performance requirements ........................................................................... 22
3.4 Design constraints ....................................................................................... 23
3.5 Software system attributes .......................................................................... 23
3.5.1 Reliability ............................................................................................. 23
3.5.2 Availability .......................................................................................... 23
3.5.3 Security ................................................................................................ 23
3.5.4 Maintainability ..................................................................................... 23
3.6 Other requirements ...................................................................................... 23
4 Supporting information ...................................................................................... 24
4.1 References ................................................................................................... 24
6
INDEX
Android .............................................................................. 9, 10, 12, 13, 14, 15, 19, 21
Camera ......................................................................................... 13, 15, 16, 19, 20, 21
Canny Edge Detector ................................................................................................. 13
Dashed lines ......................................................................................................... 12, 14
Drivers ............................................................................................ 9, 10, 11, 12, 19, 23
Hough Transform algorithm ...................................................................................... 13
Image Processing algorithms ..................................................................................... 20
Lane boundaries ....................................................................................... 11, 13, 14, 23
Lane crossings .......................................................................................... 10, 13, 14, 16
Lane departure.............................................................................. 10, 11, 13, 16, 17, 22
Lane departure warning ............................................................................................. 13
Lane Detection ................................................................................. 8, 9, 11, 12, 14, 24
Lane separator ............................................................................................................ 13
Low light .............................................................................................................. 12, 14
NDK ..................................................................................................................... 10, 21
OpenCV ............................................................................................................... 15, 21
Solid line .................................................................................................................... 13
7
LIST OF FIGURES
Figure 1 - Lane detection ........................................................................................... 15
Figure 2 - High level diagram of the component ....................................................... 17
Figure 3 - Use case diagram of the component .......................................................... 17
Figure 4 - Enabling lane tracking ............................................................................... 21
Figure 5 - Class diagram of the component ............................................................... 22
8
LIST OF TABLES
Table 1- Definition for the terms used in SRS ........................................................... 10
Table 2- Glossary of Acronyms ................................................................................. 10
Table 3- Comparison of Lane Detection Applications .............................................. 14
Table 4- Use case scenario 1 ...................................................................................... 18
Table 5 - Use case scenario 2 ..................................................................................... 18
9
1 Introduction
1.1 Purpose
The purpose of Software Requirement Specification (SRS) is to provide a
comprehensive description to the Lane Detection component of Smart Driving
Assistance System. It will be used to assist in research study, design, system
development and testing. This document gives a clear and precise details of functional
and non-functional requirements of the component. The connection between the
functionalities and the technical aspect of design is discussed in detail in this
document.
This document specifies various kinds of interfaces such as system interfaces, user
interfaces, software interfaces and includes constraints, limitations under which the
system should work. The product work flow with the performance requirements and
the system attributes are also incorporated to the document.
The targeted audience of this document are the supervisor Mr. Nuwan Kodagoda, co-
supervisor Ms. Disni Sriyaratna who guide us throughout the research and
development of our project, project coordinators, developers, testers and end users.
1.2 Scope
This document covers the requirements of the Lane Detection in detail so that to
provide a guide to the developers in designing and building the solution. The scope of
the SRS is also to describe the tools and techniques that are going to be used in
developing this component. It is bounded to elaborate the technologies referred in the
implementation of this section. The document addresses how the process flows by
using the architecture diagram, what constraints are used to build the module and how
the quality attributes benefit the system. Further, it specifies how the system should be
accessed and the hardware and network consumption when it is launched.
Drive Assist is an Android mobile application which guides the driver to look out for
road signs, keep an eye for pedestrians, assess a safe speed and track the lane on the
road. It is developed as a solution to assist the drivers who need support in places of
difficulty and emergency. Using this system, the driver will be assisted to take smart
decisions in the long journey and this results in reducing the cause of accidents.
10
1.3 Definitions, Acronyms, and Abbreviations
Table 1- Definition for the terms used in SRS
Term Definition
Android NDK Using native code to write algorithms to
improve speed
Android Open CV A standard C++ library used for
computer vision applications
Table 2- Glossary of Acronyms
Acronym / Abbreviation Definition
SRS Software Requirement Specification
GPS Global Positioning System
NDK Native Development Kit
GB Giga Bytes
RAM Random Access Memory
1.4 Overview
Smart Driving Assistance System is an Android application which is beneficial for the
drivers who need a guide to assist them in the long journey. The main tasks of Drive
Assist are to alert drivers to oncoming pedestrian crossings and road signs beforehand,
analyze a safe speed that should be followed at several points and to detect the lanes
while tracking the position of the vehicle and warn the driver on lane departure.
Finally, a voice guide is aided from the application to achieve its tasks.
1.4.1 Main goals
• Providing a guide to support the drivers in their long journey and to keep
them alerted to avoid oncoming dangers.
• Advising the drivers who take up new routes to oncoming road signs,
pedestrian crossings and assessing their speed and be aware of any lane
crossings.
11
1.4.2 Specific goals
Specific objectives of Lane Detection are listed below
• Identifying lane boundaries and separators to detect lane by considering
several environmental factors.
• Alert the driver using a voice guide on lane departure
1.4.3 Users
The users of the application are the drivers who need a guide to assist their journey.
These drivers are both regular commuters and long journey travelers.
1.4.4 Organization of SRS
This SRS is mainly concerned on the research component ‘Lane Detection’. The
document is mainly organized into four chapters. The first chapter gives an outline on
this document and specifies the purpose, scope and structure of the document.
The second chapter contains an overall description of the system while explaining the
product perspective with interfaces, constraints and limitations. Further, it describes
the product functions and informal requirements of the system and focuses on the
assumptions and dependencies.
The third chapter is ‘Specific Objectives’ which discusses about the specific
requirements of the system. It describes the external interfaces that communicate with
this system and explains on the non-functional requirements. Final chapter includes all
the supporting information such as references and appendices in this document.
12
2 Overall Descriptions
In a long journey, high level of concentration and the necessity of assistance are very
much needed for drivers. In situations like driving in a new route, a lone driver will
need assistance and might need support in places of difficulty and emergency. A guide
who suggests on average speed to be taken at the bends, forewarns of the nearby road
signs and pedestrian crossings, alerts when the vehicle is departing from the lane and
directs on the path and navigations would be a great advantage to the drivers.
There are systems that provide the drivers with some of the above-stated guidance.
These systems help to solve some of the issues faced by the drivers and they reduce
the level of causing accidents in minor level. Thus, the proposed system is there to
bind all the major difficulties addressed by the drivers and to be a guide to assist in the
long journey to make smart decisions. This will help in reducing the cause of accidents
and ensures that drivers are obeying the law.
The proposed system is a smart driving assistant which will be built on Android
platform. The key tasks of this application are to assess safe speed, forewarn the driver
to oncoming pedestrian crossing and road signboards and track the lane and warn the
driver on lane departures.
Lane Detection
Observing lane discipline is an essential safety measure on the road. Paying more
attention to the lane position is essential as there are so many accidents take place.
Sometimes, it is very easy to identify the lanes using human eyes. However, at certain
situations such as poor road lines, shadows cast from trees and buildings, parked
vehicles and low light areas it is difficult [1]. The following are the main essential cues
in detecting lanes for a smart driving.
• Lane boundaries - They are identified by different shapes and colors. These
identifiers may vary from solid lines through dashed lines. In Sri Lanka, these
line marks subject to change. Some places in our country use white and orange
whereas some use yellow.
13
• Lane departure warning - An alert which tries to make a road driving safer and
prevent accidents related to a moving vehicle outside of its lane due to driver
inattention. The idea behind this is to notify a driver in a situation when a
vehicle is moving outside of its lane but this movement is not desired by a
driver [2].
Lane detection algorithms are implemented to identify lane boundaries and separators
so that to calculate the position of the vehicle on the road. The steps that are followed
in the real-time lane detection process are as follows.
1) Video acquisition
2) Matrix down sampling and set Region of Interest
3) Line detection
4) Lane detection
5) Lane tracking
6) Warn the driver on lane departure
Vision-based approach is used for video acquisition. In this project, we will be using
Android phone camera instead of an external camera to capture the video stream to be
used as an input to the system. The region of the lane boundaries is focused by
removing the other unwanted area in the frame. Edges are identified by an algorithm
called Canny Edge Detector. Then the feature extraction is done. The main feature that
is extracted are road lines and this is detected by Hough Transform algorithm. Finally,
paths of the lanes are detected and the position of the vehicle is tracked. As a result,
warnings are given to the driver on lane crossings.
2.1 Product perspective
There are few number of products developed using smartphone video camera and used
for real-time detection. The iOnRoad [3] was developed to run on both Android and
iOS platforms. One of the main functions of this application is lane detection. The
drawback that we figured in this app is that it detects only the solid line and warns the
driver whenever crossing a solid line. The aCoDriver 5 [4] is an Android app
developed to warn the driver when the vehicle tries to cross the lane separator.
However, this application is designed to detect lanes in Europe only.
14
Even though, there are existing products like iOnRoad and aCoDriver 5, they limit
themselves in showing some important features. In most of the roads, lane separators
are drawn in dashed lines and lane boundaries are drawn in solid lines. Moreover, the
paint of the lines will be faded and detecting lanes would not be an easy task. Some
researchers have explained on how to detect lanes from a video clip which is not done
at real-time. Although there are some systems which is used for lane detection but
identifies only the straight lines.
Table 3- Comparison of Lane Detection Applications
Existing Products Comparison
iOnRoad
This application mainly focuses on collision warning
and lane detection.
Similarities
Both the applications do a real-time lane detection and
identify solid lines at night time and low light. They
alert the user on lane crossings.
Drawbacks in the
application
Solution in the
proposed system
Fails to identify dashed lines Identifies all type of
lines
aCoDriver 5
An Android application which assesses speed limits,
does distance controlling and lane detection.
Similarities
Both the applications identify all types of lines and
warn the user on lane crossings.
Drawbacks in the
application
Solution in the
proposed system
Fails to detect lines at night
time and low light
Provide assistance at
any time of the day.
15
Warns the driver with only
audio alerts
Warnings are given in
both audio and video
modes
2.1.1 System interfaces
Lane detection component doesn’t have any communication with other systems or
other components. Therefore, it doesn’t have any system interfaces.
2.1.2 User interfaces
Figure 1 - Lane detection
2.1.3 Hardware interfaces
Lane detection module is a mobile application which acquires the video from its rear
facing camera. Therefore, it doesn’t requisite any special hardware except a
smartphone with 8MP rear-camera.
2.1.4 Software interfaces
The component needs Android 5.0 or above to run the system. As the lane detection is
done at real time, processing the frames and detecting the lanes are done from
Android’s OpenCV.
2.1.5 Communication interfaces
Lane detection system can be worked in offline mode. Hence, there is no need of an
active internet connection.
16
2.1.6 Memory constraints
A minimum of 1GB RAM with a storage space of 100MB is required by the
application to run it effectively. 200MB of space is needed to install the application
from Google Play Store.
2.1.7 Operations
• Drive Assist system will be available in Google Play Store. Therefore, users
should download the application and install it in their smart phone.
• The placement of the phone should be properly set so that the rear camera
would capture the clear view of the lanes
• User should set the volume of the smart phone to an appropriate volume to hear
the lane departure warnings.
2.1.8 Site adaptation requirements
The user doesn’t need to do any specific training for this component to run. Frames
analyzation and lane detection are done by the system itself. The user only needs to
toggle the activation of lane detection module before he starts the journey.
2.2 Product functions
The lane detection component acquires the image frames from the rear camera and
analyzes the frames. Image processing techniques are applied to the frames to find the
lane markers on the road. Then lane detection is done to identify the current lane of
the driver. Finally, driver is assisted with the warnings on any lane crossings.
17
2.2.1 High level diagram of lane departure warning system
Figure 2 - High level diagram of the component
2.2.2 Use case diagram of lane departure warning system
Figure 3 - Use case diagram of the component
18
2.2.3 Use case scenarios
Table 4- Use case scenario 1
Use case ID UC_1
Use case name Start tracking lanes
Goal in context User’s current lane is tracked
Pre-condition The application is started
Post-condition None
Primary actor Driver
Secondary actor None
Main flow
Step Action
1 User clicks on the icon
to start the lane
detection
2 The current lane on
which the user
travelling is identified
3 User departs from the
current lane
4 Extend (Get alert)
Table 5 - Use case scenario 2
Use case ID UC_2
Use case name Get Alert
Goal in context User gets a warning
Pre-condition The application is started
Post-condition None
Primary actor Driver
Secondary actor None
Main flow Step Action
19
1 The user’s lane is
detected
2 User receives an audio
of an alert
2.3 User characteristics
The Android application, Drive Assist is mainly targeted on drivers. The
characteristics of a driver are as follows
• A driver license with knowing the basic rules and regulations that must be
followed on the road are essential.
• Ability to understand English
• Ability to operate an Android application
2.4 Constraints
• Running all four components, which include two real time tracking
functionalities might slow down the performance
• Bad weather conditions would be an obstacle to identify the lane trackers
• The rear facing camera of android phone should be 8MP to obtain a higher
definition of video stream.
• The application will be designed only in English language
• System failures may occur due to network failure or power failure
2.5 Assumptions and dependencies
Certain assumptions are required in this application
• A valid driver’s license is needed and the driver knows how to drive a vehicle
• Drivers should be aware to handle the mobile application
• Other objects that cover the lane markings should not be presented on the
road
• A minimum of more than 1GB of RAM is required
Certain dependencies related to lane detection module are as follows
20
• Video stream should be obtained from the phone camera buffer
• The video should be processed using Image Processing algorithms to identify
lane markers
2.6 Apportioning of requirements
The major functions of the component and its outcomes won’t change. However, the
technologies and some methodologies mentioned in this document might change in
order to provide more feasible and accurate product.
Section 1 and 2 of this document describe the requirements which are also referred as
primary specifications. Section 3 is referred as desirable requirements. These
requirements are to be implemented in this release if possible, but are not committed
to by the developers. It is anticipated that they will be part of future release. 'Optional
requirements' will be implemented at the discretion of developers.
21
3 Specific Requirements
3.1 External interface requirements
3.1.1 User interfaces
Figure 4 - Enabling lane tracking
When the user opens the application, the above ‘Enable Lane Tracking’ interface will
appear. The icon on the top left corner should be selected to enable the lane tracking
process. Once it is selected by the user, it will detect the lane as shown in figure 1 in
section 2.1.2 in which the user is travelling by marking the lane separators.
3.1.2 Hardware interfaces
The component will be running in Android smart phone which uses its rear camera to
acquire the image frames to do a real-time lane detection. The camera module will be
connected with Android NDK to do the processing.
3.1.3 Software interfaces
Lane detection component is built in Android. It doesn’t have any connection with the
server. All the line identification and drawing lane markers on the video require high
computational power. Therefore, Android NDK is used in which C++ along with
OpenCV handle the process.
3.1.4 Communication interfaces
The software module doesn’t require any internet connection to retrieve or update data
since the data gathering happens inside the Android platform itself.
22
3.2 Classes/Objects
The class diagram below shows various classes that interact with the Lane Departure
Warning System. Classes are shown in rectangular boxes with the attributes and
operations they may perform. Lines show the association between the classes.
Figure 5 - Class diagram of the component
3.3 Performance requirements
Capacity:
• The system is built on mobile platform. Therefore, processor speed of
1.6GHz, 1GB of RAM and the storage of minimum 32GB are required to do
a real-time lane detection.
Response time:
• The system will track the lanes in real-time with no delay.
User interface:
• The user interface of the lane departure warning system displays the over-
layered path of the lane within one second.
23
3.4 Design constraints
Along with identifying lanes, departure warnings should be given to the user which
don’t interrupt the concentration of drivers but provide an appropriate assistance in
his journey. The user should also be able to toggle the activation of the lane detection
module.
3.5 Software system attributes
3.5.1 Reliability
In a real time driving environment, identifying lanes and giving departure warnings
should be accurate. Algorithms are designed in a way that track the correct path in
which the user is travelling.
3.5.2 Availability
The lane detection module will be available for 99.99% as no data is retrieved from
the server. However, the maintenance would be required at the initial stage for more
accuracy.
3.5.3 Security
No security related to data privacy is required for the lane detection module as no data
is saved to identify the lanes. However, data privacy mechanisms are imposed to other
modules to protect the location, speed and other details.
3.5.4 Maintainability
The system should be maintained in a way so that further enhancements could be
plugged in to the system easily. Components should be built using modularity concepts
to achieve future goals with minimal effort.
3.6 Other requirements
A better visualization of the lane boundaries would give a clear image to the driver on
his path. Improving the performance of the app by achieving higher frames per second
rate.
24
4 Supporting information
4.1 References
[1] M. Aly, "Real time Detection of Lane Markers in Urban Streets", Intelligent
Vehicles Symposium, IEEE, pp. 7-12, 2008.
[2] A.B.Hillel, R.Lerner, D.Levi and G.Raz, “Recent Progress in Road and Lane
Detection - A survey”, Machine Vision and Applications, vol. 25, Apr. , pp. 727 - 745,
2014
[3] iOnRoad Augmented Driving Lite. iOnRoad, 2011.
[4] aCo Driver 5. EvoTegra GmbH, 2013.