Preface---Within the scope of a research project I have worked on a Lane Departure Warning System (LDWS) and wanted to share it with the community. The project consists in creating a vision-based lane departure warning systems for drivers. It should be noted that this is my first software project on both the Raspberry Pi board and digital image processing techniques. In order to create the lane departure warning system, a meticulous study of how digital image processing works had to be done and quite some time has been spent on the elaboration of the algorithm. A lot of time has been spent on this project and I have taken it as far as I could for the moment since digital image processing is not my expertise. I am making this project open-source in order to create bases for other LDWS projects. Plenty of information and solutions for such a system are spread out through the Internet and I wanted to gather all of the information needed for the creation of a LDWS on this forum.
The project environment----The LDWS developed and shared in this post was created on a Raspberry Pi 3 board and can be run using the Raspberry Pi Camera module. The solution relies on the OpenCV library. Since I had not work on a Raspberry Pi board before, I had to setup the board and install all of the dependencies needed for the project. I have gathered the information needed for the set up of the board, the camera and the OpenCV library in two tutorials which can be found in the GitHub repository described below.
The LDWS algorithm----The LDWS algorithm developed follows the steps given in the image below:
The implemented software has the following design :
As you can see in the image, the following classes have been implemented: A StaticImage class which runs the algorithm on a single input image; A LiveVideo class which runs the algorithm on a live input video stream; A StaticVideo which runs the algorithm on an input video; A LDWS class which stored the attributes needed for the algorithm; An ROI which computes the Region Of Interest in which the algorithm is applied; An ImageTransformation class which stores the different image transformation applied in the algorithm; A LaneAnalysis class implementing the lane sorting and selection.
It should be noted that the algorithm detects and warns departure separately for either the right lane and the left lane. Only the detection of the near field lanes is done in the proposed solution.
Algorithm testing----Some tests have been done on the solution and showed that the algorithm performs at 30 fps for a video resolution of 640*420. Two video samples are given in the GitHub repository as described below. The accuracy of the algorithm has shown a good detection rate but can be enhanced with further work.
Further Work----As I mentioned above, digital image processing is not my expertise and the proposed solution can be improved. Testing under various weather conditions has to be done in order to improve the algorithm. New features can be added such as front vehicle distance computation, far field lane detection, road signal detection etc. The only limit is your imagination (and the hardware capacities ).
GitHub repository----A public GitHub repository can be found at the following URL :
https://github.com/ebuarip/Lane-Departu ... ing-System
In this repository you will find the following: A LDWS folder containing the code and a README.txt file containing instructions and further informaiton on how to run the software; A Tutorials repository explaining how to install Raspbian on the board, OpenCV, the camera module and other dependencies; A VideoSamples folder containing three video samples of either 640*720 or 1280*720 resolution. It should be noted that the algorithm is optimized for the 640*720 video.
I hope my work will help people to build their own LDWS system. If you are interested in taking over my project and improving my solution please share with me the improvements or the new features you have worked on. I would also be very interested in knowing how my project has helped you and what you think about it.
Thanks for your support !!!