I'm using a HOG descriptor, coupled with a SVM classifier, to recognise humans in pictures. I'm using the Python wrappers for OpenCV. I've used the excellent tutorial at pymagesearch, which explains what the algorithm does and furnishes hints on how to set the parameters of the detectMultiScale method.
Specifically, I do
# initialize the HOG descriptor
hog = cv2.HOGDescriptor()
# Set the support vector machine to be pre-trained for people detection
hog.setSVMDetector(cv2.HOGDescriptor_getDefaultPeopleDetector())
# Detect people in the image
(rects, weights) = hog.detectMultiScale(image,
winStride=(4, 4),
padding=(8, 8),
scale=1.05)
The parameters are chosen according to a fine tuning on both accuracy and performance, following the explanations in the tutorial itself.
My problem is that this method, which seems like the currently best method to recognise humans in a picture according to literature (the original paper is dated 2005) seems to perform pretty poorly on my images. I have images containing clothes, both with a model and without it and I'm trying this approach to recognise those with the model. On a subset of 300 images which I manually scanned to tag them for containing the model or not, the method fails 30% of the times.
These are some images as examples.
Here it detected a missing human:
Here it did not get the full human:
Here it did not recognise it at all:
I understand that the detector works for upright humans. Should they also be full-figure? My images encompass half-figure, figures with no head or no feet.
Before this, I have tried a Haar-feature based cascade classifier to recognise the face in an image and the accuracy on the same set of image has been 90%, so I was trying to improve on this. Also, I'm interested in understanding why things are not working here.