Using OpenCV
With your camera connected, you can access amazing vision capabilities that have been provided by the open source community. One of the most powerful capabilities is OpenCV.
You already installed OpenCV in Chapter 1, Preparing the BeagleBone Black. If you'd like a good overview on OpenCV and more documentation, see http://docs.opencv.org/.
Now you can try OpenCV. It is easiest to use Python when programming simple tasks, so let's start with the Python examples. If you prefer the C examples, they are also available. In order to use the Python examples, you'll need the python-numpy library. Type sudo apt-get install python-numpy
. You will need this to manipulate the matrices that OpenCV uses to hold the images.
Start with one of the Python examples. You can access the Python examples by typing cd /home/ubuntu/examples/python
. There are a number of useful examples; you'll start with the most basic. It is called camera.py
. To run this example, you'll either...