Finding Lane Lines on the Road
1. Describe your pipeline. As part of the description, explain how you modified the draw_lines() function.
My pipeline consisted of 5 steps.
- Convert the images to grayscale and apply Gaussian Blur with kerner size 5.
- Detect edges via Canny with low threshold 40 and high threshold 150.
- Only keep edges within the region of interest.
- Find lines using Hough transform from canny edges.
- Remove invalid lines using slope (More details explained below).
- Average the position of each of the lines and extrapolate to the top and bottom of the lane.
In order to draw a single line on the left and right lanes, I modified the draw_lines() function by adding the following stuff
- Only keep lines whose absolute slopes are bigger than 0.3 and lower then 0.3
- If the line is left lane and its slope is positive, remove this line.
- If the line is right lane and its slope is negative, remote this line.
- For all valid lines, calcuate the averaged slope and y intercept.
- Calculate the bottom and top points giving averaged slope and y intercept.
a. If there are noises near the lanes, the lines cannot be detected using Canny algorithm. The same issue will happen in bad weather or during night.
b. All the hyper-parameters (e.g. thresholds) need to update when more complicated driving scenarios are added.
c. When the car is switching lane, the current pipeline will fail.
...
a. Using more advanced filters to get rid of noises, or we can leverage deep learning models to detect edges.
b. Hard code different hyper-parameters for different scenarios. For example, one pipeline for sunny day and another pipeline for rainy day.