0

I am trying to make a game that uses collision with face. But i havent figured what cvHaarDetectObjects returns. Here is a smalll snipet of code.

cascade = cv.Load('haarcascade_frontalface_alt.xml')
faces = cv.HaarDetectObjects(grayscale, cascade, storage, 1.2, 2,
cv.CV_HAAR_DO_CANNY_PRUNING)

if faces:
    for i in faces:
        print i

I get somthing like this :((74, 22, 149, 149), 3) What is all this information? Ty

Rasovica
  • 239
  • 1
  • 4
  • 14

1 Answers1

1

From the docs:

The function finds rectangular regions in the given image that are likely to contain objects the cascade has been trained for and returns those regions as a sequence of rectangles....

The function returns a list of tuples, (rect, neighbors) , where rect is a CvRect specifying the object’s extents and neighbors is a number of neighbors.

See also this SO question.

Community
  • 1
  • 1
unutbu
  • 842,883
  • 184
  • 1,785
  • 1,677