1. Describe your pipeline. As part of the description, explain how you modified the draw_lines() function.
The process for my pipeline is in two stages:
- Detect lanes without lines drawn in
- Draw in/extrapolate the lane lines
With the first stage the steps are:
- Firstly process using median blur to get rid of anything noisy
- Convert anything that "looks" like yellow to white, to detect yellow lines better
- Convert to grayscale
- Apply gaussian blur
- Apply canny edge detection
- Subset by region, estimated by a trapezoid
- Apply hough transform
With drawing in the lines, I used the output from the previous stage
- Taking only the hough transform, repeat with canny, being more aggressive with threshold
- Dialate the solution to get "solid" lines
- Repeat with canny again
- Use hough transform to get the lines
- Use a modified
draw_lines
function draw in and extrapolate the lines.
The new draw_lines
function:
- Uses clustering to determine which sets of points belongs with which "line"
- Uses
cv2.fitLine
to fit a line - Draws it based on the fitted line.
The lane line markings are not as smooth as the example, and have a tendency of jumping all over the place.
Since we use clustering iteratively to determine the line segment groupings it sometimes gets it wrong. It might be better to either:
- Keep history, so that it gets better over time
- Use a rule based approach so that it is consistent
Generally understanding roughly the location of lines in the previous frame should help inform where new lines are now at!