Ask Your Question

Revision history [back]

Problems with FaceRecognition - URGENT

Hello everyone,

I'm try to follow the tutorial from docs (here) , but when I try to compile, doesn't work.

Ptr<EigenFaceRecognizer> model = EigenFaceRecognizer::create();
model->train(images, labels);

The error:

error: ‘EigenFaceRecognizer’ was not declared in this scope
Ptr<EigenFaceRecognizer> model = EigenFaceRecognizer::create();
reconhecimento.cpp:72:25: error: template argument 1 is invalid
Ptr<EigenFaceRecognizer> model = EigenFaceRecognizer::create();
reconhecimento.cpp:72:35: error: ‘EigenFaceRecognizer’ is not a class, namespace, or enumeration
Ptr<EigenFaceRecognizer> model = EigenFaceRecognizer::create();                               ^
reconhecimento.cpp:73:7: error: base operand of ‘->’ is not a pointer model->train(images, labels);
reconhecimento.cpp:76:29: error: base operand of ‘->’ is not a pointer
int predictedLabel = model->predict(imread(path_output+paths_out[i]+".png"));

Someone can help me? Thanks.

Problems with FaceRecognition - URGENT

Hello everyone,

I'm try to follow the tutorial from docs (here) , but when I try to compile, doesn't work.

Ptr<EigenFaceRecognizer> model = EigenFaceRecognizer::create();
model->train(images, labels);

The error:

error: ‘EigenFaceRecognizer’ was not declared in this scope
Ptr<EigenFaceRecognizer> model = EigenFaceRecognizer::create();
reconhecimento.cpp:72:25: error: template argument 1 is invalid
Ptr<EigenFaceRecognizer> model = EigenFaceRecognizer::create();
reconhecimento.cpp:72:35: error: ‘EigenFaceRecognizer’ is not a class, namespace, or enumeration
Ptr<EigenFaceRecognizer> model = EigenFaceRecognizer::create();                               ^
reconhecimento.cpp:73:7: error: base operand of ‘->’ is not a pointer model->train(images, labels);
reconhecimento.cpp:76:29: error: base operand of ‘->’ is not a pointer
int predictedLabel = model->predict(imread(path_output+paths_out[i]+".png"));

If I change to

Ptr<BasicFaceRecognizer> model = createEigenFaceRecognizer();

The error turns to

reconhecimento.cpp:(.text+0x756): undefined reference to `cv::face::createEigenFaceRecognizer(int, double)'
reconhecimento.cpp:(.text+0x8cc): undefined reference to cv::face::FaceRecognizer::predict(cv::_InputArray const&) const'
collect2: error: ld returned 1 exit status

Someone can help me? Thanks.

click to hide/show revision 3
None

updated 2018-01-15 12:10:26 -0600

berak gravatar image

Problems with FaceRecognition - URGENT

Hello everyone,

I'm try to follow the tutorial from docs (here) , but when I try to compile, doesn't work.

Ptr<EigenFaceRecognizer> model = EigenFaceRecognizer::create();
model->train(images, labels);

The error:

error: ‘EigenFaceRecognizer’ was not declared in this scope
Ptr<EigenFaceRecognizer> model = EigenFaceRecognizer::create();
reconhecimento.cpp:72:25: error: template argument 1 is invalid
Ptr<EigenFaceRecognizer> model = EigenFaceRecognizer::create();
reconhecimento.cpp:72:35: error: ‘EigenFaceRecognizer’ is not a class, namespace, or enumeration
Ptr<EigenFaceRecognizer> model = EigenFaceRecognizer::create();                               ^
reconhecimento.cpp:73:7: error: base operand of ‘->’ is not a pointer model->train(images, labels);
reconhecimento.cpp:76:29: error: base operand of ‘->’ is not a pointer
int predictedLabel = model->predict(imread(path_output+paths_out[i]+".png"));

If I change to

Ptr<BasicFaceRecognizer> model = createEigenFaceRecognizer();

The error turns to

reconhecimento.cpp:(.text+0x756): undefined reference to `cv::face::createEigenFaceRecognizer(int, double)'
reconhecimento.cpp:(.text+0x8cc): undefined reference to cv::face::FaceRecognizer::predict(cv::_InputArray const&) const'
collect2: error: ld returned 1 exit status

Someone can help me? Thanks.