Ask Your Question
1

(Face Recognizer) error 0020: Identifier problems

asked 2017-07-19 20:28:48 -0500

blink gravatar image

updated 2017-07-20 21:21:29 -0500

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();
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-07-20 00:23:16 -0500

berak gravatar image

updated 2017-07-20 06:17:55 -0500

  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

edit flag offensive delete link more

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 ( 2017-07-20 01:06:54 -0500 )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 ( 2017-07-20 03:52:00 -0500 )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 ( 2017-07-20 05:00:03 -0500 )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 ( 2017-07-20 07:42:42 -0500 )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 ( 2017-07-20 21:33:32 -0500 )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 ( 2017-07-20 21:33:53 -0500 )edit
1

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

berak gravatar imageberak ( 2017-07-20 23:05:23 -0500 )edit

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

blink gravatar imageblink ( 2017-07-21 04:26:19 -0500 )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 ( 2017-07-21 04:30:34 -0500 )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 ( 2017-07-25 20:44:17 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-07-19 20:28:48 -0500

Seen: 576 times

Last updated: Jul 20 '17