1 hour Raspberry pi camera controller
Kids really chew into your spare time. I got some time the other day to have some fun with a Raspberry pi, raspicam, Adafruit pwm servo driver, 2 servos, double sided tape, tape and cardboard. In 60 minutes I managed to make the “thing” in the video. OK, some stuff was pre-assembled :-).
Also, I’ve just finished setting the construction up running on Battery power. 2x zippy compact 3300mah 4s (14,4v nominal LiPo) in parallel via a 5v 5A bec powering both the servos and the Raspberry hardware. Running everything including servos for 4 hours , my measurement is that I’ve used less than 10% of the battery capacity.
The servos are currently controlled using up, down, left and right keys and the application is just a modified example from Adafruit. However, it should be very easy to integrate with either the mpu 9150 breakout unit I’ve also installed and make a simple gimbal of sorts.
But first I’m planning to test integrating the code with the opencv haar object recognition stuff I did during the Christmas holidays, for example track clementines.
Raspicam and OpenCV instructions
Filed under: Development, Hardware, Linux, Robots
I have previously gotten the opencv and python bindings to work via the 2.3 opencv system and facial recognition did work, but the system is bugged out and I could only get 64x64px image size.
I followed these instructions to get the raspicam to work with opencv and simplecv
http://tothinkornottothink.com/post/59305587476/raspberry-pi-simplecv-opencv-raspicam-csi-camera
However, there where some minor details wrong with it so here is a short list of the updates to the installation instructions on that page.
I noticed a few problems as I saw it with the above instructions, or possibly I didn’t read the instructions well enough. That said, very good info! Thank you!
Here are the issues I had:
The opencv_2.4.5.sh script pulls in libopencv-dev which in turn pulls in the entire libopencv2.3 from raspbian repositories, which in turn meant that simplecv was still using libopencv2.3.
apt-get remove libopencv-core2.3
Once that is removed, python-opencv is also removed and simplecv will not even run anymore. Adding the following will add the path to where the python cv bindings are.
export PYTHONPATH=/usr/local/lib/python2.7/site-packages/
And finally, the LD_PRELOAD to actually use the correct uv4l libraries.
export LD_PRELOAD=/usr/lib/uv4l/uv4lext/armv6l/libuv4lext.so
Once this is done, you should no longer get the munmap errors etc, and large resolution should work:
SimpleCV:1> cam = Camera(0, {“width”:640, “height”:480})
SimpleCV:2> cam.live()
etc.