dmlicht / detect_lanes

Lane Finding Project for Self-Driving Car ND

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Detect Lanes

Udacity - Self-Driving Car NanoDegree Easily identify lane lines in driving data.

Compare

Usage

Command Line:

python detect_lanes.py <path_to_your_source_image> <path_to_output_destination>

In Code

import detect_lanes


# annotate image
image = mpimg.imread(source)
image_copy = np.copy(image)
with_lane_highlights = detect_lanes.annotate_lanes(image_copy)
write_image(dest, with_lane_highlights)


# Annotate a Video
from moviepy.editor import VideoFileClip
white_output = 'test_videos_output/white.mp4'
clip1 = VideoFileClip("test_videos/solidWhiteRight.mp4")
white_clip = clip1.fl_image(detect_lanes.annotate_lanes) #NOTE: this function expects color images!!
white_clip.write_videofile(white_output, audio=False)

Setup

Installing OpenCV

>>> pip install pillow
>>> conda install -c menpo opencv3=3.1.0

then to test if OpenCV is installed correctly:

>>> python
>>> import cv2
>>> (i.e. did not get an ImportError)

(Ctrl-d to exit Python)

Installing moviepy

>>> pip install moviepy`

and check that the install worked:

>>> python
>>> import moviepy
>>> (i.e. did not get an ImportError)

About

Lane Finding Project for Self-Driving Car ND


Languages

Language:Jupyter Notebook 92.1%Language:Python 7.9%