Ask Your Question
1

(Face Recognizer) error 0020: Identifier problems

asked Jul 20 '17

blink gravatar image

updated Jul 21 '17

I am still quite new to OpenCV and i don't really know what functions am i suppose to call. Anyone can help by telling me what i should define? Thanks.

Error i got is:

identifier "createFisherFaceRecognizer" is undefined   
'createFisherFaceRecognizer'identifier not found

facerecognizer.cpp:

#include "opencv2/core.hpp"
#include "C:/OpenCV/build/include/opencv2/face.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/objdetect.hpp"

#include <iostream>
#include <fstream>
#include <sstream>

using namespace cv;
using namespace cv::face;
using namespace std;

... line which got error:

    // Create a FaceRecognizer and train it on the given images:
    Ptr<FaceRecognizer> model = createFisherFaceRecognizer();
Preview: (hide)

1 answer

Sort by » oldest newest most voted
1

answered Jul 20 '17

berak gravatar image

updated Jul 20 '17

  1. please do not try to modify the #include like that. you'll have to use #include "opencv2/face.hpp" and the path to the containing folder has to go into the "Additional Include Paths" of your VS project. it also should point to where you installed your opencv libs (which is probably like: c:/somewhere/opencv/build/install/include), not to the src repository

  2. [edit:] you have to use the cv::face namespace: Ptr<face::FaceRecognizer> model = face::FisherFaceRecognizer::create(); (sorry, had that wrong initially !)

  3. look at tutorials and samples

Preview: (hide)

Comments

I have already included the .hpp file in the "Additional Include Paths" of VS project. I did try to use #include "opencv2/face.hpp" before but it gave me more errors which include "unable to open source file". I have also tried using the full path which is "C:Users/Downloads/opencv_contrib-master/opencv_contrib-master/modules/face/include/opencv2/face.hpp"
as well but it also did not work

blink gravatar imageblink (Jul 20 '17)edit
2

@berak I think we are going to have many question about face modules before it was

Ptr<BasicFaceRecognizer> model = createEigenFaceRecognizer();

and now it is (version >3.3.0RC)

 Ptr<EigenFaceRecognizer> model = EigenFaceRecognizer::create();
LBerger gravatar imageLBerger (Jul 20 '17)edit

I used the codings from opencv website but it doesn't work for me. Do you need me to put up the codes to check by any chance?

blink gravatar imageblink (Jul 20 '17)edit

If you are using 3.2 I think that's you should clone last version and build opencv with cmake. Then you can use cmake to build your own project and all link errors and undefined fucntion will be a bad souvenir!

LBerger gravatar imageLBerger (Jul 20 '17)edit

Now i got a link error that says cannot open file 'opencv_calib3d245d.lib' even though i did add the required files inside the Additional Dependencies under the Linker option. Is it because i added the wrong path link?

blink gravatar imageblink (Jul 21 '17)edit

Now i got a link error that says cannot open file 'opencv_calib3d245d.lib' even though i did add the required files inside the Additional Dependencies under the Linker option. Is it because i added the wrong link path?

blink gravatar imageblink (Jul 21 '17)edit
1

why are you trying to link against non existing opencv 245 libs, if you're using another version ?

berak gravatar imageberak (Jul 21 '17)edit

I did try it with opencv_world320d.lib but it did not work for some reason.

blink gravatar imageblink (Jul 21 '17)edit

world and opencv_contrib modules don't work together. assuming, you successfully built the opencv + opencv_contrib modules, you should link your debug build to opencv_core320d opencv_face320d ... and without d for release

berak gravatar imageberak (Jul 21 '17)edit

I checked the lib files that i should type into the additional dependencies and found out that opencv_world.lib already contained all the files required. That is why i don't know any ways to solve the problem.

blink gravatar imageblink (Jul 26 '17)edit

Question Tools

1 follower

Stats

Asked: Jul 20 '17

Seen: 902 times

Last updated: Jul 20 '17