Java OpenCV Facial Recognition
Hi All,
I'm writing a facial recognition program in Java. I've looked on the "Open CV known issues" and discovered that functions to create an instance of the FaceRecognizer class haven't been mapped.
Is there any way round this issue?
see here
@berak Cheers, I'll try that, if I have any problems I'll return! Thanks!
@berak How do I put the cpp file into a .so file, should I place it into the OpenCV files and then rebuild? If that's the case, where would I put the cpp file?
you will have to compile it using gcc or cl. (similar to any opencv cpp sample program. only difference is, that the output is a dll/so not an executable)
no, that's not part of the opencv codebase, put it in it's own folder
@berak Sorry to be a pain, I don't program in C++! Could you give me an example gcc command to build the .so file? Also it's saying jni.h can't be found, so i assume i need to give it an additional link to where it is? (I'm on mac)
something similar to:
(the -dl makes an so of it)
@berak This is what i've got
>g++ facerec.cpp -I/mypath/opencv-2.4.9/build/include -I/System/Library/Frameworks/JavaVM.framework/Headers/ -I/mypath/opencv-2.4.9/build/lib -lopencv_contrib -lopencv_core -lopencv_ml -dl -o facerec.so
Yet i'm still getting missing symbols specifically std::terminate()
sorry but no idea about apple here
@berak the issue was resolved by adding -c it was looking for a main method. So now do i add it to my eclipse project as a library same as when I did OpenCV?
sorry, but imho -c only compiles, but does not link it .
and again, i only tried on win, and all i had to do was to drop the resulting dll into the eclipse project folder.