0% found this document useful (0 votes)
6 views

Lane

This paper presents a real-time lane detection system using Python and OpenCV on a Raspberry Pi, aimed at enhancing driver safety by detecting lane departures. The system utilizes Canny edge detection and Hough Transform to identify lane markings from captured images and videos, while also addressing challenges such as shadows and occlusions. The implementation demonstrates effective lane detection performance, contributing to the development of advanced driver assistance systems.

Uploaded by

saurabhkulthe9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Lane

This paper presents a real-time lane detection system using Python and OpenCV on a Raspberry Pi, aimed at enhancing driver safety by detecting lane departures. The system utilizes Canny edge detection and Hough Transform to identify lane markings from captured images and videos, while also addressing challenges such as shadows and occlusions. The implementation demonstrates effective lane detection performance, contributing to the development of advanced driver assistance systems.

Uploaded by

saurabhkulthe9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

International Journal for Research in Engineering Application & Management (IJREAM)

ISSN : 2454-9150 Vol-05, Issue-06, Sep 2019

Real time lane detection system using Python and


OpenCV on Raspberry Pi
*
Mr.Mustafa Surti, #Prof. (Dr.) Bharati Chourasia
*
PG Student, #Head-EC Department, SRK University, Bhopal, India. *[email protected],
#
[email protected]

ABSTRACT - Driver assistance system is a technology used to make motor vehicle travel safer by automating,
improving or adapting some or all of the tasks involved in operating a vehicle. Driver assistance serves to make travel
comfortable and easier, while also increasing car and road safety. While some systems help with the task of driving,
others alert the driver to errors or hazards, such as lane departure detection and drowsiness detection. Aside from
vehicle control, driver assistance can also refer to secondary driving tasks such as location finding, route planning and
obstacle detection. Driver assistance is a developing field. This paper aims at detecting lanes using Python and
OpenCV. In real time vehicular movements will be captured using a camera and the same will be processed to achieve
the goal. The Hough Transform is used to detect lanes in an image or video.

Keywords: Lane detection, Hough Transform, Canny edge detection, Python OpenCV

I. INTRODUCTION implemented using OpenCV library function on raspberry-


pi hardware. This method can correctly detect the roads in
Driver Assistant System is designed to assist drivers in the various challenging situations. Results shows that the
perception of any dangerous situations before, to avoid proposed method can detect both the straight and curves
accidents after sensing and understanding the environment lanes correctly. [2]
around itself. To date there have been numerous studies
into the recognition. Traffic accidents have become one of Over the last few years, there is rapid increase in the
the most serious problems. The reason is that most embedded electronic subsystems in vehicles; intelligent
accidents happen due to negligence of the driver. Rash and driver assistance system forms a significant component.
negligent driving could push other drivers and passengers The different electronic subsystems such as vision based
in danger on the roads. More and more accidents can be advance driver assistance system form the significant
avoided if such dangerous driving condition is detected contribution toward the intelligent driver’s assistance
early and warned to other drivers. Most of the roads, system. The application of the intelligent driver assistance
cameras and speed sensors are used for monitoring and system works towards to form a driver less vehicle. These
identifying drivers who exceed the permissible speed limit new up growing technologies are trying to create a driver
on roads and motorways. This simplistic approach, and assistance system that goes beyond the automatic control
there are no restrictions. system. [3]

II. BACKGROUND Recently, many studies are conducted based on


advanced driver assistance system (ADAS) to avoid car
Prof A. B. Deshmukh e t a l [ 2 ] in their paper that accidents. Mostly, the lane departure warning system
Lane detection is an essential component of Advance (LDWS), this system warns the driver when the vehicles
Driver Assistance system (ADAS). Many different tend to depart of its lane, which is the most basic and
approaches have been proposed till today by researchers important part of the ADAS. [4]
but still it is a challenging task to correctly detect the road
The literature related to advance driver assistance is mostly
lanes in various environmental conditions. The main
in view of utilizing one or more rear camera to detect the
purpose of the system is to detect the lane departure to
lane stripes. There are various sensors like LIDAR,
avoid road accidents and to provide safety for pedestrians.
RADAR and so on are utilized for recognizing the things
The proposed method detects the road edges using the
and 3D display of the roads. Likewise, here and there
canny edges detector whereas the feature extraction
camera confronting the driver is utilized to detect the
technique like Hough transform is used in image analysis
behavior (drowsiness, sleepiness etc.) of the driver while
and digital signal processing. The main input to the system
driving. [5]
is camera captured images in order to detect and track the
road boundaries. This concept of image processing is

