8000 GitHub - zhuangh/CarND-LaneLines-P1: Lane Finding Project for Self-Driving Car ND
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

zhuangh/CarND-LaneLines-P1

 
 

Repository files navigation

Finding Lane Lines on the Road

Udacity - Self-Driving Car NanoDegree

Combined Image

Project 1 Report of Udacity Self-Driving Engineer Nanodegree Term I

Hao Zhuang, hao.zhuang@cs.ucsd.edu

Rubrics


CRITERIA

MEETS SPECIFICATIONS

Does the pipeline for line identification take road images from a video as input and return an annotated video stream as output?

The output video is an annotated version of the input video.

Has a pipeline been implemented that uses the helper functions and / or other code to roughly identify the left and right lane lines with either line segments or solid lines? (example solution included in the repository output: raw-lines-example.mp4)

In a rough sense, the left and right lane lines are accurately annotated throughout almost all of the video. Annotations can be segmented or solid lines

Have detected line segments been filtered / averaged / extrapolated to map out the full extent of the left and right lane boundaries? (example solution included in the repository: P1_example.mp4)

Has a thoughtful reflection on the project been provided in the notebook?

Reflection

Describes the current pipeline, identifies its potential shortcomings and suggests possible improvements. There is no minimum length. Writing in English is preferred but you may use any language.

Usage


To use the pipeline via docker

docker run -it --rm -p 8888:8888 -v `pwd`:/src udacity/carnd-term1-starter-kit P1.ipynb

Finding Lane Lines on the Road

The goals / steps of this project are the following:

  • Make a pipeline that finds lane lines on the road
  • Reflect on your work in a written report

Reflection

1. Describe your pipeline. As part of the description, explain how you modified the draw_lines() function.

My pipeline consisted of steps as follows.

1. I converted the images to hls and get the color regions of white and yellow to the image mask.

The reason is that RGB grayscaled image is not robust enough to get the lanes in different light conditions compared to HSL. In the color selection, I set the value ranges for white and yellow.

2. To get the edges, OpenCV Canny algorithm is used.

3. Use Hough transformation with the edges to get the lines.

Step 2 and 3 are directly applied from Udacity course so far before the Project 1 assignment.

Original image of "solidYellowCurve" alt text

Edge detection via RGB color space alt text

Edge detection via HSL alt text

The HSL image can detect left lanes well. Another image from the challenge.mp4,

Original image alt text

Edge detection via RGB color space alt text

Edge detection via HSL alt text

4. In order to draw a single line on the left and right lanes, I calculate the slope of each line segments. Based on the slope, we separate them into the category of left or right lane.

For more robust detection, I filter out the too small and too large slopes, weight the lines based on the length, and remove the outliers (outstanding slopes).

For the weighting lines based on the length, the intuition is the longer the line, the better chance it is the part of lane close to the camera, which is more useful to serve as a baseline of the lane model.

For outstanding slopes, we consider them outside one standard deviation.

"SolidWhiteCurve" alt text

"solidWhiteRight" alt text

"SolidYellowCurve2" alt text

"SolidYellowCurve" alt text

"solidYellowLeft" alt text

"whiteCarLaneSwitch" alt text

5. Video is a sequence of images. The pipeline memorizes the images in each time step and caches the lines with a fixed size of deque data structure. I use it to weight the lanes to provide a more stable lanes. The assumption is the changes of images are continuous.

The weight scheme is based on a weighted scheme. For each time step (the index in the deque). The most recent one get larger weight. We use softmax function for this flow. The videos can be accessed via following youtube links

solidWhiteRight

solidYellowLeft

challenge

2. Identify potential shortcomings with your current pipeline

One potential shortcoming would be what would happen when the road has wide turns. The slopes of the lanes may change ruptly compared to the cached lanes. The weighted or averaging lanes may be unstable.

Another shortcoming could be the steepness of the road. The region of interest assumption in this work may not hold. So it will introduce more unpredicted variables which are not considered in this work.

3. Suggest possible improvements to your pipeline

A possible improvement would be to use curvature detection to get more smooth and continuous the line.

For steep roads, we should first need to detect the region of interests.

About

Lane Finding Project for Self-Driving Car ND

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages
No packages published

Languages

  • Jupyter Notebook 100.0%
0