face recognition, opencv 2.4, javacv, JNI

asked 2015-03-23 08:28:59 -0600

I am doing face recognition app using opencv 2.4.11, jdk 1.7.75, eclipse juno in windows 7 os and mingw64 (c,c++ compiler) all are 64 bits, here i can capture and detect as well as crop the face for recognition process, I am going to use createFisherFaceRecognizer() method, here I used java native interface for compile through c++ but i got some errors like

undefined reference to cv::createFisherFaceRecognizer(int, double)

please help me to solve this error.

Thanks you in advance

edit retag flag offensive close merge delete

Comments

you have to link against opencv_contrib2411

berak gravatar imageberak ( 2015-03-23 08:37:31 -0600 )edit

yeah link it in make file like

// CREATE .DLL FILE

$@ matches the target, $< matches the first dependancy

facerec.dll : RecognizeFace.o gcc -m64 -Wl,--add-stdcall-alias -shared -o $@ $< -LC:/opencv/build/x64/vc10/lib -lopencv_contrib2411

// CREATE .O OBJECT FILE

$@ matches the target, $< matches the first dependancy

RecognizeFace.o : RecognizeFace.cpp RecognizeFace.h gcc -m64 -I"C:/Program Files/Java/jdk1.7.0_75/include" -I"E:/Mahesh/open cv/opencv/build/include" -I"C:/Program Files/Java/jdk1.7.0_75/include/win32" -LC:/opencv/build/x64/vc10/lib -c $< -o $@ -lopencv_contrib2411

Thank you

mahesh shukla gravatar imagemahesh shukla ( 2015-03-24 01:42:26 -0600 )edit

gcc -m64 -Wl,--add-stdcall-alias -shared -o facerec.dll RecognizeFace.o -LC:/opencv/build/x64/vc10/lib -lopencv_contrib2411 -lopencv_core2411 -lopencv_highgui2411

mahesh shukla gravatar imagemahesh shukla ( 2015-03-24 01:56:23 -0600 )edit

wait, i hope, you're not trying with the prebuild vs opencv libs, those are for a different compiler.

did you built the libs for mingw using cmake ? (you'll have to !)

berak gravatar imageberak ( 2015-03-24 02:44:23 -0600 )edit