createEigenFaceRecognizer给出错误“未定义”

时间:2014-10-30 08:51:23

标签: c++ opencv face-recognition

我正在尝试使用opencv使用特征脸或PCA算法进行人脸识别,但是在初始化识别器时它是错误的,它是未定义的......请帮助

int num_components = 10;
double threshold = 10.0;
Ptr<FaceRecognizer> model =  createEigenFaceRecognizer(num_components,threshold);

model->train(images, labels);

1 个答案:

答案 0 :(得分:1)

在opencv2.4中,您必须:

#include "opencv2/contrib/contrib.hpp"
// and ofc. link to opencv_contrib.lib

在opencv3.0中,您必须构建/安装opencv_contrib repo,然后:

#include "opencv2/face.hpp"
// and link to opencv_face.lib