Created: 2012-03-20 21:49
Updated: 2018-09-18 04:16


Detects a face through your webcam and automatically begins tracking it. I also detects eyes and mouth movements and checks if anyone is speaking or not.


Face detection is actually performed only once every 2 seconds to conserve CPU. The face tracking on our live video is done through CamShift which is fast way to keep track of moving objects.

There are two methods for setting the parameters smin and vmin:



These two parameters control tracking quality.
They're set to default to the values that worked best.
You may need to tweak these values, using the above interfaces, to get good tracking results with your setup.


You will need to modify OPENCV_ROOT (TrackFaces.c, line 20) to reflect your directory structure.

To use the Module, you'll need to have OpenCV installed.

Alternatively, you can install libkface-data on ubuntu, this code uses the haarcascades that come with it, so you don't need to change any paths if you do this.

To compile, run:

g++ TrackFaces.c -I /usr/include/opencv/ -I /usr/include/X11/ -lcv -lhighgui -lcxcore -lX11

(assuming you have similar installation paths)


Yash Shah


Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more