people detection with haar cascade

2019-07-26 13:49发布

I am working on a project in my school to detect how many students are in the classroom. Like in this picture. classroom

I have been trying to use Haar Cascade in opencv for face detection to detect people, but the result is very bad. Like this: After detection

I took thousands of pictures in classroom, and cropped the picture with people manually. There are about 4000 positive samples and 12000 negative samples. I was wondering what did I do wrong? When I crop the image, should I only crop only head like this? Head Or like this with body? With Body

I think I had enough training samples, and I follow the exact procedure with this post: http://note.sonots.com/SciSoftware/haartraining.html#v6f077ba which should be working. Or should I use a different algorithm like HOG or SVM. Any suggestion would be great for me, I have been stuck in this for months and don't have any clue. Thanks a lot!

2条回答
Juvenile、少年°
2楼-- · 2019-07-26 14:25

Haar is better for human face. Hog with SVM is classic for human detection and there've been lots of source and blogs about them, it's not hard to train a classifier. For your scene, I think 'head and shoulder' is better than 'head alone'. But your multi-view samples increase the difficulty. A facing cam would be better. Add more hard neg samples if you always have much more false positive alarms. This paper may help: http://irip.buaa.edu.cn/~zxzhang/papers/icip2009-1.pdf

查看更多
我想做一个坏孩纸
3楼-- · 2019-07-26 14:27

Normally, with Haar cascade, the result is very different when we change the parameters when we train the classifier. In my case, that object is very simple, but it cannot detect too: opencv haar cascade for Varikont detection

When I changed the parameters, it can detect very nice. You can have a look here: https://inspirit.github.io/jsfeat/sample_haar_face.html

Or more special and more professional, you can research about Bag of Visual Words (SIFT/SURF + SVM or SGD).

Personally, I think you don't need to use the method complex for person detection. Regards,

查看更多
登录 后发表回答