Page 1 of 1

Robot following signs

PostPosted: Mon Feb 16, 2015 11:27 pm
by Bastian
Inspired by the RS4 of Samual Matos at http://roboticssamy.blogspot.nl/ , I took a deep dive at scripting in Python and openCV using the very good tutorials of Adrian Rosebrock at http://www.pyimagesearch.com. For me it is now the moment to launch the RB1. :D

Image

The script works with 4 signs (right, left, turn, stop) and you may find it at https://github.com/Bas-Huizer/Rpi-camera-robot-car.git The pictures show the overall logic of the script.

Image

Image

Image

Image

I documented the script rather intensively; maybe it helps beginners (like me) just starting/started.
For me it was a very inspiring quest and I learned a lot of Python, openCV and Numpy. And still there’s a lot to be learned. And a lot of fun playing with the bot! The next sprints will be on additional actions like line following.

Light conditions are crucial when tracking objects by its color. Probably it might help adjusting the Auto White Balancing and/or Dynamic Range of the camera. I didn’t figure out yet how to adjust those parameters using the raspberry-pi-camera-streamer class. (So, maybe Alan could hint me?)

Hints, additions, pulls, etc. on improving the script, especially on speeding-up performance and controlling the motors, are more than welcome!

Image

Re: Robot following signs

PostPosted: Wed Feb 18, 2015 2:55 pm
by Alan
Nice one Bastian,

This is very cool! :) I really like the annotated images you've produced to describe the detection process, are you planning to produce a blog post at all?

To get more control over the camera parameters you'd need to edit the Raspberry Pi Camera Streamer program and then expose the options through Python. The camera streamer is based around the same MMAL library used by the standard raspivid so it should be fairly easy to add options in the same way. Not got much time to do this myself over the next couple of months, but I can provide advice if you're interested.

Regards

Alan