This repository is for the work done on my Senior Project.
My intention with this project is to use inexpensive hardware to build a car that can be made to drive autonomously on a simulated road. I intened to use this project to learn about computer vision and programming in general.
Raspberry Pi serves as main on-board computer. There are two ultrasonic sensors connected to the Pi used for obstacle avoidance. An Ardino with a servo/motor control shield communicates with the Pi over serial connection. The Pi reads images from a connected USB webcam, image processing is done on these images to determine how the car should react according to its position on the road. The car is powered by 4-cell Li-Po battery conneted to UBEC to regulate 6v to motors and 5v to electronics.
- Image is captured.
- Image is undisorted.
- Image is warped so that its appears top-down.
- Image is converted to HSV colorspace.
- Image is thresholded based on values for desired lane lines. This creates binary image.
- Function to find lane lines (white pixels) is run and returns contours.
- Countours are fed into function that determines center of each contour.
- Tests run on contours to ensure they represent lane line.
- If two lines in one image drive forward.
- If line on right side of image turn left.
- If line on left side of image turn right.
- If no lane lines stop.
- Repeat. This executes about 10 times/second.
To run: execute main.py in /src/ with python 2.7
Code in other directories is test/example code.