100 | IJREAMV05I0654042 DOI : 10.35291/2454-9150.2019.0426 © 2019, IJREAM All Rights Reserved.


International Journal for Research in Engineering Application & Management (IJREAM)
ISSN : 2454-9150 Vol-05, Issue-06, Sep 2019

In lane departure warning system, the lane detection is the important role to detect it. Here only the selected are as is detected or
initial step to be taken. There are two types of taken for the next level of processing. These selected ROI images are
methodologies used in lane identification: the elements- then used for lane detection using a proposed algorithm. The
based methodology and the model-based methodology. The selection of ROI reduces the processing time of the frames.
elements-based methodology detects the lane from the
4. Hough Transform: The Hough Transform is implemented on
images of roads by detecting the low- l e v e l elements
images after the canny edges detection has taken place so as to obtain
such as lane edges etc. This methodology requires all
the image pixels that are desired ones. So here in this system to detect
round painted lanes or solid lane edges, otherwise it cannot
the lanes marking from the image data, Hough Transform is used.
detect it. This methodology may experience the ill effects
of impediment. [6] 5. Lane Detection: Here, the Lane will be marked with a separate color.
The model-b ased methodology uses geometric Two important algorithms Canny Edge Detection and Hough
parameters such as assuming the shape of lane can be Transform are used to implement Lane Detection System which are
presented by straight line or curve. [7] explained below:
Abhay Tewari et al proposed in their paper that Lane
Canny edge detection:
detection techniques play a significant role in intelligent
transport system. Abhaya et al [2] proposed a smart driver Canny edge detection is a technique to extract useful
assistance system that will help drivers to avoid accidents structural information from different vision objects and
during lane departures by providing prompt and quick dramatically reduce the amount of data to be processed. It
marking of lanes. Proposed novel system is providing has been widely applied in various computer vision
automatic detection and recognition of traffic signs. systems. Canny has found that the requirements for the
Detection is providing good results under different application of edge detection on diverse vision systems are
lightning conditions. Recognition is based on cascade relatively similar. Thus, an edge detection solution to
pattern of CNNs that are trained using Histogram of address these requirements can be implemented in a wide
oriented gradient (HOG). The region where Traffic signs range of situations. The general criteria for edge detection
are located are identified as a candidate region and can be include: [1]
calculated through the process called MSERs. Synthetic
dataset has been generated so as to increase the number of 1. Detection of edge with low error rate, which means that
images in dataset to increase the performance in terms of the detection should accurately catch as many edges shown
accuracy and to train model better. in the image as possible.

III. ALGORITHM 2. The edge point detected from the operator should
accurately localize on the center of the edge.
The block diagram of a proposed lane detection system on
Raspberry Pi is shown in the figure below: 3. A given edge in the image should only be marked once,
and where possible, image noise should not create false
edges.

Figure2: Example for canny edge Detection [1]


Figure 1: Block diagram of Lane Detection System
Hough Transform:
Each blocks of a block diagram are explained one by one below: The features of various shape inside an image can be
1. Capture input image: Hardware like Camera is used to take input separated using a technique called as Hough Transform.
image. This technique is generally used for the identification of
arbitrary shapes such as straight lines, circles, ellipses, etc.
2. Image Preprocessing: To enhance the quality of image, we need to The Hough Transform is implemented on images after the
preprocess it. The processes like noise reduction, edge detection, contrast canny edges detection has taken place so as to obtain the
and color management are applied. image pixels that are desired ones. So here in this system to
detect the lanes marking from the image data, Hough
3. Region of interest: In determining the computational
Transform is used. The primary point of interest of the
complexity of lane identification and LDI system, ROI plays an

101 | IJREAMV05I0654042 DOI : 10.35291/2454-9150.2019.0426 © 2019, IJREAM All Rights Reserved.


International Journal for Research in Engineering Application & Management (IJREAM)
ISSN : 2454-9150 Vol-05, Issue-06, Sep 2019

Hough Transform technique allows gaps in feature y = mx + c, we can rearrange it as:


boundary descriptions and is not affected by noise. In
y = ax + b or b = -ax + y
general, the straight-line equation is given by y = mx + c
can be represented as point (c, m) in the parameter space or We have converted xy plane into ab plane
Cartesian co-ordinate system. For the Hough transform we
convert the equation to polar co- ordinates i.e. in terms of b = -ax + y
rho and theta. [3]

b = -a (1) + 5

Where r is the distance from the initial position to


