faceRecognizer; cannot ->set() threshold after constructed [closed]

asked 2015-06-30 16:20:42 -0600

I am trying to create a LBPH face detector and after it's created, adjust the threshold as a form of back-propagation. My problem is there does not seem to be a method in order to set the threshold after it is created. My code, as follows

    double lbphThreshold = 0.0; // This WILL change, look further below
Ptr<FaceRecognizer> model = createLBPHFaceRecognizer(1,8,8,8, lbphThreshold);

//snipped for brevity

    while (predicted == -1){
    lbphThreshold = lbphThreshold + 1.0;
    model->set("threshold", lbphThreshold);
    predicted =  model->predict(image);
    }

Eclipse reports the error as

error: ‘class cv::face::FaceRecognizer’ has no member named ‘set’
model->set("threshold", lbphThreshold);

http://docs.opencv.org/modules/contri... Indicates that ->set is indeed a valid call for the object 'model'. I also tested out trying a

model->getDouble("threshold")

It too fails to be recognized as a call to model.

I've also tried model.set("threshold", lbphThreshold) which also does not work. However, the model->predict(image) does highlight as good code and no errors happen here.

I am using Eclipse in Linux, which I believe is set up correctly (can use other FaceRecognizer functions as normal). Using self-compiled OpenCV 3.0.0 with current Contrib.

Any ideas what's going on?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by sturkmen
close date 2020-09-22 21:01:32.854205

Comments

http://docs.opencv.org/ref/master/df/...

the set(string,something) methods have been removed in favour of setThreshold(), etc.

berak gravatar imageberak ( 2015-07-01 00:06:36 -0600 )edit

also, docs.opencv.org -> 2.4 , docs.opencv.org/ref -> 3.0 docs

berak gravatar imageberak ( 2015-07-01 00:47:30 -0600 )edit