• minFeatureSize: This parameter determines the minimum face size that we
care about, typically 20 x 20 or 30 x 30 pixels but this depends on your use
case and image size. If you are performing face detection on a webcam or
smartphone where the face will always be very close to the camera, you could
enlarge this to 80 x 80 to have much faster detections, or if you want to detect
far away faces, such as on a beach with friends, then leave this as 20 x 20.
• searchScaleFactor: The parameter determines how many different sizes
of faces to look for; typically it would be 1.1 for good detection, or 1.2 for
faster detection that does not find the face as often.
• minNeighbors: This parameter determines how sure the detector should be
that it has detected a face, typically a value of 3 but you can set it higher if
you want more reliable faces, even if many faces are not detected.
• flags: This parameter allows you to specify whether to look for all faces
(default) or only look for the largest face (CASCADE_FIND_BIGGEST_OBJECT).
If you only look for the largest face, it should run faster. There are several
other parameters you can add to make the detection about one percent or two
percent faster, such as CASCADE_DO_ROUGH_SEARCH or CASCADE_SCALE_IMAGE.