Skip to content

PraveenKumar-Rajendran/CarND-Advanced-Lane-Lines

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Udacity Advanced Lane Line Finding Project

Introduction

In this project, we aim to develop a more advanced lane line finding system using computer vision techniques. Building upon the basic lane line detection techniques explored in the previous project, we will employ gradient, thresholding, color transforms, and perspective transforms to achieve more robust lane finding.


Advanced Lane Finding Project

The project goals and steps are as follows:

  1. Compute the camera calibration matrix and distortion coefficients using a set of chessboard images.
  2. Apply distortion correction to raw images.
  3. Utilize color transforms, gradients, and other techniques to create a thresholded binary image.
  4. Apply a perspective transform to rectify the binary image and obtain a "birds-eye view."
  5. Detect lane pixels and fit a polynomial to find the lane boundaries.
  6. Determine the curvature of the lane and the vehicle's position with respect to the center.
  7. Warp the detected lane boundaries back onto the original image.
  8. Output a visual display of the lane boundaries, along with numerical estimations of the lane curvature and vehicle position.

Rubric Points Coverage:


Project Overview

In this project, we apply advanced computer vision techniques to accurately detect and track lane lines on the road. The overall pipeline includes camera calibration, distortion correction, color and gradient thresholding, perspective transformation, lane line detection, curvature calculation, and visualization.

Camera Calibration

1. Computation of Camera Matrix and Distortion Coefficients

The camera calibration is performed using a set of chessboard images. In the calibration process, we compute the camera matrix and distortion coefficients using the cv2.calibrateCamera() function. These parameters are then used to correct the distortion in subsequent images. Here is an example of an undistorted chessboard image:

alt text

Pipeline (Single Images)

1. Distortion Correction

To correct for camera distortion, we apply the distortion correction parameters obtained from the calibration step to the raw images. This ensures that straight lines in the real world remain straight after the distortion correction. Here is an example of a distortion-corrected image:

alt text

2. Thresholded Binary Image

We use a combination of color transforms, gradients, and other thresholding techniques to create a binary image that highlights the lane lines. This binary image serves as the input for subsequent lane line detection steps. Here is an example of a thresholded binary image:

alt text

3. Perspective Transform

A perspective transform is applied to the binary image to obtain a "birds-eye view" perspective. This transformation rectifies the image and provides a top-down view of the lane lines, which simplifies the lane line detection process. Here is an example of a transformed image:

alt text

4. Lane Line Detection and Polynomial Fitting

Lane pixels are detected using a combination of histogram analysis and sliding window techniques. The detected pixels are then used to fit a second-order polynomial to the lane lines. This polynomial represents the lane

boundaries. Here is an example of the polynomial fit:

alt text

5. Curvature Calculation and Vehicle Position

The curvature of the lane is calculated based on the fitted polynomial. Additionally, the vehicle's position with respect to the lane center is determined. These measurements provide important information about the lane geometry and the vehicle's position on the road.

6. Visualization

The detected lane boundaries, along with the calculated curvature and vehicle position, are warped back onto the original image using the inverse perspective transform. This results in a visual display of the lane boundaries and numerical estimations. Here is an example of the output:

alt text


Pipeline (Video)

The lane finding pipeline is extended to process video streams. The same steps described above are applied to each frame of the video, resulting in a continuous detection and tracking of the lane lines. Here is a GIF representation of the final video output:

alt text


Discussion

Room for Improvement

Although the advanced lane finding system performs well under various conditions, there are still opportunities for further improvement. Some areas to consider for future enhancements include:

  1. Adapting the pipeline to handle challenging lighting and weather conditions to achieve even more robust performance.
  2. Analyzing the surrounding environment and incorporating contextual information to optimize the lane finding solution for different road scenarios.
  3. Exploring additional techniques and algorithms for more accurate and reliable lane detection, especially in complex driving situations.

References:

  1. Advanced Lane Finding
  2. Teaching Cars To See — Advanced Lane Detection Using Computer Vision

About

Self-Driving Car Engineer Nanodegree Program: Project2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published