0

We're using Emgu CV to detect face and recognize gender, but my boss said that there is something wrong and i don't know why. I'm using Emgu CV version 2.4.9 and I'm using default haar-cascade xml file. The thing that is so wrong is in the following image that is captured by webcam.

enter image description here

There is no face in the picture but there is a group rectangles which has many rectangle, I set minNeighbour = 0 because I wanted to display all the rectangle that predicts to contain face. Please give me some opinions or some idea to eliminate this situation. I'm sure that my code is correct. Very thank for your help.

Sorry about my English.

jewelnguyen8
  • 249
  • 3
  • 16

2 Answers2

3

One option that works well to get rid of false positives, is reducing the resolution of the image. Images with large resolutions often have artifacts resulting from compression, which fool the Haar cascades.

So resize to 50% of the height and width, and process again. Of course, if the faces in the image are too small, reducing the resolution might result in the cascade not detecting them.

So you could do both scans, and images which are not detected in both could fall into a category of probable matches.

Rajesh J Advani
  • 5,585
  • 2
  • 23
  • 35
  • I think that your solution is not good for me because the people are always far from my webcam. – jewelnguyen8 Oct 07 '14 at 10:50
  • What is the resolution of your webcam? Also you can try the gaussian blur option suggested by Pervez in the comments. Also, that's why I'm suggesting that you consider matches in both tests as a high probability match, and only match in one, as a lower probability match. Some testing will help you figure out how to interpret this. Also depends on what you want to do with the matched faces. – Rajesh J Advani Oct 08 '14 at 14:19
  • I have a new solution that is using webcam with the biggest zoom. So we can capture some faces far from the webcam but the area is narrower. We're trying this solution. – jewelnguyen8 Oct 08 '14 at 16:09
  • Actually, we did have a solution before but It isn't good for our situation but I think that It will help someone here. After we detect all rectangles that maybe contain face, we using all the rectangles as the input for eyes detection, so we can eliminate all rectangles that don't contain eyes, and finally we have all faces. – jewelnguyen8 Oct 08 '14 at 16:17
0

Dont set minNeighbour = 0, that is why I think you are getting so many false detections. Set minNeighbour between 2 and 6.

Give it a try

  • I set minNeighbour = 0 just want to show all the rectangles. Please read more carefully about what I mentioned above. You know that there is a group of rectangles in the picture above. So though I set minNeighbour = 6, It will still show in the picture. I want a solution how to eliminate the group between the screen. Do you clearly understand? – jewelnguyen8 Oct 09 '14 at 17:53