Where can I find the best haar xml cascades for frontal face detection?

I am using OpenCV to detect faces in images that are captured by cameras. But I realized that there are some faces that are not frontal and the eyes are not focused on the camera. Where can I find a haar cascades xas file that is just used for the frontal face without any thinness and the eyes should focus on the camera. Does anyone have such an XML file? Please help me.

Perhaps my English is not very good. Therefore, if you don't understand what I mentioned here. Please let me know, I will change it to understand it more clearly. I hope you can help me. Thank you very much.

+3


source to share


1 answer


So my answer is this: By default, OpenCV provides two classifiers for face detection: frontal and profile. Therefore, if I understand you correctly, you would like to define that:

  • not necessarily frontal and
  • eyes do not focus on the camera.

Condition 2 is easily met with a frontal face classifier, which means you can just use the one provided in opencv by default. For condition 1, you can try a profile detector.

Another possibility is to use detectors for other parts of the face, such as an ear detector. If you find an ear, you can most likely assume that this ear belongs to the profile person you would like to detect.

And my last (but bot at least) advice is that when all the solutions you are trying to fail, you can try to learn your own hara classifier. This is not a hard task, you can find online (especially here on stackoverflow) a lot of information on this, eg. there

EDIT: (after clarifying the comment):

First, let me put your requirements more in numbers because I don't know what the front face means to you in terms of the head. If you mean frontal, since let the tilt and pan angles be in the interval [-15; 15] degrees, so this is resolved by the classic face classifier (these numbers are given for about all the empirical tests I've done so far). I mean if the face is not frontal (i.e. both eyes or mouth are not visible / partially visible), the classifier will not detect it. In other words, if these angles I have given are fine for you, then just use the default classifier. If not, see paragraph below.



The second requirement is that you require the person to look at the camera. What the default classifier cannot distinguish is that it was recognizable on different faces of people, not just the ones you would like to achieve. And I'm sure you are unlikely to find such a classifier on the Internet, because it is such a specific task. But I can assure you that you can try to learn your classic classifier, it can work very well. Please let us know if you achieve good results.

EDIT2: (about a classifier that only defines the head, and only if tilt and pan are zero)

I don't think there is such a classifier. In my experience, even if it exists, someone who finally prepared such a classifier for one purpose did not share it with everyone, because it is such a specific requirement. And it takes a while to prepare a good hara classifier (you need a few hundred positive examples with hand-cropped pan and tilt faces), so I think one way to solve your problem is to prepare your own detector.

Let me suggest another approach as well as head evaluation. It is a method of determining all angles of the position of the face image. There are many algorithms to suit your requirements - user-independent battery life that can answer the question of whether the tilt and pan angles are close to 0. They don't need any training and can be coded line by line from the algorithm description. However, you need some research wanting to get into the article, but I think it might be better to consider doing a head pose assessment rather than learning your own hara classifier.

EDIT3: (head estimate)

This is not a very difficult task. In my master's thesis here, I proved that it is possible to build a real-time call sign head tracker that is human unchanging and reliable using only geometric assumptions about the position of facial landmarks (both eyes, tip of mouth and nose). This gives a head score. You can also start with this article and there is a summary of the article.

+4


source







All Articles