This tool is an integration of original lane detection from uvbakutan/lane-detection-raspberry-pi and a LCD screen, so that this little gadget can be mounted in my wife's car and let her know how bad or bad ass she's driving.
Make sure you have the following:
- Raspberry Pi, mine is RP3
- A picamera
- A 16*2 LCD screen, try this
- a breadboard and some wires
- 10k Ohm Potentiometer
I don't have screen's i2c board, so the wiring part is a little messy.
- follow this article to have the screen wired to your RP
- mount the picamera to RP
-
build and install opencv3
make sure you follow this guide's python3 part, and it is going to take about 2h
-
pip install picamera numpy RPi.GPIO Adafruit_CharLCD -
git clone https://github.com/putcn/lane-detection-raspberry-pi -
python lane_watcher.py
Now you are supposed to see the offset and direction in the LCD, or "Not Detected" message if the cam can't see any lane.
You can use sample_video.mp4 in this repo to test the program without truly driving on an open street.
make sure you have a stand for you cam in the car, since the tape connecting the cam and RP is very weak.
Since we are not going to have keyboard or mouse in a car, this tool need to start along with the system.
There are several ways of doing so, just search it and we will not cover this part in this repo.
vision related processing is very computation intensive, especially the real time ones like in our case, so RP's chips can get very hot running the lane detecting program. And the fact putting it in the car will just make the case worse. Make sure your RP has heat sink and/or good ventilation and don't fry your Pi :)
�This tool is only for demonstration purpose. Don't use it in real world driving situation. Your eyes should be focusing on the road all the time when driving.