A project to find lane lines within a video of a car driving.
In order to process an entire video we build a pipeline to pass each frame through.
- Convert the image to grayscale.
- Perform a Gaussian blur
- Perform a Canny edge detection
- Mask away the image background.
- Use a Hough Lines Transform to detect lanes markers.
- Merge lane markers into a single line for each lane, and draw the lanes.
- Overlay the resulting image on the original frame.
Here is an example result running the pipeline over each frame of a video.
I really hope no one uses this in an actual self-driving car. It's really bad ;).
It's very quick to find almost anything a lane line even the shadow of a tree. It also makes no attempt at mapping the curves in the lane lines.
I can only imaine the anarchy that would insue if an actual self-driving car was on the road with this code.
This same pipeline with a few tweaks could provide far better and maybe even acceptable performance.
The largest room for improvement is probably better identifying which hough lines are actually apart of lane markers. You could do this by attempting to remove the noise by tweaking the parameters for Canny Edge Detection and the Hough Lines Transform, or by dropping lines with horizontal slope.
Another improvement could be to fit a 2nd degree line to the hough lines allowing for lane curves to be drawn.
But I expect that this is just not the best route to take for this task. A solution that I'd imagine more effective would be to gether a large dataset, and use machine learning to identify lane lines.