CarND-LaneLines-P1 - Lane Finding Project for Self-Driving Car ND

Overview

Finding Lane Lines on the Road

Udacity - Self-Driving Car NanoDegree

Combined Image

Overview

When we drive, we use our eyes to decide where to go. The lines on the road that show us where the lanes are act as our constant reference for where to steer the vehicle. Naturally, one of the first things we would like to do in developing a self-driving car is to automatically detect lane lines using an algorithm.

In this project you will detect lane lines in images using Python and OpenCV. OpenCV means "Open-Source Computer Vision", which is a package that has many useful tools for analyzing images.

To complete the project, two files will be submitted: a file containing project code and a file containing a brief write up explaining your solution. We have included template files to be used both for the code and the writeup.The code file is called P1.ipynb and the writeup template is writeup_template.md

To meet specifications in the project, take a look at the requirements in the project rubric

Creating a Great Writeup

For this project, a great writeup should provide a detailed response to the "Reflection" section of the project rubric. There are three parts to the reflection:

  1. Describe the pipeline

  2. Identify any shortcomings

  3. Suggest possible improvements

We encourage using images in your writeup to demonstrate how your pipeline works.

All that said, please be concise! We're not looking for you to write a book here: just a brief description.

You're not required to use markdown for your writeup. If you use another method please just submit a pdf of your writeup. Here is a link to a writeup template file.

The Project

If you have already installed the CarND Term1 Starter Kit you should be good to go! If not, you should install the starter kit to get started on this project.

Step 1: Set up the CarND Term1 Starter Kit if you haven't already.

Step 2: Open the code in a Jupyter Notebook

You will complete the project code in a Jupyter notebook. If you are unfamiliar with Jupyter Notebooks, check out Udacity's free course on Anaconda and Jupyter Notebooks to get started.

