Skip to content

This is a traditional method to detect road lanes and get steering inputs.

License

Notifications You must be signed in to change notification settings

sudharsan-007/opencv-lane-detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Curved Lane Detection for Self Driving Cars | OpenCV Python

By Sudharsan Ananth

Table of Contents
  1. Introduction
  2. Dependencies
  3. Prerequisites
  4. Run the code
  5. License

Introduction

This Repository consists of code to estimate Lane curvature from front view images captured from a car. The code uses openCV library to process the image and overlay the output. This can be implemented in real time using a live camera feed by changing cameraFeed=True

Working video

Output

Dependencies

This project is built with the below given major frameworks and libraries. The code is primarily based on python. And the environment is created using Anaconda.

Prerequisites

  1. Python 3.7 (skip if downloading conda)
  2. Conda (Either miniconda or Ananconda)

Run the code

Simply clone the repo cd into the right directory and run code using the below commands. Step-by-Step instructions given below. Simply change the directory and run agent.py from the directory RL_car_game. You will be able to see the agent training and getting better in minutes.

  1. Clone the repository using

    git clone https://github.com/sudharsan-007/opencv-lane-detection.git
  2. cd into the directory opencv-lane-detection

    cd opencv-lane-detection
  3. Recommended: create a conda environment

    # We require python>=3.7
    conda create -n cv2_lane_detection python=3.7 numpy 
    conda activate cv2_lane_detection
  4. Install pickle (Skip if import pickle works)

    pip install pickle4
  5. Install openCV-python. Please refer openCV website.

    # https://docs.opencv.org/4.x/d6/d00/tutorial_py_root.html
    pip install opencv-python
  6. If the above code does not work for you try this(skip this step 5 worked).

    conda install -c conda-forge opencv
  7. Add video that you want lane detection to run on in the same directory.

  8. Change the directory name inside the python file LaneDetection.py and Run LaneDetection.py from this directory and from inside this environment.

    python LaneDetection.py

License

Distributed under the GNU General Public License v3.0 License. See LICENSE.txt for more information.

(back to top)

About

This is a traditional method to detect road lanes and get steering inputs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages