Self driving car project 1 finding lanes lines
- These file contain IPython notebook which contains my work for project 1. Finding lane lines
- Also contains 2 videos. The output generated from the notebook
Finding Lane Lines on the Road
The goals / steps of this project are the following:
- Make a pipeline that finds lane lines on the road
- Reflect of my work
The project aim was to use computer vision to identify lane lines on the road. For this task I have only used the helper function provided with the project. The helper functions include grayscaling, gaussian bluring, canny edge detection and hough transform. In the end I had to modify the draw_lines function to average and extrapolate the detected lines
Test images and videos are used to make the pipe line. Various parameters for canny edge detection, gaussian bluring and hough transform have been tried and optimized to these test examples
The pipe line is as follows;
-
I used read a test image and use the grayscape helper function to create grayscape version of the image.
-
I apply gaussian blurring with the kernal_size of 15 (Only odd kernal sizes are allowed)
-
I used the canny helper function to for detecting canny edges; I used a low thershold of 50 and high thershold of 150.
-
Then made masked the unwanted regions of the image using the region of interest helper function. The parameters for this were extracted from the quizes of lecture videos.
-
Then I used perfrom hough transformation using the helper function. I had to play with several to the parameters to arrive at resonable set of parameters
-
The hough helper function calls the draw lines function. I modified this function to average/extrapolate the lines generated by hough transformation. I was a fun exercise!! Here is what I did
-
I define the functions to get the slope and intercept given two points
-
I calculate all the slopes and intercepts of the points generated by hough transformation and only consider the abs(slopes) > 0.4. I arrived at this cutoff by looking at all the slopes of all the test images
-
It is obvious that all the positive slopes corresponds to left line and vice versa.
-
I then take the average of the slopes and intercepts corresponding to left and right line
-
I consider the y1 (lower part of the image) for both the lines to be equal 540 which is the maximum of y components of the image. The y component corresponding to the end of the line is the min of the y components extracted from hough space. Using y's, slopes and intercepts I calculate the corresponding x's and then use the cv2.line function to project lines onto the image.
-
This pipeline performed very nice on the static images. The same pipeline is applied on the video clips
The shortcomings I can think of are,
This pipeline will not work:
-
when there is car right in front of the car.
-
when either left of right line is missing
-
when the road is curvy, we might have to use a quadratic fit to the points
- The current pipeline works really good for the static images but not that smooth on video.
- Use a linear fitting algos for averaging and extrapolating
- use quadratic fit instead of linear for smoothness