Ask Your Question

Facerecognizer problem with opencv 2.4.5

asked 2013-05-02 10:20:41 -0600

umair gravatar image

I am working o the face recognition example at : I am using eclipse on ubuntu if that’s relevant. Earlier I was using 2.3.1 but it came with an error

‘FaceRecognizer’ was not declared in this scope

so after going through the reply here I updated to the version 2.4.5 of opencv on a different path, but previous version of opencv is still on the machine. Now after directing my include paths and libraries to the new location in the eclipse project, I am still getting the same error.

make all 
Building file: ../src/faceRec_vid.cpp
Invoking: GCC C++ Compiler
g++ -I/usr/local/research/projects/SystemDesign/tools/munish_temp/opencv/include/opencv2 -I/usr/local/research/projects/SystemDesign/tools/munish_temp/opencv/include/opencv -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/faceRec_vid.d" -MT"src/faceRec_vid.d" -o"src/faceRec_vid.o" "../src/faceRec_vid.cpp"
../src/faceRec_vid.cpp: In function ‘int main(int, const char**)’:
../src/faceRec_vid.cpp:87:9: error: ‘FaceRecognizer’ was not declared in this scope
../src/faceRec_vid.cpp:87:23: error: template argument 1 is invalid
../src/faceRec_vid.cpp:87:31: error: invalid type in declaration before ‘=’ token
../src/faceRec_vid.cpp:87:60: error: ‘createFisherFaceRecognizer’ was not declared in this scope
../src/faceRec_vid.cpp:88:10: error: base operand of ‘->’ is not a pointer
../src/faceRec_vid.cpp:118:39: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
../src/faceRec_vid.cpp:136:35: error: base operand of ‘->’ is not a pointer
make: *** [src/faceRec_vid.o] Error 1

Am I missing any thing that i need to do, to direct my eclipse project to the right version. How can I get rid of this error.

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2013-05-02 12:59:31 -0600

berak gravatar image

do a checklist:

  1. did you : #include "opencv2/contrib/contrib.hpp" ?
  2. using namespace cv ?
  3. are you sure, you got rid of your 2.3 version ? (FaceRecognizer was added in 2.4.2)
edit flag offensive delete link more


1 and 2 are there in code. and 2.3 version is still on machine as i mentioned. On my laptop(ubuntu+eclipse) i also have the version 2.3 as well as 2.4.1 and it(FaceRecognizer) is working when I include in my project the new version

umair gravatar imageumair ( 2013-05-03 03:08:32 -0600 )edit

Question Tools


Asked: 2013-05-02 10:20:41 -0600

Seen: 1,108 times

Last updated: May 02 '13