Friday, April 2, 2010

Face detection with OpenCV 2.0 & Python 2.6


I've been wanting to play around with OpenCV under Python for ages and today I finally had the free time to have a go. Googling for some good tutorials lead me to a fantastic "hello world" script by Jo Vermeulen. The script used an OpenCV Python wrapper called CVtypes and was based on work done by Nirav Patel with an earlier version of OpenCV.

I wanted to work with the latest version of OpenCV and their new Python bindings so I decided to rework Jo's script for OpenCV 2.0. The results are above and the source code is available here: http://github.com/thisismyrobot/gnomecam/raw/master/face-detect.py

As a side note, I found the installation process for OpenCV under Ubuntu 9.10 utterly horrible. I eventually stumbled across this article that provided the correct steps to get it all working.