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

lane3

The document discusses a lane detection system for autonomous cars using Python and OpenCV, aimed at improving driver safety by preventing lane departure accidents. The proposed methodology includes preprocessing, region of interest selection, and lane detection using techniques like Hough transform and Canny edge detection. The system has shown over 95% accuracy in detecting straight road lanes, with future enhancements suggested for various environmental conditions.

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)
12 views

lane3

The document discusses a lane detection system for autonomous cars using Python and OpenCV, aimed at improving driver safety by preventing lane departure accidents. The proposed methodology includes preprocessing, region of interest selection, and lane detection using techniques like Hough transform and Canny edge detection. The system has shown over 95% accuracy in detecting straight road lanes, with future enhancements suggested for various environmental conditions.

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/ 7

IOSR Journal of Engineering (IOSRJEN) www.iosrjen.

org
ISSN (e): 2250-3021, ISSN (p): 2278-8719
Vol. 11, Issue 6, June 2021, ||Series -I|| PP 54-60

Lane Line Detection for Autonomous Cars using Python and


OpenCV
Mohammed Faisal1, Ganta Anurag Reddy1, Balusupati Anil Kumar1,
Dr. D. Ajitha2
1
Students, Department of ECE, Sreenidhi Institute of Science and Technology, Hyderabad, India.
2
Associate Professor, Department of ECE, Sreenidhi Institute of Science and Technology, Hyderabad, India.
Received 10 June 2021; Accepted 24 June 2021

Abstract: - Driver’s safety is one of the main reasons why autonomous cars has been evolving these days.
There are many accidents which takes place due to the negligence of the drivers and driving on the wrong lane or
a sudden change in the lane. To overcome this problem autonomous car has come into the market. Here the
foremost concern is the safety of the passengers and so for that reason lanes detection could be used as a safe
driving option. The Lane detection device can be implemented using OpenCV and python programming. This
system needs a front camera which can be mounted on a car and using the view from the camera and applying
few processes, lanes can be detected easily. The lanes can be extracted using Hough transform through a pair of
hyperbolas. The proposed system can be utilized on both painted and unpainted roads. This system can be used
in any car for safe lane driving.
Keywords: - Autonomous cars, hough transform, hyperbolas, lane detection, OpenCV.

I. INTRODUCTION
In the present developing world, with the fast improvement of society, vehicles have come to be one of
the transportation gears for humans to journey. In the meantime, there are an increasing number of automobiles
of all kinds. As an increasing number of automobiles are using on the street, the variety of sufferers of vehicle
injuries is growing each year. Autonomous Driving Car is one of the maximum disruptive improvements in AI.
They are constantly using our society ahead and developing new possibilities withinside the mobility sector. A
self-sustaining vehicle can cross everywhere a conventional vehicle can cross and does the whole lot that a
skilled human driving force does. But it’s very vital to educate it nicely. One of the numerous steps worried at
some stage in the education of a self-sustaining using vehicle is lane detection, that is the initial step is to carry
out lane detection with the use of video clips. The lane detection system is very useful for the autonomous cars
as the car can travel only in the specified lane and cannot go on the wrong lane. This is very useful for avoiding
accidents at large scale. This system proves efficient in finding lanes and can be implemented in less amount.

1.1 Related Work


Fallah [1] mentioned a set of rules for detection of road lanes and the boundaries by using few
algorithms. The algorithm transformed the RGB input image to a gray scale images and then the region of
interests is selected based on the images. Then after that selection the area which is to be neglected is selected
using the algorithms and is deleted from the image. This step is done for all the images. After deleting the
unwanted area from the image, then few by using few techniques, lanes are detected for the input image.
Wang [2] has proposed a detection of lane marking set of rules through the use of geometry records and
changed Hough remodel. In that set of rules, the captured photograph become divided into avenue component
and non-avenue component through the use of digital digicam geometry records.

1.2 Organization
The rest of the paper is structured as follows. In section 2 proposed methodology of the system is
described. Implementation of the system is described in section 3. Results in section 4. Lastly, section 5
concludes the paper with future scope.

II. PROPOSED METHODOLOGY


The proposed algorithm is divided into three steps. First is preprocessing, second is ROI selection and
third is lane detection [3]. All three steps are important in detecting the lanes. The RGB format image is given as
the input to the system. The basic assumption is that the lanes are long and parallel to each other so that the
Hough transformation method using the edge selection can be used to detect the lanes [4].

International organization of Scientific Research 54 | Page


Lane Line Detection for Autonomous Cars using Python and Open CV

Fig. 1: Block diagram


The lane detection system follows the procedure as follows:

