A student level project for the course "Perception for Autonomous Robots". It is an implementation of various concepts such as gaussian blurring, image warping, sliding window, and edge detection using the libraries opencv and numpy applied to a real time problem, to detect road lanes and predict upcoming turns.
The goal of this project was to develop a system that can detect road lanes and predict turns in real-time using a sliding window algorithm. To achieve this, we implemented the following steps:
- Preprocessing: I applied gaussian blurring to reduce noise and image warping to correct for perspective distortion.
- Edge Detection: I used edge detection techniques to identify the edges in the preprocessed image.
- Sliding Window: I used a sliding window algorithm to identify the lane lines in the image by searching for the highest concentration of edges within each window.
- Turn Prediction: I used the positions of the detected lane lines to predict the direction of the turn.
The challenge is to not use any inbuilt functions from open source libraries but to implement the mathematics behind the functions and understand how things work behind the API. Once you have implemented both of them compare the result of each technique and validate them with the original dataset.
To run this project, you will need to install all/some of the following:
- OpenCV
pip install opencv-python
- Numpy
pip install numpy
- glob
pip install glob2
- Download and install Anaconda {easy}
├───LICENSE
├───proj2_part2_report.pdf
├───README.md
├───Lane_Detection.py
├───Turn_Prediction.py
├───challenge.mp4
├───whiteline.mp4
├───outputs prob 2
└───outputs prob 3
-
Clone the repository
git clone https://github.com/bharadwaj-chukkala/Road-Lanes-detection-and-Turn-Prediction-using-Sliding-Window-Algorithm.git
-
Open the folder in the IDE
-
Lane Detection
- Uses the
whiteline.mp4
video data - Run the
Lane_Detection.py
file - Uncomment the commented lines at the end to save outputs to outputs folder
- Uses the
-
Turn Prediction
- Uses the
challenge.mp4
video data - Run the
Turn_Prediction.py
file - Uncomment the commented lines at the end to save outputs to outputs folder
- Uses the
Input-> Blurring-> Edge Detect-> Select ROI-> Hough Transform-> Warp Image-> Output
The implementation is robust to detect dashed lines and continuous lines even after flipping the frame
Binary Thresholding-> Contour Detect-> Select ROI-> Warp Image-> Sliding Window-> Predict Turn
The implementation is robust to detect the road and predict upcoming turns.
This project is licensed under the MIT License - see the LICENSE file for details.
Bharadwaj Chukkala
UID: 118341705
Bharadwaj Chukkala is currently a Master's student in Robotics at the University of Maryland, College Park, MD (Batch of 2023). His interests include Machine Learning, Perception and Path Planning.