In this project i have used OpenCV to detect road lanes for self driving cars. By detecting road lanes we can help self driving cars in good lane keeping and turning on a curved road.
- First i have performed GaussianBlur on the image.
- Then the image is converted to hsv format.
- Then i have created a mask to detect the yellow road lanes.
- Then i have used CannyEdge detector which helps Hough transform.
I cropped the image where the lanes are to be detected to avoid false detections. Without this cropping i got some detections on buildings, etc.
So i defined a region of interest where lane detections have to be made and then used bitwise AND to crop the image.
I used Probabilistic Hough Transform to detect lines in the Preprocessed image and then drew these lines over on the image.
This method worked on video and can be used in real time and doesn't require much expensive hardware.
This is a naive approach to road lane detection problem in self driving cars and has its limitations
- Algorithm has trouble finding road lanes when there are shadows over them.
- Sunlight also affects the algorithm in detecting the road lanes.
These problems can be solved using a deep learning based approach. I have tried to build a simple approach to a problem without using deep learning so that no expensive hardware is required.