Jupyter is an Ipython notebook where you can run blocks of code and see results interactively. All the code for this project is contained in a Jupyter notebook. To start Jupyter in your browser, use terminal to navigate to your project directory and then run the following command at the terminal prompt (be sure you've activated your Python 3 carnd-term1 environment as described in the CarND Term1 Starter Kit installation instructions!):

> jupyter notebook

A browser window will appear showing the contents of the current directory. Click on the file called "P1.ipynb". Another browser window will appear displaying the notebook. Follow the instructions in the notebook to complete the project.

Step 3: Complete the project and submit both the Ipython notebook and the project writeup

How to write a README

A well written README file can enhance your project and portfolio. Develop your abilities to create professional README files by completing this free course.

Comments
  • Better guide for moviepy

    Better guide for moviepy

    Hi, I'm jiho in Nov cohort.

    Even if people finish install moviepy, there might be error when import the library. because of ffmpeg exe.

    image

    solution is simple: install it

    image

    So, I thinks it is better to add these to read.md

    Thanks

    opened by jihobak 11
  • Issue with conda install -c menpo opencv3=3.1.0

    Issue with conda install -c menpo opencv3=3.1.0

    With Windows 7 , after the condo install -c menpo opencv3=3.1.0 step, I get UnsatisfiableError: The following specifications were found to be in conflict:

    • opencv3 3.1.0* -> python 2.7*
    • python 3.6*

    conda info opencv3=3.1.0 returns

    NoPackagesFoundError: Package missing in current win-64 channels:

    • opencv3 3.1.0*

    Using anaconda search -t conda opencv3, the menpo/opencv3 version 3.2.0 should have a win-64 version available. but changing the top statement to use opencv3=3.2.0 but that doesnt seem to work either. Does anyone have some insight on how to solve this issue I'm having with the included instructions?

    opened by mwhayford 9
  • region_of_interest issue with fillPoly()

    region_of_interest issue with fillPoly()

    The region_of_interest() function says it takes vertices which it passes to cv2.fillPoly(), but it seems like what that function is supposed to take is an Array of shapes.

    I think that function should be updated like so:

    -cv2.fillPoly(mask, vertices, ignore_mask_color)
    +# We need to pass in an array of shapes (each shape is an array of vertices)
    +cv2.fillPoly(mask, [vertices], ignore_mask_color)
    

    Causes error: error: /home/travis/miniconda/conda-bld/conda_1486587071158/work/opencv-3.1.0/modules/imgproc/src/drawing.cpp:2276: error: (-215) p.checkVector(2, CV_32S) >= 0 in function fillPoly

    See related error http://stackoverflow.com/questions/17241830/opencv-polylines-function-in-python-throws-exception/18817152#18817152

    opened by frankcarey 6
  • Simplifying calling Docker on this project and also getting upstream fixes

    Simplifying calling Docker on this project and also getting upstream fixes

    The way that you have laid this out is great and it is easy to get the docker container running, but there are two improvements that would make things easier:

    1. run.sh. Having a simple script which will allow calling that very long docker string in this directory. And at least on MacOS making sure that Docker for Mac is started
    2. upstream.sh. Having a simple way to make sure that when you fork this repo, you are getting the upstream changes that Udacity is making.

    I created a fork with these two simple shell scripts, is this interesting for you guys. I can issue a PR if you like.

    opened by richtong 4
  • openCV with GPU

    openCV with GPU

    I was looking to use OpenCV with Cuda8. I have Cuda8, but have not been successful with getting openCV working with it. Is there any guidelines for that?

    opened by shivajid 4
  • The Matplotlib issue in Anaconda environment

    The Matplotlib issue in Anaconda environment

    The CarND Term1 Starter Kit Anaconda environment only has matplotlib 1.5.3. But matplotlib colors to_rgba requires matplotlib 2.0. Users should update manually.

    in progress 
    opened by wpiHWzhao 3
  • Undefined Var

    Undefined Var

    In P1.ipynb, there are two places where you write: "plt.imshow(gray, cmap='gray')," what is gray (the variable, not the string)? Isn't that just an undefined variable? Did you mean to write "plt.imshow(image, cmap='gray')" in the first instance and "plt.imshow(img, cmap='gray')" in the second?

    opened by manishkakwani 3
  • line fit

    line fit

    Traceback (most recent call last): File "C:\Users\Ali\Desktop\Lane Detection\Line_Fit\line_fit_video.py", line 114, in annotate_video('project_video.mp4', 'out.mp4') File "C:\Users\Ali\Desktop\Lane Detection\Line_Fit\line_fit_video.py", line 108, in annotate_video annotated_video = video.fl_image(annotate_image) File "C:\Python27\lib\site-packages\moviepy\video\VideoClip.py", line 533, in fl_image return self.fl(lambda gf, t: image_func(gf(t)), apply_to) File "C:\Python27\lib\site-packages\moviepy\Clip.py", line 136, in fl newclip = self.set_make_frame(lambda t: fun(self.get_frame, t)) File "", line 2, in set_make_frame File "C:\Python27\lib\site-packages\moviepy\decorators.py", line 14, in outplace f(newclip, a, **k) File "C:\Python27\lib\site-packages\moviepy\video\VideoClip.py", line 694, in set_make_frame self.size = self.get_frame(0).shape[:2][::-1] File "", line 2, in get_frame File "C:\Python27\lib\site-packages\moviepy\decorators.py", line 89, in wrapper return f(new_a, **new_kw) File "C:\Python27\lib\site-packages\moviepy\Clip.py", line 95, in get_frame return self.make_frame(t) File "C:\Python27\lib\site-packages\moviepy\Clip.py", line 136, in newclip = self.set_make_frame(lambda t: fun(self.get_frame, t)) File "C:\Python27\lib\site-packages\moviepy\video\VideoClip.py", line 533, in return self.fl(lambda gf, t: image_func(gf(t)), apply_to) File "C:\Users\Ali\Desktop\Lane Detection\Line_Fit\line_fit_video.py", line 66, in annotate_image left_curve, right_curve = calc_curve(left_lane_inds, right_lane_inds, nonzerox, nonzeroy) File "C:\Users\Ali\Desktop\Lane Detection\Line_Fit\line_fit.py", line 241, in calc_curve left_fit_cr = np.polyfit(leftyym_per_pix, leftxxm_per_pix, 2) File "C:\Python27\lib\site-packages\numpy\lib\polynomial.py", line 588, in polyfit c, resids, rank, s = lstsq(lhs, rhs, rcond) File "C:\Python27\lib\site-packages\numpy\linalg\linalg.py", line 1921, in lstsq raise LinAlgError('SVD did not converge in Linear Least Squares') LinAlgError: SVD did not converge in Linear Least Squares

    opened by AliAshrafRagab 2
  • Project Structure Is Inconsistent

    Project Structure Is Inconsistent

    There are several inconsistencies that make this project feel a bit messy:

    1. The examples folder only contains one of the five examples files
    2. There is a sub directory for test images, but not one for test videos. Test videos are all kept in the root directory for some reason?
    3. The project is requesting students write images back into the test image source directory, instead of a destination directory. This will give students the extra task of keeping track of which images are which if they run their pipeline on images more than once (which it seems like they should).

    I would be happy to clean this up in a PR (including update the ipython notebook) if you guys are comfortable with it.

    opened by dmlicht 2
  • Configure Renovate

    Configure Renovate

    Mend Renovate

    Welcome to Renovate! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

    🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.


    Detected Package Files

    • .github/workflows/manual.yml (github-actions)

    Configuration

    🔡 Renovate has detected a custom config for this PR. Feel free to ask for help if you have any doubts and would like it reviewed.

    Important: Now that this branch is edited, Renovate can't rebase it from the base branch any more. If you make changes to the base branch that could impact this onboarding PR, please merge them manually.

    What to Expect

    It looks like your repository dependencies are already up-to-date and no Pull Requests will be necessary right away.


    ❓ Got questions? Check out Renovate's Docs, particularly the Getting Started section. If you need any further assistance then you can also request help here.


    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 1
  • region_of_interest() fillpoly

    region_of_interest() fillpoly

    Hello,

    So while I was trying to work through this assignment I came across a weird issue, when I am trying to run the region_of_interest() function it is giving me an error message that is

    error Traceback (most recent call last) in 7 8 vertices = np.array([[0,0],[300,450],[530,230]],dtype=np.int32) ----> 9 img = region_of_interest(img,vertices) 10 img = gaussian_blur(img,3) 11

    in region_of_interest(img, vertices) 39 #filling pixels inside the polygon defined by "vertices" with the fill color 40 ---> 41 cv2.fillPoly(mask, vertices, ignore_mask_color) 42 43 #returning the image only where mask pixels are nonzero

    error: OpenCV(4.1.2) C:\projects\opencv-python\opencv\modules\imgproc\src\drawing.cpp:2403: error: (-215:Assertion failed) p.checkVector(2, CV_32S) >= 0 in function 'cv::fillPoly'

    Initially I thought the issue is because of the datatype and not using correct datatype but as you can see that even after using the numpy int32 the issue still remains.

    opened by Abhishek-EE 1
Owner
Udacity
Udacity’s mission is to train the world’s workforce in the careers of the future.
Udacity
Find-Lane-Line - Use openCV library and Python to detect the road-lane-line

Find-Lane-Line This project is to use openCV library and Python to detect the road-lane-line. Data Pipeline Step one : Color Selection Step two : Cann

Kenny Cheng 3 Aug 17, 2022
LaneDetectionAndLaneKeeping - Lane Detection And Lane Keeping

LaneDetectionAndLaneKeeping This project is part of my bachelor's thesis. The go

null 5 Jun 27, 2022
Lane assist for ETS2, built with the ultra-fast-lane-detection model.

Euro-Truck-Simulator-2-Lane-Assist Lane assist for ETS2, built with the ultra-fast-lane-detection model. This project was made possible by the amazing

null 36 Jan 5, 2023
Self Driving RC Car Code

Derp Learning Derp Learning is a Python package that collects data, trains models, and then controls an RC car for track racing. Hardware You will nee

Not Karol 39 Dec 7, 2022
Open source hardware and software platform to build a small scale self driving car.

Donkeycar is minimalist and modular self driving library for Python. It is developed for hobbyists and students with a focus on allowing fast experimentation and easy community contributions.

Autorope 2.4k Jan 4, 2023
Simulation of Self Driving Car

In this repository, the code to use Udacity's self driving car simulator as a testbed for training an autonomous car are provided.

Shyam Das Shrestha 1 Nov 21, 2021
Self-driving car env with PPO algorithm from stable baseline3

Self-driving car with RL stable baseline3 Most of the project develop from https://github.com/GerardMaggiolino/Gym-Medium-Post Please check it out! Th

Sornsiri.P 7 Dec 22, 2022
CRISCE: Automatically Generating Critical Driving Scenarios From Car Accident Sketches

CRISCE: Automatically Generating Critical Driving Scenarios From Car Accident Sketches This document describes how to install and use CRISCE (CRItical

Chair of Software Engineering II, Uni Passau 2 Feb 9, 2022
This script scrapes and stores the availability of timeslots for Car Driving Test at all RTA Serivce NSW centres in the state.

This script scrapes and stores the availability of timeslots for Car Driving Test at all RTA Serivce NSW centres in the state. Dependencies Account wi

Balamurugan Soundararaj 21 Dec 14, 2022
This project deploys a yolo fastest model in the form of tflite on raspberry 3b+. The model is from another repository of mine called -Trash-Classification-Car

Deploy-yolo-fastest-tflite-on-raspberry 觉得有用的话可以顺手点个star嗷 这个项目将垃圾分类小车中的tflite模型移植到了树莓派3b+上面。 该项目主要是为了记录在树莓派部署yolo fastest tflite的流程 (之后有时间会尝试用C++部署来提升

null 7 Aug 16, 2022
Self-Supervised Pillar Motion Learning for Autonomous Driving (CVPR 2021)

Self-Supervised Pillar Motion Learning for Autonomous Driving Chenxu Luo, Xiaodong Yang, Alan Yuille Self-Supervised Pillar Motion Learning for Autono

QCraft 101 Dec 5, 2022
Graph Self-Attention Network for Learning Spatial-Temporal Interaction Representation in Autonomous Driving

GSAN Introduction Code for paper GSAN: Graph Self-Attention Network for Learning Spatial-Temporal Interaction Representation in Autonomous Driving, wh

YE Luyao 6 Oct 27, 2022
Reinforcement learning for self-driving in a 3D simulation

SelfDrive_AI Reinforcement learning for self-driving in a 3D simulation (Created using UNITY-3D) 1. Requirements for the SelfDrive_AI Gym You need Pyt

Surajit Saikia 17 Dec 14, 2021
Action Recognition for Self-Driving Cars

Action Recognition for Self-Driving Cars This repo contains the codes for the 2021 Fall semester project "Action Recognition for Self-Driving Cars" at

VITA lab at EPFL 3 Apr 7, 2022
(CVPR 2022) A minimalistic mapless end-to-end stack for joint perception, prediction, planning and control for self driving.

LAV Learning from All Vehicles Dian Chen, Philipp Krähenbühl CVPR 2022 (also arXiV 2203.11934) This repo contains code for paper Learning from all veh

Dian Chen 300 Dec 15, 2022
Implementation of our paper 'RESA: Recurrent Feature-Shift Aggregator for Lane Detection' in AAAI2021.

RESA PyTorch implementation of the paper "RESA: Recurrent Feature-Shift Aggregator for Lane Detection". Our paper has been accepted by AAAI2021. Intro

null 137 Jan 2, 2023
PointCloud Annotation Tools, support to label object bound box, ground, lane and kerb

PointCloud Annotation Tools, support to label object bound box, ground, lane and kerb

halo 368 Dec 6, 2022
LaneAF: Robust Multi-Lane Detection with Affinity Fields

LaneAF: Robust Multi-Lane Detection with Affinity Fields This repository contains Pytorch code for training and testing LaneAF lane detection models i

null 155 Dec 17, 2022
CondLaneNet: a Top-to-down Lane Detection Framework Based on Conditional Convolution

CondLaneNet: a Top-to-down Lane Detection Framework Based on Conditional Convolution This is the official implementation code of the paper "CondLaneNe

Alibaba Cloud 311 Dec 30, 2022