Ask Your Question
0

identifier "FaceRecognizer" is undefined OpenCV 3.0.0

asked 2015-10-16 02:46:55 -0600

Mehdi.Am gravatar image

updated 2015-10-16 03:06:46 -0600

Hi Friends

I need to use the following code via OpenCV 3.0.0 but it's not accepted by compiler and this error appears,

In fact, when I use OpenCV 2.4 it doesn't appear and it can be detected.

I don't know which header I should include that I didn't!

here is an abstract of my code (via opencv 3.0.0):

      #include "opencv2/core.hpp"
        #include "stdafx.h"
        #include "opencv2\imgproc\imgproc.hpp"
        #include <iostream>
        #include <fstream>
        #include <opencv2\calib3d\calib3d.hpp>
        #include "opencv2\core\core.hpp"
        #include "opencv2\highgui\highgui.hpp"
        #include "opencv2\objdetect\objdetect.hpp"
        #include "opencv2\opencv.hpp"

        using namespace cv;
        using namespace std;
    main()
{
      ...
    Ptr<FaceRecognizer> model = createFisherFaceRecognizer(); //it doesn't detect FaceRecognizer

    model->train(images, labels);
      ...
}
edit retag flag offensive close merge delete

Comments

thank you @berak but you know,instead I decided to use opencv 2.4 to not face this problem,but unfortunately imread() function doesn't work well..I mean it doesn't load the image via opencv 2.4.look at here please (this is my problem):
http://answers.opencv.org/question/73...

Mehdi.Am gravatar imageMehdi.Am ( 2015-10-16 03:24:07 -0600 )edit

2 answers

Sort by ยป oldest newest most voted
2

answered 2015-10-16 03:11:32 -0600

berak gravatar image

hi, Mehdi, with opencv3 anything from the former contrib module(and more..) has been moved to a seperate opencv_contrib repo

hold your breath - you will need to download that, add it to your cmake settings (see readme there) and rebuild all from src using cmake.

after that , it will be: Ptr<face::FaceRecognizer> model = face::createFisherFaceRecognizer(); // additional namespace

(i already see, that this will be a very long thread .... )

edit flag offensive delete link more

Comments

thank you @berak but you know,instead I decided to use opencv 2.4 to not face this problem,but unfortunately imread() function doesn't work well..I mean it doesn't load the image via opencv 2.4.look at here please (this is my problem):
http://answers.opencv.org/question/73...

Mehdi.Am gravatar imageMehdi.Am ( 2015-10-16 03:27:10 -0600 )edit
0

answered 2017-10-04 12:00:09 -0600

just add using namespace cv::face This will add namespace references.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-10-16 02:46:55 -0600

Seen: 2,541 times

Last updated: Oct 16 '15