Is there a way to get a measurement of confidence level when using haar face detection using OpenCV?

后端 未结 4 1651
情歌与酒
情歌与酒 2021-01-12 04:10

I developed an application for face detection using OpenCVs HAAR cascade face detection. The algorithm works fine, however every once in a while It finds patterns on the wal

相关标签:
4条回答
  • 2021-01-12 04:41

    Why not run multiple haar cascades (trained differently) against the same image and see if they produce similar results? Have them vote, as it were. Thus if only one cascade found a given face and the others didn't, that would give you less confidence in that given face.

    I was able to run 3 cascades simultaneously on an iPhone video feed in real-time, so performance shouldn't be an issue in many normal scenarios. More here: http://rwoodley.org/?p=417

    0 讨论(0)
  • 2021-01-12 04:42

    Not a direct answer to your question, but this may help in reducing false detection.

    You can get less false detection by tweaking MinNeibhbours, CV_HAAR_FIND_BIGGEST_OBJECT, and Size values.

    int MinNeighbours = 7;

    face_cascade.detectMultiScale( frame_gray, faces, 1.1, MinNeighbours, CV_HAAR_FIND_BIGGEST_OBJECT, Size(60, 60) );

    0 讨论(0)
  • 2021-01-12 04:48

    OpenCV actually finds more than one result for any particular object, each detected area largely overlapping each other; those are then grouped together and form a 'number of neighbours' count. This count is the so called confidence.

    When you perform object detection, one of the parameters is the minimum neighbours before a hit is returned. Increasing it reduces false positives, but also decreases the number of possible detected faces.

    0 讨论(0)
  • 2021-01-12 04:54

    OpenCV provides the confidence via the argument "weights" in function "detectMultiScale" from class CascadeClassifier, you need to put the flag "outputRejectLevels" to true

    0 讨论(0)
提交回复
热议问题