Combine detectMultiScale Objects / Results

asked 2017-07-01 22:31:12 -0600

faces = face_cascade.detectMultiScale(gray, 1.1, 3)
profiles = profiles_cascade.detectMultiScale(gray, 1.1, 3)
profiles_flip = profiles_flip_cascade.detectMultiScale(gray, 1.1, 3)

How do I combine the results and remove overlapping bounding boxes? Depending on the number of faces and their angles, the variables above might be a tuple or a numpy.ndarray. I figure I can use groupRectangles() to reduce overlapping results.

edit retag flag offensive close merge delete

Comments

1

are there multiple faces in your image ?

it's unlikely, that rectangles from a profile cascade, and rectangles from the flipped version belong to the same person.

berak gravatar imageberak ( 2017-07-02 00:11:39 -0600 )edit

There could be multiple faces, but not right now. I lowered the scale Factor and minNeighbors until the script recognized my face consistently. I could play with that some more. There is a small angle where the face and profile overlap. I'm using a Raspberry PI 3 with picamera.

dancole gravatar imagedancole ( 2017-07-02 10:34:12 -0600 )edit