https://github.com/jianguoz/carnd1-lane-lines-detection-p1
Lane Finding Project for Self-Driving Car P1. Wrote by jupyter notebook
https://github.com/jianguoz/carnd1-lane-lines-detection-p1
Last synced: about 2 months ago
JSON representation
Lane Finding Project for Self-Driving Car P1. Wrote by jupyter notebook
- Host: GitHub
- URL: https://github.com/jianguoz/carnd1-lane-lines-detection-p1
- Owner: jianguoz
- Created: 2017-02-23T21:53:07.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-04T20:08:14.000Z (almost 8 years ago)
- Last Synced: 2025-01-16T02:31:53.005Z (3 months ago)
- Language: HTML
- Homepage:
- Size: 53.8 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# **Finding Lane Lines on the Road**
**Jianguo Zhang, February 23, 2017.**
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 Lane Finding Project for Self-Driving Car P1. I find 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.
The Project
---
# There are two ways to run this program, one way is installing the starter kit, following are the install instructions.## Configure and Manage Your Environment with Anaconda
Per the Anaconda [docs](http://conda.pydata.org/docs):
> For this project, we mainly using Anaconda, Python 3 along with the numpy, matplotlib, and OpenCV libraries, as well as Jupyter Notebook installed. Conda is an open source package management system and environment management system
for installing multiple versions of software packages and their dependencies and
switching easily between them. It works on Linux, OS X and Windows, and was created
for Python programs but can package and distribute any software.## Overview
Using Anaconda consists of the following:1. Install [`miniconda`](http://conda.pydata.org/miniconda.html) on your computer
2. Create a new `conda` [environment](http://conda.pydata.org/docs/using/envs.html) using this project
3. Each time you wish to work, activate your `conda` environment---
## Installation
**Download** the version of `miniconda` that matches your system. Make sure you download the version for Python 3.5.
**Getting** setup Anaconda with Python
For this project, you will need Python 3 along with the numpy, matplotlib, and OpenCV libraries, as well as Jupyter Notebook installed.
We recommend downloading and installing the Anaconda Python 3 distribution from Continuum Analytics because it comes prepackaged with many of the Python dependencies you will need for this and future projects, makes it easy to install OpenCV, and includes Jupyter Notebook. Beyond that, it is one of the most common Python distributions used in data analytics and machine learning, so a great choice if you're getting started in the field.
Choose the appropriate Python 3 Anaconda install package for your operating system here. Download and install the package.
**Setup** your the `carnd-term1` environment.
```sh
git clone https://github.com/udacity/CarND-Term1-Starter-Kit.git
cd CarND-Term1-Starter-Kit
```If you are on Windows, **rename**
`meta_windows_patch.yml` to
`meta.yml`**Create** carnd-term1. Running this command will create a new `conda` environment that is provisioned with all libraries you need to be successful in this program.
```
conda env create -f environment.yml
```**Verify** that the carnd-term1 environment was created in your environments:
```sh
conda info --envs
```**Cleanup** downloaded libraries (remove tarballs, zip files, etc):
```sh
conda clean -tp
```### Uninstalling
To uninstall the environment:
```sh
conda env remove -n carnd-term1
```---
## Using Anaconda
Now that you have created an environment, in order to use it, you will need to activate the environment. This must be done **each** time you begin a new working session i.e. open a new terminal window.
**Activate** the `carnd-term1` environment:
### OS X and Linux
```sh
$ source activate carnd-term1
```
### Windows
Depending on shell either:
```sh
$ source activate carnd-term1
```
or```sh
$ activate carnd-term1
```
**Open** the code in a Jupyter NotebookIf you are unfamiliar with Jupyter Notebooks, check out Cyrille Rossant's Basics of Jupyter Notebook and Python 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, run the following command at the terminal prompt (be sure you're in your Python 3 environment!):
`> 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.
**You** can open and run my `Project1.ipynb` or just check `Project1_online_result.html` in jupyter notebook
# Another way to set the environment and run jupyter notebook
**Step 1:** Getting setup with Python
Choose the appropriate Python 3 Anaconda install package for your operating system here. Download and install the package.
If you already have Anaconda for Python 2 installed, you can create a separate environment for Python 3 and all the appropriate dependencies with the following command:
`> conda create --name=yourNewEnvironment python=3 anaconda`
`> source activate yourNewEnvironment`
**Step 2:** Installing OpenCV
Once you have Anaconda installed, first double check you are in your Python 3 environment:
`>python`
`Python 3.5.2 |Anaconda 4.1.1 (x86_64)| (default, Jul 2 2016, 17:52:12)`
`[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin`
`Type "help", "copyright", "credits" or "license" for more information.`
`>>>`
(Ctrl-d to exit Python)run the following commands at the terminal prompt to get 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)
**Step 3:** Installing moviepy
We recommend the "moviepy" package for processing video in this project (though you're welcome to use other packages if you prefer).
To install moviepy run:
`>pip install moviepy`
and check that the install worked:
`>python`
`>>>import moviepy`
`>>>` (i.e. did not get an ImportError)(Ctrl-d to exit Python)
**Step 4:** Opening the code in a Jupyter Notebook
If you are unfamiliar with Jupyter Notebooks, check out Cyrille Rossant's Basics of Jupyter Notebook and Python 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, run the following command at the terminal prompt (be sure you're in your Python 3 environment!):
`> 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 5:** You can open and run my `Project1.ipynb` or just check `Project1_online_result.html`.