2.1 Pre-processing
Pre-processing is the first stage in lane detection. Here RGB format image is given as the input to the
system [5]. Now this image is converted to HSV image. After converting to HSV image, White extraction is
done on the image to see the edge of the lanes. If an image is blurry then binarization is done to those images
and later Edge detection is done on that image. Finally, Edge is detected in this process.

2.2 ROI selection


A region of interest (ROI) is an area in the image where the implementation of algorithms takes place
[6]. This is the area where we have to work on. This can be selected using some algorithms. The unwanted area
from the image is deleted and the area which is useful is left in the image. All the algorithms used for detecting
lanes can be tested on the ROI selected image.

2.3 Lane detection


The final step after ROI selection is lane detection. Here there are two ways to detect lane. The most
conventional one is by using Hough transformation and the other is lane tracking based extended Kalman filter
[8].
III. IMPLEMENTATION
The implementation degree of any task is a real show of the defining moments that make a task an
achievement or a failure. The implementation degree is described because the gadget or gadget changes being
hooked up and made operational in a manufacturing environment. The section is initiated after the gadget has
been examined and normal with the aid of using the person. This section keeps till the gadget is working in
manufacturing according with the described person requirements.

3.1 Canny Edge Selection


Canny Edge Detection is a famous aspect detection set of rules [9]. It changed into advanced with the
aid of using John F. Canny in 1986. It is a multi-degree set of rules and we are able to undergo every degree.

3.2 Noise Reduction


The very first step is to reduce the noise from the image that means removing the unwanted area from
the image so that we can work in the area which useful to detect lanes. This is very important aspect of lane
detection as it reduces our image into half and we can work on it easily.

3.3 Finding Intensity Gradients of the Images


The noise reduced images is now filtered with kernels in each vertical and horizontal course to take
initial spinoff in vertical course and horizontal course. Next the image is round to 1 in all 4 angles representing
horizontal, verticals, diagonal directions. From those photos, we are able to discover aspect angle and gradient
for every pixels as follow:
Edge_Gradient (G) = (1)
Angle ( ) = tan-1 ( ) (2)

International organization of Scientific Research 55 | Page


Lane Line Detection for Autonomous Cars using Python and Open CV

3.4 Hysteresis Thresholding


To build an intermediate image, hysteresis thresholding compares two images. Two binary images is
taken for consideration that have been thresholded at various levels. A function is used for hysteresis
thresholding [10]. The higher threshold has a small value of white pixels. The main goal of hysteresis
thresholding to notice which edges in the image are really edges and which are not edges.

Fig 2: Hysteresis thresholding

3.5 Hough Line Transform


Hough Transform is a method which is usually used in image processing so that any kind of image is
detected by using it [8]. Even if the image is broken or distorted, the shape of the image can be detected using
this method. Hough line transform method is used to detect lines using Hough transform [9]. Y= mx + c is the
equation of line or in a parametric form we can say as r = xcosθ + ysinθ. Here θ is the angle formed by the
vertical line and r is the distance from origin to the line. Any line can be represented in term of r and θ. Below
image representation is used in opencv

Fig 3: Hough line transformation

IV. RESULTS
Many images of the road with different lanes is used for testing the system and it had resulted above
95% in detecting the road lanes correctly. The system was less efficient in detecting the lanes which are curve
but when the road lanes are straight the system was effective. These are the screenshots taken at the time of
testing:

4.1 Input Images

Fig 4: Input image

4.2 Color Selection


Color selection is done on RGB input images which first converted the image to grey scale image and
then the region of interest masking will be done oin these images. By changing the color of the image, the
system can easily detect the lanes. In the above image when the image is color is changed, we can see the lanes
easily and the system finds it easy to detect the lanes too.

International organization of Scientific Research 56 | Page


Lane Line Detection for Autonomous Cars using Python and Open CV

Fig 5: Color selection

4.3 Region Masking

Fig 6: ROI Masking

International organization of Scientific Research 57 | Page


Lane Line Detection for Autonomous Cars using Python and Open CV

Fig 7: Character selection

Region masking is done to images after the selection of color. And this process removes the unwated
area from the image and the area which is useful is kept for further steps.

4.4 Canny Edge Detection


After region of interest is masked on the input image, Now the next task is to determine the edges of
the lanes so that we can detect the lane easily. Canny edges detection algorithm is used to notice the edges. This
process proves efficient in detecting the road lanes. The images with high threshold pixels are selected and then
edge detection techniques are applied on it. Low threshold pixel images are rejected. The output will ne the
pixels with white in color and the remaing pixels are in black color. White color pixels is the detected edges by
the canny edges detection.

Fig 8: Canny Edge detection

4.5 Hough Transform


After the edges detection technique, next step is to apply the hough transform and detect the road lanes.
Here the image is marked as x and y axis. Paul Hough defined this technique and we call hough transform in his
honour. This technique is used in every line detection step. Region of interest is marked in blue color and the
actual lanes are marked in red color. This method proved efiicient in detecting the lanes in our project. Even
slightly curved lanes were detected using this technique.

