Lane detection for a car driving on the highway using OpenCV in python. Two videos are used and the detected lane is drawn over each frame. The output videos correspond to the test_videos.
For each frame, the first step is to grayscale the image
then a gaussian filter is applied
Canny edge detection is used on the smoothed image
An area of interest is used to filter out irrelevant parts of the image
Hough lines are found and separated into positive and negative slopes
Slope averages and x intercept averages are found for positive and negative lines, and the average lane line for positive and negative are found
The lane is filled in and the result is written to the output video
- numpy
- matplotlib
- OpenCV 3.x
Running LaneDetect_OneFrame only uses one frame and displays images at each step of the process. Running LaneDetect will go through the frames in test_video and write an output.avi. The test video used is currently specified on lines 19 and 20.
Use Homography to get birds eye view of image, fit a curve to the lane in this view and transform back to draw lane lines more accurately.