closest point on straight line and theta (ɵ) is the angle
between the line connecting the origin and the x axis.
The (r, ɵ) plane is referred to as Hough space. The
Hough transform detect the straight line in two
dimensional arrays (matrix). Each element of the
matrix has values equal to the sum of the pixels that are b = -a + 5
positioned on line. So, the elements with the highest The variables are (a, b) the points became in the (a, b)
values represent the straight lines. plane

b = -a + 5

b=0

IV. RESULTS
The System is implememted using Python and OpemCV on Raspberry Pi. The results of the system on Image as well
as video are shown in the figure below:

RESULTS ON IMAGE

image read RGB to Gray image and blur filter

102 | IJREAMV05I0654042 DOI : 10.35291/2454-9150.2019.0426 © 2019, IJREAM All Rights Reserved.


International Journal for Research in Engineering Application & Management (IJREAM)
ISSN : 2454-9150 Vol-05, Issue-06, Sep 2019

Output of edge detection Output of Region Of Interest

Output of Hough Tranform Final Output of Lane detection

Final Output on image 1 Final Output on image 2


RESULTS ON VIDEO

Output of Edge detection on video 1 Output of Edge detection on video 2

Output of Hough transform on video 1 Output of Hough transform on video 2

103 | IJREAMV05I0654042 DOI : 10.35291/2454-9150.2019.0426 © 2019, IJREAM All Rights Reserved.


International Journal for Research in Engineering Application & Management (IJREAM)
ISSN : 2454-9150 Vol-05, Issue-06, Sep 2019

CONCLUSION [10] Specifications of Raspberry Pi 3:


https://www.raspberrypi.org/magpi/raspberry-pi-3-
This paper demonstrates the implementation of lane specs-benchmarks/
detection system on embedded development board like [11] Camera (Image and Specification)
raspberry pi. Lane detection system has many difficulties. https://www.bhphotovideo.com/c/product/660392REG/
These difficulties arrive from shadows, occlusion by other Logitech_E3560_E3560_QuickCam.html
vehicles, changes in the road surfaces itself, and differing
types of lane markings. This paper implements a system for
detecting lanes for warning drivers about lane departure. The
Hough transform along with canny edge detection is used for
detecting lanes from image and videos. The Hough transform
is made more efficient by incorporating region of interest
operation before application to make it more accurate. The
algorithm is tested on Raspberry Pi for real time
performance.

V. REFERENCES
[1] Digital Image Processing (Third Edition), Rafael C.
Gonzales and Richard E. Woods, Published by
PEARSON Education.
[2] Prof A. B. Deshmukh, Pravin T. Mandlik, “Raspberry-Pi
Based Real Time Lane Departure Warning System using
Image Processing”, International Journal of Engineering
Research and Technology (IJERT), volume 5, Issue 06,
June 2016.
[3] Prof A. B. Deshmukh, Pravin T. Mandlik, “Image
Processing based Lane Departure Warning System
Using Hough Transform and Euclidean Distance”,
International Journal of Research and Scientific
Innovation (IJRSI), Volume 3, Issue 10, October 2016,
ISSN 2321–2705.
[4] B. Yu, A. Jain, "Lane boundary detection using a
multiresolution hough transform", Proceedings of
International Conference on Image Processing, pp. 748-
751.
[5] Winserng Chee, Phooi Yee Lau and Sungkwon Park,
“Real-time Lane Keeping Assistant System on
Raspberry Pi”, IEIE Transactions on Smart Processing
and Computing, vol. 6, no. 6, December 2017
[6] Juan Pablo Gonzalez, Omit Ozguner, "Lane Detection
Using Histogram-Based Segmentation and Decision
Trees", IEEE Intelligent Transportation Systems
Conference Proceedings, pp. 346-351.
[7] S. P. Narote, P. N. Bhujbal, A. S. Narote, D. M. Dhane,
"A review of recent advances in lane detection and
departure warning system", Pattern Recognition, vol. 73,
pp. 216-234, 2018.
[8] J. Canny, "A Computational Approach to Edge
Detection", IEEE Trans. Pattern Analysis and Machine
Intelligence, vol. 8, no. 6, pp. 679-686, 1986.
[9] C. Bila, F. Sivrikaya, M. A. Khan, S. Albayrak,
"Vehicles of the Future: A Survey of Research on Safety
Issues", IEEE Transactios on Intelligent Transportation
Systems, vol. 18, no. 5, pp. 1046-1065, 2017.

104 | IJREAMV05I0654042 DOI : 10.35291/2454-9150.2019.0426 © 2019, IJREAM All Rights Reserved.

You might also like