International organization of Scientific Research 58 | Page


Lane Line Detection for Autonomous Cars using Python and Open CV

Fig 9: Hough transformation

4.6 Lane line detected for similar type of Images

Fig 10: Output images

International organization of Scientific Research 59 | Page


Lane Line Detection for Autonomous Cars using Python and Open CV

V. CONCLUSION AND FUTURE SCOPE


The Lane Detection is needed for today’s everyday life. Accidents on street are the primary hassle for
authorities of any country. The foremost cause of injuries is surprising alternate in lane on speedy using roads.
Most of this hassle happens whilst in terrible environmental situation whilst it unsuccessful to discover or
withinside the road curves in which detection is just too tedious. Actual time imaginative and prescient-
primarily based totally lane detection technique become developed. This system is efficient in detecting the road
lanes.
The future scope of the lane detection consists of complicated surroundings thinking of the
extraordinary environments inclusive of the all-weather conditions: sunny, rainy, fog, cloudy, mist vivid day
light, darker, shadow or whilst there happens barriers and Speed Breakers, humps with inside the road. We can
become aware of actual time lane detection. Further we are able to expand this version to the roads which do
now no longer comprise lanes.

ACKNOWLEDGEMENTS
Firstly, we are grateful to Sreenidhi Institute of Science and Technology for giving us the opportunity
to work on this project. We are fortunate to have worked under the supervision of our guide Dr. D. Ajitha. Her
guidance and ideas have made this project work. We are thankful to Dr. Syed Jahangir Badashah for being the in
charge for this project and conduction reviews. We are also thankful to the HOD of Electronics and
Communication Engineering [ECE], Dr. S.P.V. Subba Rao for giving us access to all the resources that went
into building this project.

REFERENCES
[1] Fallah, A., Soliemani, A., Khosravi, H. (2021). Real-time Lane Detection Based on Image Edge Feature
and Hough Transform. Journal of Electrical and Computer Engineering Innovations (JECEI), 9(2), 193-
202. doi: 10.22061/jecei.2021.7659.418
[2] Wang, W., Lin, H. & Wang, J. CNN based lane detection with instance segmentation in edge-cloud
computing. J Cloud Comp 9, 27 (2020).
[3] M. FENICHE and T. MAZRI, "Lane Detection and Tracking For Intelligent Vehicles: A Survey," 2019
International Conference of Computer Science and Renewable Energies (ICCSRE), 2019, pp. 1-4, doi:
10.1109/ICCSRE.2019.8807727.
[4] A. Kamble and S. Potadar, "Lane Departure Warning System for Advanced Drivers Assistance," 2018
Second International Conference on Intelligent Computing and Control Systems (ICICCS), 2018, pp.
1775-1778, doi: 10.1109/ICCONS.2018.8663242.
[5] M. V. G. Aziz, A. S. Prihatmanto and H. Hindersah, "Implementation of lane detection algorithm for self-
driving car on toll road cipularang using Python language," 2017 4th International Conference on Electric
Vehicular Technology (ICEVT), 2017, pp. 144-148, doi: 10.1109/ICEVT.2017.8323550.
[6] Ze Wang, Weiqiang Ren, Qiang Qiu, “LaneNet: Real-Time Lane Detection Networks for Autonomous
Driving” 2018 Cornell University.
[7] VanQuang Nguyen, Heungsuk Kim, SeoChang Jun, Kwangsuck Boo, A Study on Real-Time Detection
Method of Lane and Vehicle for Lane Change Assistant System Using Vision System on Highway,
Engineering Science and Technology, an International Journal, Volume 21, Issue 5, 2018.
[8] Aminuddin, N., Mat Ibrahim, M., Mohd Ali, N., Ahmad Radzi, S., Mohd Saad, W., & Darsono, A.
(2017). A NEW APPROACH TO HIGHWAY LANE DETECTION BY USING HOUGH TRANSFORM
TECHNIQUE. Journal Of Information And Communication Technology, 16(2), 244-260.
[9] J. Baili et al., "Lane Departure detection using image processing techniques," 2017 2nd International
Conference on Anti-Cyber Crimes (ICACC), 2017, pp. 238-241, doi: 10.1109/Anti-
Cybercrime.2017.7905298.
[10] Umar Ozgunalp, Sertan Kaymak, Lane detection by estimating and using restricted search space in Hough
domain, Procedia Computer Science, Volume 120, 2017.

Mohammed Faisal, et. al. “Lane Line Detection for Autonomous Cars using Python and
OpenCV.” IOSR Journal of Engineering (IOSRJEN), 11(06), 2021, pp. 54-60.

International organization of Scientific Research 60 | Page

You might also like