
Ok, here is some working code for face detection using the XO’s webcam. It requires the opencv, opencv-python, and xawtv packages. Xawtv can be skipped if you change it to use gstreamer instead, but gstreamer takes around 3 seconds to initialize the camera, take a picture, and save it. Xawtv, on the other hand, takes about a half second. The face detection algorithm, from OpenCV itself takes anywhere from 0.1 seconds to 3 seconds depending on what parameters you choose. I chose ones that seem to work almost all of the time and take about 0.25 seconds.