How to use the FaceRecognizer library created in o

2019-07-17 19:26发布

I am trying to implement a face recognizer in java. I got this code example and made changes to fit my requirements on how the system should behave. It works but then when I have images of the same person in different light intensities its efficiency drops. I read that there is a library inserted in openCV for faceRecognizer but then its samples are implemented in c++. Is there any way i can use this library to code in java? and also if we can use it then will it increase the efficiency of the code?

Please do provide some help on this. Stuck on it badly...

3条回答
啃猪蹄的小仙女
2楼-- · 2019-07-17 19:50

You can create a C++ dll for java. You should write a wrapper class (in C++) which uses your C++ codes. Function definitions of the wrapper class should use JNI. This link here should be helpful (it was for me). After you implement the wrapper class, export it as a dll.

查看更多
手持菜刀,她持情操
3楼-- · 2019-07-17 19:57

I think this should do the magic in java

FaceRecognizer model=createFisherFaceRecognizer(); model.train(images,label);

For prediction Int id=model.predict(img);

查看更多
Rolldiameter
4楼-- · 2019-07-17 20:06

Just Use java cv so that you can use all c++ function in java. Download all javacv jar files and try to install javacv to your system

Just look through how to setup javacv in your system.

查看更多
登录 后发表回答