/Lane_Detection

This project - a software written in python and opencv library helps in lane detection for autonomous cars.

Primary LanguagePython

Lane Detection and Prediction

In this project, we aim to do simple Lane Detection to mimic Lane Departure Warning systems used in Self Driving Cars. We have two video sequences that are taken from a self driving car. The approach is to design an algorithm to detect lanes on the road, as well as estimate the road curvature to predict car turns.

Author

Install Dependencies

Run Instructions

Navigate to your workspace.

cd <Workspace>

Clone this repository and change the directory to Lane_Detection/Codes folder.

git clone https://github.com/namangupta98/Lane_Detection.git
cd Lane_Detection/Codes

Project Sections

The project has three sections.

  • Video Quality Enhancement: Here, we aim to improve the quality of the video sequence provided of a highway during night. Most of the computer vision pipelines for lane detection or other self-driving tasks require good lighting conditions and color information for detecting good features. A lot of pre-processing is required in such scenarios where lighting conditions are poor. Using the knowledge of histogram equalization the video is enhanced.


Figure 1 - Video Brightness Enhancement using Histogram Equalization (Left: Original Video, Right: Enhanced Video)

 Run the following command to see the improved contrast of the image.
```
python3 Q1_histo.py 
```
  • Lane Detection and Prediction: Using histogram of lane pixels the lanes are detected and warped to perform post-processing on the lanes to seperate yellow lanes and white lanes in the video sequence using HSV color detection. After lanes are detected, the lanes are refined and unwarped back to the video. For prediction, the difference between lane pixels of previous frame and current frame is used. If the difference is positive the lane is turning right, if negative the lane is turning left, else the road is going straight.


Figure 2 - Lane Detection and Prediction for Data-1

Type the following for lane_detection and prediction Data 1

python3 question_2_naman.py


Figure 3 - Lane Detection and Prediction for Data-2

Type the following for lane_detection and prediction for Data 2

python3 Question_2_Final_Challenge.py

Results

https://drive.google.com/drive/folders/14he1q5mJtwVrM9toGu5lVNH6lYgcHDK7?usp=sharing

TODO

  • Refinement of Lane Detection
  • Shade the warped region
  • Need more accurate Lane Prediction
  • Try Curve Fitting using RANSAC for Curve Prediction