• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Face Recognition using Opencv and Javacv

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,

I have been trying to implement a face recognition application using eigen faces algorithm in Java. For which I have installed Opencv and Javacv. I need some measures to check if opencv and javacv are properly installed or not because I am encountering with many errors which occur due to the absence of Opencv and javacv libraries. Unsatisified link error is the one I have been facing since long time. Can anyone please help how to resolve this issue. I am using windows 8 OS and Opencv2.4.5 and javacv0.5. Thanks in advance
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch.

UnsatisfiedLinkError almost always means that Java can't find a native library (a DLL on Windows, or an .so file on Linux or Mac OS X). The error message contains the name of the library that wasn't found. To make Java find the library, you must set the system property java.library.path to the directory that contains the native library. You can do this with the -D option when you run the application on the command line, for example:

java -Djava.library.path=C:\MyProject\lib com.mycompany.MyMainClass

You can also get this error when you are using a 32-bit JVM but the native library is 64-bit or vice versa. Make sure you use a 32-bit version of the native library if you have a 32-bit JVM, or a 64-bit native library when you have a 64-bit JVM.
 
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pooja: Find out whether your JVM is 32- or 64-bit. For 64-bit, add the following JARs to your classpath. For 32-bit, add the corresponding "*-windows-*x86.jar"s instead.
/javacv-bin/javacv.jar (this is the actual JavaCV API)
/javacv-bin/javacpp.jar (this is a general framework to load C++ native libraries into java)
/javacv-bin/javacv-windows-x86_64.jar (this contains all the JNI wrapper DLLs)
/javacv-cppjars/opencv-2.4.5-windows-x86_64.jar (this contains the actual OpenCV C++ DLLs)
/javacv-cppjars/ffmpeg-1.2-windows-x86_64.jar (this contains ffmpeg C++ DLLs)


Jesper, what you have said is correct, but javacv uses its own java-c++ bridge framework which packages native DLLs inside JARs and loads them as resources, instead of deploying them in a separate directory. So there's no need to specify java.library.path in this case; the bridge takes care of it.
 
Pooja Donekal
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanku for the replies. And sorry for replying back so late. The solutions were really helpful and I cleared off all the errors.
Can you please look into the link
http://fivedots.coe.psu.ac.th/~ad/jg/nui08/
This is the face recognition application I have been trying to implement. Cleared off all the errors, but can't really get the output.
Please help me out in this too.
Thanks in advance
 
Karthik Shiraly
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Pooja Donekal wrote:Cleared off all the errors, but can't really get the output.


There are prerequisites involved, such as training the system with your own facial datasets. What steps have you followed before running the code?
While I understand the urge to simply build pre-written code and hope it works, computer vision and face recognition are actually fun and interesting topics.
So I urge you to read and understand the PDFs on that site before proceeding.
 
Saloon Keeper
Posts: 7590
177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also see the 2nd post in https://coderanch.com/t/425530/md/Creating-yellow-line-televised-football#1886983 for something based on OpenCV and Processing.org
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic