Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

hmm, yes, bugs in the tutorial. (and a bad api design, imho)

you already found the 1st one, it should be conf->face_detector, then it is:

typedef bool(* cv::face::FN_FaceDetector) (InputArray, OutputArray, void *userData);

but the tutorial has:

bool myDetector(cv::InputArray image, cv::OutputArray faces, Conf *conf)

void* != Conf* , different signature there. either cast the function pointer:

facemark->setFaceDetector((FN_FaceDetector)myDetector, &config);

or make myDetector compliant to the interface:

bool myDetector(cv::InputArray image, cv::OutputArray faces, void *user) 
{
    Conf *conf = (Conf*)user;
    ....

maybe you rather want to use the facemark_demo_lbf sample instead of the tutorial code.

hmm, yes, bugs in the tutorial. (and a bad api design, imho)

you already found the 1st one, it should be conf->face_detector,

then it is:

typedef bool(* cv::face::FN_FaceDetector) (InputArray, OutputArray, void *userData);

but the tutorial has:

bool myDetector(cv::InputArray image, cv::OutputArray faces, Conf *conf)

void* != Conf* , different signature there. either cast the function pointer:

facemark->setFaceDetector((FN_FaceDetector)myDetector, &config);

or make myDetector compliant to the interface:

bool myDetector(cv::InputArray image, cv::OutputArray faces, void *user) 
{
    Conf *conf = (Conf*)user;
    ....

maybe you rather want to use the facemark_demo_lbf sample instead of the tutorial code.