2

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...

theAndDev
  • 662
  • 2
  • 11
  • 33
  • FaceRecognizer works from Java too: http://stackoverflow.com/questions/11699744/face-recognition-on-android – Samuel Audet Sep 28 '13 at 09:36
  • @SamuelAudet Thanks for answering a part of my question...it kinda helped but my main question still remains unanswered. The pictures in which light intensity differs still give inefficient results. How do I make my system to work efficiently with different pictures? – theAndDev Sep 30 '13 at 05:06

3 Answers3

1

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.

guneykayim
  • 5,210
  • 2
  • 29
  • 61
0

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.

badcoder
  • 46
  • 4
0

I think this should do the magic in java

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

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

eric
  • 1