Is there any way to get a confidence level measurement using face detection using OpenCV?

I developed a face detection application using OpenCVs HAAR cascading discovery detection. The algorithm works fine, but every once in a while it finds patterns on the wall or objects that are not faces.
I want to run additional checks on an object suspected of being a person, but I want to do this only on objects on which I am not sure that they are persons. Is there a way to get a “confidence” level for a face detected by cascading HAAR recognition?

+6
source share
4 answers

OpenCV provides trust with the "weight" argument in the "detectMultiScale" function of the CascadeClassifier class, you need to set the "outputRejectLevels" flag to true

+5
source

OpenCV actually finds more than one result for any particular object, with each detected area basically overlapping each other; Then they are grouped together and form the number of "number of neighbors". This account is the so-called confidence.

When you perform an object discovery, one of the parameters is the minimum neighbors before returning. Increasing it reduces false positives, but also reduces the number of possible detected faces.

+3
source

Why not run several cascades of hara (trained differently) against the same image and see if they give similar results? Let them vote. Thus, if only one cascade found this person, and the others did not, this would give you less confidence in that person.

I could run 3 stages at the same time on the iPhone’s iPhone channel in real time, so performance should not be a problem in many normal scenarios. Read more here: http://rwoodley.org/?p=417

+1
source

Not a direct answer to your question, but it can help reduce false detection.

You can get a less false detection by changing the MinNeibhbours, CV_HAAR_FIND_BIGGEST_OBJECT and size values.

int MinNeighbors = 7;

face_cascade.detectMultiScale (frame_gray, faces, 1.1, MinNeighbors, CV_HAAR_FIND_BIGGEST_OBJECT, size (60, 60));

0
source

Source: https://habr.com/ru/post/915376/


All Articles