This pipeline consists of 6 steps:
Using HSV color space two mask are created for the yellow and white color range. The mask is aplied to the image to filter out unwanted colors.
A triangular region is defined comprised of bottom corners and the center of the image, where the road is located.
To improve the edge detection two transformations were applied:
- Convert images into gray scale to simplify detecting the edges on the image
- Gaussian smoothing for suppressing noise and spurious gradients
The Hough transform is applied to obtain the line's points of the edges calculated on the previuous step.
The slope, intercept and length of all the lines were calculated. The side of the road of each line is determined by the slope sign.
Right and left lane lines are calculated as the weigthed mean of the lines of each side. Lengthly lines has more importance in order to obtain the main lines.
Potential shortcomings would be what would happen when dealing with:
- Sharp corners
- Lane changes
- Own car
- Other cars
- Night
- Low visibility
- Rain
- Fog
Possible improvements would be to:
- Horizon line calculation
- Polynomial curve fitting