Xuan  Wang
Xuan Wang

Reputation: 33

Is there a criteria for the size and position of bounding box of detected face

I'm trying to assess the accuracy of my face detection code. But the data set is a video clip where the person in the image turns his head from side to side, so this clip contains both frontal and profile faces.

I'm using Viola-Jones face detector in OpenCV and it would fail on some profile faces and the bounding box might become very small or large sometimes even on some frontal faces.

My question is that is there a criteria for the size and position of bounding box of face?

When trying to annotate ground truth of faces manually, I'm not sure whether the bounding box should be a little larger than the face or it should be just as large as the face. Besides, when comparing the detection result with the ground truth, even the result position coincides with the ground truth, the result size could be too small or too large. So I want to see if there is any criteria for the size of detected faces.

Many thanks!

Upvotes: 1

Views: 1552

Answers (1)

herohuyongtao
herohuyongtao

Reputation: 50687

In OpenCV, the output of the detected faces are always squares (height = width). As I mentioned here, you can use the minSize / maxSize parameter of CascadeClassifier::detectMultiScale() to control how big size you want to detect (e.g. detect any face that is larger than 30x30 and smaller than 200x200 if minSize=cv::Size(30,30), maxSize=cv::Size(200,200)).

To annotate the ground truth, in my opinion, you can first run the OpenCV face detector on the video to get a rough feeling how the result rectangles are arounding the faces, and then try to annotate by following the patterns.

Upvotes: 1

Related Questions