Overlay Face Detection in OpenCV

First let me give some information on what I'm trying to do.

I am working on the problem of face verification using the faces of the profile, and my first step is to detect faces. I am using an OpenCV face detector with "haarcascade_profileface.xml". The problem is that the detector cannot find the face in series. I do not agree, he finds a face in a certain region, but sometimes he finds a face larger, sometimes smaller, and sometimes both. I want him to always find the same area as his face.

I am adding a few images to better talk about my problem. You can find them here .

What should I do to overcome this detection of several faces in one area (overlapping face recognition)?

The first thing that came to my mind was to increase the minNeighbors parameter, but this leads to a decrease in the detection speed, so I do not want to do this. Then I think about using some image stabilization algorithm on facial images, but I think it will be too expensive. If anyone can give me advice on how to overcome this problem, I will be glad.

I must mention that I am using OpenCV 2.4.5 and I set the minNeighbor parameter to 4, scaleFactor was 1.75 and did not set a size limit.

Thanks in advance,

Hi,

Guney

+4
source share
2 answers

If you detect faces from a video, you can apply a filter in the bounding box so that the smooth frame changes smoothly. This will reduce these โ€œinconsistenciesโ€ in the bounding box of the face.

CurrentFrameBoundingBox = a * PrevFrameBoundingBox + (1-a) * FoundBoundingBox

since a is larger, this will add more weight to the previous frame and reduce inconsistencies.

You do this for each coordinate in the bounding box.

+2
source

Perhaps you can customize your personalized cluster clustering to fit your needs for raw bounding cells. If I remember correctly, OpenCV filters or clusters these source results, because the classifier fires several times for the same object. If you are not satisfied with the procedure in OpenCV, you can try other density-based clustering methods. Or you can just take the median of these initial results.

0
source

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


All Articles