Ask Your Question
0

OpenCV FaceRec problem

asked 2016-09-16 08:09:38 -0500

Gawajn gravatar image

Hey guys, I'm using OpenCV Version 3.1. I'm trying to use the LBPHFace Class (http://docs.opencv.org/trunk/df/d25/c...) But it seems that im doing something wrong. When using LBPHModel->setThreshold(0.0) or LBPHModel->get histograms() i get a error telling me class cv::face::FaceRecognizer' has no member named 'setThreshod or getHsotgrams' . The code compiles and work if i dont use any of these functions.

#include "opencv2/core.hpp"
#include "opencv2/core/utility.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/face.hpp"
Ptr<FaceRecognizer> LBPHModel;

void LBPHLearning(holdingFaces holding){
LBPHModel = createLBPHFaceRecognizer(8,1,8,8);
LBPHModel->setThreshold(0.0);    
LBPHModel->train(holding.images, holding.labels);
vector<Mat> histograms = LBPHModel->getHistograms();
cout << "Size of the histograms: " << histograms[0].total() << endl;}

Thanks for your help in advance

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2016-09-16 08:20:02 -0500

berak gravatar image

you have to keep an instance of LBPHFaceRecognizer , to access LBPH specific member functions, FaceRecognizer is only the more general base class.

so, you in your program you need a :

Ptr<LBPHFaceRecognizer> LBPHModel;
edit flag offensive delete link more

Comments

thanks for this helpful and very fast answer!!!

Gawajn gravatar imageGawajn ( 2016-09-16 08:25:39 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-09-16 08:09:38 -0500

Seen: 115 times

Last updated: Sep 16 '16