False positive detection is a common issue in computer vision. A false positive happens when the face detection algorithm detects a face in a region of the analyzed image where a real face is not present.
A few settings parameters can be tuned in order to reduce the chance of false positives:
- Decrease the AcceptanceThreshold such that the filter becomes more strict in passing face detections
- If you know where to expect a face, set a Region Of Interest (ROI). Excluding parts of the image from the analysis will also decrease processing time
- Tune the MinFaceSize and MaxFaceSize parameters. This also speeds up processing time
- Change the face detector. The face detectors that come with the SDK have different trade-offs:
DetectorType 2 is best applicable on medium-end machines but you can expect false positives.
DetectorType 4 is best applicable on low-end machines such as Android devices, but will capture more false positives wrt. the other detectors.
DetectorType 5 is the most accurate, but also the most computationally expensive to run.