2

I am trying to detect faces and pedestrians using the provided xml files, haarcascade_frontalface_alt and hogcascade_pedestrians.xml. So far i can get some detection, however the pedestrian detection is pretty poor, and the face detection is average. I am doing it on the iphone with 640x480 or 480x640 images. I can make the images bigger as well however the processing takes faster. Also i might move the processing to a server, however the question remains the same. As of now I am doing this to get the results.

Faces: this first one below doesnt even work. it wont compile.

faceDetector.detectMultiScale(matgrey, faces, 1, 1, 2, 0|CV_HAAR_SCALE_IMAGE, cv::Size(30,30));

So I've resorted to the function call below.

faceDetector.detectMultiScale(matgrey, faces);

Pedestrians:

hog.detectMultiScale(rgbMat, found, 0, cv::Size(8,8), cv::Size(32,32), 1.05, 2);

I really would like to increase the results quality. I was curious if changing the parameters for this would enhance the results. I want optimal results so processing time isn't a huge problem.

Thanks and any feed back would be awesome.

herohuyongtao
  • 49,413
  • 29
  • 133
  • 174
m33k
  • 173
  • 6

1 Answers1

1

For face detection, you cannot set the third parameter (i.e. scaleFactor - parameter specifying how much the image size is reduced at each image scale) to be 1, which you will lose the ability to search the faces in the multi-scale way as it will not be able to be re-sized. Try to change it to 1.05 (i.e. default value) or others.

To get better face detections, check out this thread for the recommended values of CascadeClassifier::detectMultiScale() parameters, .


For pedestrian detection, in order to improve its quality, you should try to modify HOGDescriptor::detectMultiScale()'s third (i.e. hit_threshold) and the last parameters (i.e. group_threshold).

Particularly, you should both make them higher in order to get better pedestrian detection result:

  • hit_threshold: Threshold for the distance between features and SVM classifying plane.
  • group_threshold: Coefficient to regulate the similarity threshold. When detected, some objects can be covered by many rectangles. The threshold is used in a group of rectangles to retain it.
Community
  • 1
  • 1
herohuyongtao
  • 49,413
  • 29
  • 133
  • 174