- Identify the white and yellow lines using the HLS color space
- Convert the image to grayscale, since next steps will work on only one channel image
- Blur the image so that when we identify the edges those are smooth
- Find the edges in the image, we will use canny method to find the edges
- Clip the image to find only the region of interest. This is the region which has the lane lines
- Find the lines using the hough lines method
- Find average line and extrapolate if necessary
- Plot the lane lines on the image
There are many frames in a video which does not contain the continuous lane lines, also in case of dotted white lines its necessary to extrapolate the lane lines. Also due to rough road and sudden changes in road color its necessary to find and plot the lines based on the average of lines of the previous frames.
- Get the hough lines - we will get the start and end points of the line
- Identify the slope to get to know if the line falls in left side or right side
- Use polyFit method of numpy library to identify the coefficients of a line (y = mx + b)
- Using these coefficients we can extend the line to the desired region - numpy's poly1d function can be used to find the line
- Also we can average out the coefficients of previous frames to smooth out the line - this will be very helpful when the frames will run as video
- Since we know the top Y and bottom Y coordinates, using the coefficients of the line we can find the corresponding top X and bottom X points and using these coordinates we can draw the line
- Since I knew the line coordinates, I draw a light green area which denotes the current lane - this looks cool as compared to only the lane lines
- Since the pipeline processing is based on the camera output, in case of a bumpy road/path it would be very hard to find the lane lines efficiently
- This might not work in night
- If the road does not have lanes drawn on road, the pipeline will fail