The track was assumed to be always in line with the camera horizontally, which allowed some simple algorithms to scan lines for unbroken non-track areas when the camera image was thresholded to find the track area. To find the car, a check for the total number of frame differenced pixels were done through the image. The front of the car was found by putting some red on it, and allowing a similar thresholding to find only red. To navigate around the track, waypoints were used, added by a few measurements of track areas and locations to put them in the same location each time.
After all the information was made available, the rules needed to successfully navigate between waypoints were kept simple since the car had a poor turning circle and didn’t have much in the way of advanced driving techniques to use. These were able to navigate from most “crash positions” (where the car cannot continue towards it’s next waypoint without turning), and was able to complete 10 laps of the track successfully. A sample of the points taken is below:
You can download my final report here:
The final code is available too, although it will need a certain web camera, and UserPort installed do much:
Finally, since the code is unlikely to run, there is a gallery of pictures (most which are in the report), and some videos available. These have some “commentary” but sometimes is of pretty poor quality and hard to hear. All of these are H264 MPEG-4 videos with AAC audio.
- One Lap
- Ten Laps
- Crash test – Corner
- Crash test – Corner between chicane and wall
- Crash test – Facing barrier
- Crash test – Facing chicane
- Crash test – Facing left wall
- Crash test – Facing top wall
Edit September 2009: Ouch, I didn’t link the code properly on my site and never noticed, likely as not no one tried to download it anyway Should be fixed now!