jewelnguyen8
jewelnguyen8

Reputation: 249

Face detection wrong object

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.

Upvotes: 0

Views: 2225

Answers (2)

Mr.ComputerFunk
Mr.ComputerFunk

Reputation: 55

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

Upvotes: 0

Rajesh J Advani
Rajesh J Advani

Reputation: 5710

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.

Upvotes: 3

Related Questions