Ask Your Question
0

Face detection using OpenCV with Java

asked 2016-08-27 01:37:55 -0600

mghildiy gravatar image

updated 2016-08-27 01:51:50 -0600

Hi,

I am trying to use OpenCV 3.1.0 in a java based face detection program. I am using OpenCV for first time and I have followed this.

Program works but its far from accurate. I have used both lbpcascade_frontalface.xml and haarcascade_frontalface_alt.xml. So I want to improve the program, but I have no idea how to go ahead about it. How OpenCV works, face detection in particular, is totally a black box to me.

Please tell me how should I go ahead to make program more accurate...ant links,resource,tutorials would help.

I read about training classifiers. Is it a solution?

Edit: For eg., following is the results I got:

image description

image description

image description

image description

image description

With regards Manish

edit retag flag offensive close merge delete

Comments

1

"inaccurate" means what, exactly ? there are a few parameters to tune.

berak gravatar imageberak ( 2016-08-27 01:46:01 -0600 )edit

Sorry for incomplete data. I have edited my post.

mghildiy gravatar imagemghildiy ( 2016-08-27 01:52:17 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-08-29 06:25:32 -0600

Basically what you expect OpenCV to do and what the model your using does are 2 different things.

  1. The frontal face model is a model that is trained with data of aligned upright faces of 24x24 pixels. It can thus not detect anything smaller than 24x24 pixels, and will work best on frontal upright faces as test images. This is due to the current OpenCV implementation.
  2. First thing that goes wrong is tilted heads. Since the model does not have that in its training data it will never work. This means you need a rotation invariant face detector. How to achieve that using this model has been explained by me multiple times before on this forum AND is also explained in the OpenCV 3 Blueprints book, chapter 5.
  3. The image with the small faces, go ahead and upscale it, for example 2 or 3 times. All at once, faces will be detected.
  4. OpenCV face models are racist ... simply said, there are no black and asian people in its training set, thus the chance of them getting detected is fairly low. You need models trained with black and asian people to achieve this.
  5. The last image contains different face poses, again not covered in the model. This mean you will need extra models covering these positions, either by training them yourself or by finding them somewhere online.

Overall, opencv face detection might be to strict for your goal, which needs much more robust and more complicated algorithms to get a better and higher detection rate.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-08-27 01:37:55 -0600

Seen: 573 times

Last updated: Aug 29 '16