April 2017
Beginner to intermediate
250 pages
6h 28m
English
To perform object or face detection, first you must load the pretrained XML file using OpenCV's CascadeClassifier class as follows:
CascadeClassifier faceDetector;
faceDetector.load(faceCascadeFilename);
This can load Haar or LBP detectors just by giving a different filename. A very common mistake when using this is to provide the wrong folder or filename, but depending on your build environment, the load() method will either return false or generate a C++ exception (and exit your program with an assert error). So it is best to surround the load() method with a try... catch block and display a nice error message to the user if something went wrong. Many beginners skip checking ...
Read now
Unlock full access