Object tracking
In this recipe, we will learn how to track specific planar objects in our webcam using OpenCV and it's corresponding CinderBlock.
Getting ready
You will need an image depiction of the physical object you wish to track in the camera. For this recipe place that image in the assets
folder and name it object.jpg
.
We will use the OpenCV CinderBlock in this recipe, so please refer to the Integrating with OpenCV recipe from Chapter 3, Using Image Processing Techniques and add OpenCV and it's CinderBlock to your project.
If you are using a Mac, you will need to compile the OpenCV static libraries yourself, because the OpenCV CinderBlock is missing some needed libraries on OSX (it will work fine on Windows). You can download the correct version from the following link: http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.3/.
You will need to compile the static libraries yourself using the provided CMake
files. Once your libraries are correctly added to your project, include...