Implementing face detection using OpenCV cascade classifiers

As mentioned previously, OpenCV v2.4 comes with various pretrained XML detectors that you can use for different purposes. The following table lists some of the most popular XML files:

Type of cascade classifier XML filename
Face detector (default) haarcascade_frontalface_default.xml
Face detector (fast Haar) haarcascade_frontalface_alt2.xml
Face detector (fast LBP) lbpcascade_frontalface.xml
Profile (side-looking) face detector haarcascade_profileface.xml
Eye detector (separate for left and right) haarcascade_lefteye_2splits.xml
Mouth detector haarcascade_mcs_mouth.xml
Nose detector haarcascade_mcs_nose.xml
Whole person detector haarcascade_fullbody.xml

 

Get Mastering OpenCV 4 - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.