March 2019
Intermediate to advanced
312 pages
7h 37m
English
Let's write a program to detect a human face. I have named this program FaceDetection.cpp and you can download it from the Chapter08 folder of this book's GitHub repository.
Since we will be using haarcascade_frontalface_alt2.xml to detect faces, please make sure that the FaceDetection.cpp and haarcascade_frontalface_alt2.xml files are in the same folder.
To program face detection, follow these steps:
CascadeClassifier faceDetector("haarcascade_frontalface_alt2.xml");