Andrzej Krynski
Andrzej Krynski

Reputation: 71

Why does detectMultiScale return no faces?

I try to use tutorial code from opencv tutorials to detect faces. All cascades are loaded properly but after calling

faceCascade.detectMultiScale( frame_gray, faces, 1.1, 2, 0|CV_HAAR_SCALE_IMAGE, Size(20, 20) ); 

I get no faces, that means faces.size() returns 0. Does anybody played with this code? Does it work? What could I have wrong?

Upvotes: 1

Views: 3124

Answers (2)

Andrzej Krynski
Andrzej Krynski

Reputation: 71

As I have written Mar 28 '14 at 11:57 I have had a bug in part of code showing if cascade is loaded. It was not. XML files HAVE to be in prog dir It is SOLVED

Upvotes: 1

silver surfer
silver surfer

Reputation: 258

You are specifying minimum detected object size as (20,20). Maybe your image contains faces which are of much smaller size. Try changing it to smaller number.

This page explains various parameters of detectMultiScale function :

http://docs.opencv.org/modules/objdetect/doc/cascade_classification.html

Upvotes: 0

Related Questions