C/C++‎ > ‎

OpenCV Facedetect

This program detects faces in an input image, based on the example of the OpenCV wiki.
Compile it with (needs libcv-dev, libcvaux-dev and libhighgui-dev):
 $ g++ -O2 -Wall `pkg-config --cflags opencv` -o opencv-facedetect opencv-facedetect.cpp `pkg-config --libs opencv`
Run it with:
 $ ./opencv-facedetect image.jpg
To find faces you need a classifier cascade, per default it's the file haarcascade_frontalface_alt.xml in the same directory.

This program is also availabe as a GIMP Plugin:
http://sites.google.com/site/elsamuko/gimp/facedetect

The algorithm of the OpenCV library is simple, but it even detects Waldo:
(cc) by NeitoShaw


Č
ċ
ď
haarcascade_frontalface_alt.xml
(898k)
El Samuko,
Apr 27, 2010, 5:22 AM
ċ
ď
opencv-facedetect.cpp
(6k)
El Samuko,
Sep 2, 2012, 4:03 AM
Comments