GithubHelp home page GithubHelp logo

sakshikakde / lane-detection Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 498.73 MB

Python code to detect lanes from a video input.

Jupyter Notebook 98.24% Python 1.76%
lane-detection histogram curve-fitting computer-vision python3 opencv hough-lines warping homography gamma-correction

lane-detection's Introduction

Problem 1 : Histogram equilization

File structure

.
├── Code
|  ├── utils
|  ├── notebooks
|  ├── other .py files
├── Data
├── Results
└── images

How to run the code

  • Change the directory to the root folder.
  • Run the following code:
python3 Code/ImageCorrection.py  --BasePath ./ --VideoFilePath ./Data/Night\ Drive\ -\ 2689.mp4 --SaveFileName Results/Problem1/ImageCorrection.avi 

Parameters

  • BasePath - BasePath - project folder
  • VideoFilePath - absolute path of the video file
  • SaveFileName - Path to the folder along with name where results are saved. Note: This path is relative to BasePath

Result

alt

Problem 2: Lane Detection

Image Prepossessing

The following operations were performed before lane de- tection:

  1. Image undistortion using cv2.undistort.
  2. Image blurring using a Gaussian kernel of size 5 ×5.
  3. Thresholding the gray image to get a binary image.
  4. Obtained ROI, which is almost 55% of the image.

How to run the code - Approach 1

  • Change the directory to the root folder.
  • Run the following code:
python3 Code/LaneDetection_part1.py  --BasePath ./ --ImageFilePath ./Data/Project2_Dataset2/data_1/data --CamConfigFile ./Data/Project2_Dataset2/data_1/camera_params.yaml --SaveFileName Results/Problem2/lane_result_1.avi 

Parameters

  1. BasePath - project folder
  2. ImageFilePath - absolute path of the image files
  3. CamConfigFile - path where the .yml file is
  4. SaveFileName - file name for the saved video. Note: this path is relative to the BasePath

Results

alt

How to run the code - Approach 2

  • Change the directory to the root folder.
  • Run the following code:
python3 Code/LaneDetection_part2.py --BasePath ./ --VideoFilePath ./Data/Project2_Dataset2/data_2/challenge_video.mp4 --CamConfigFile.Data/Project2_Dataset2/data_2/cam_params.yaml --SaveFileName Results/Problem2/lane_result_2.avi

Parameters

  1. BasePath - project folder
  2. VideoFilePath - absolute path of the video files
  3. CamConfigFile - path where the .yml file is
  4. SaveFileName - file name for the saved video. Note: this path is relative to the BasePath

Results

alt

lane-detection's People

Contributors

sakshikakde avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.