Create your own face tracking, pan and tilt camera on the
Raspberry Pi! This tutorial will demonstrate use of the OpenCV
(computer vision) library to identify and track faces on the
raspberry pi using two servos and a USB webcam. For the
interested, I previously covered a more thorough overview of the
installation of OpenCV from source here, however, I have found
that the apt package is sufficient for all but the most bleeding
edge of projects. This project is based on the OpenCV face
tracking example that comes along with the source-based
distribution. In short, it performs face detection using haar-
like features to analyze the video frame, and locates any faces
present within it. In the live video window, identified faces
are surrounded with a red rectangle. For additional information
about how face detection works as well as the specifics of face
detection with OpenCV, I recommend this article by Robin Hewitt.
Using the coordinates of the rectangle vertices, my script
calculates the (X,Y) position of the c