Robotics‎ > ‎RoboBeagleBot‎ > ‎

Computer Vision

I am using the Genius WideCam 320. Although it doesn't support MPEG or H264 compression, it does work with OpenCV and costs less than $25.

To get started, watch Beaglebone Video Capture and Image Processing on Embedded Linux using OpenCV by Derek Molloy. It is an excellent tutorial. Listed below are some of the commands he uses in the video.
  • lsusb (list attached usb devices)
  • v4l2-ctl -h (list all options for Video for Linux)
  • v4l2-ctl --list-devices
  • v4l2-ctl --all (list all possible options for camera)
  • v4l2-ctl --set-ctrl=brightness=200 (example of how to change one of the settings)
  • v4l2-ctl --list-formats (this will let you know if you can take advantage of mpeg or h265 transcoding on the camera)
  • git clone git://github.com/derekmolloy/bonecv.git


Instead of using Derek's captuer and grabber programs, I just used the following to make sure Video for Linux 2 could actually take a picture programmatically:

  • v4l2grab -x160 -y120 -nl (take a picture and output as a ppm)


If you are using a cheap webcam, you will need to reduce the resolution in Derek's boneCV and boneCVtiming programs prior to compiling them. I believe I had to change the permission on the boneCV.cpp file prior to being able to edit it.


Here are the results of Derek Molloy's boneCV program at a resolution of 320x240.


Using Derek's boneCVtiming program at a resolution of 160x120, I can capture and process about 11 frames per second! This should be fast enough to make computer vision on a BeagleBot useful.


To output video via OpenCV: http://opencv-srf.blogspot.com/2011/09/capturing-images-videos.html (scroll down to the second program)
Comments