Giter Site home page Giter Site logo

Comments (9)

saudet avatar saudet commented on August 22, 2024

There is a simpler example here:
https://github.com/bytedeco/javacpp-presets/tree/master/flandmark
Let us know if you run into any problems with that one, thanks!

from javacv-examples.

henriquem avatar henriquem commented on August 22, 2024

I see !

But Don't you agree that I need an file .dll to solve this exception ?

Exception in thread "main" java.lang.UnsatisfiedLinkError: no jniflandmark in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:535)
at org.bytedeco.javacpp.Loader.load(Loader.java:410)
at org.bytedeco.javacpp.Loader.load(Loader.java:353)
at org.bytedeco.javacpp.flandmark.(flandmark.java:13)

This Exception ocurred when I tried to load the file model.dat in this simple line:
org.bytedeco.javacpp.flandmark.FLANDMARK_Model model =
org.bytedeco.javacpp.flandmark.flandmark_init.flandmark_init("C:/flandmark/data/model.dat");

I'm using the same library like your pom.xml:
...
org.bytedeco.javacpp-presets
flandmark
1.07-0.9


org.bytedeco.javacpp-presets
opencv
2.4.9-0.9


org.bytedeco
javacpp
0.9


org.bytedeco
javacv
0.9


org.bytedeco
opencv-windows-x86.jar
2.4.9
...

I don't know what I can to do :'(

from javacv-examples.

henriquem avatar henriquem commented on August 22, 2024

Follow the complete Exception

Exception in thread "main" java.lang.UnsatisfiedLinkError: no jniflandmark in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:535)
at org.bytedeco.javacpp.Loader.load(Loader.java:410)
at org.bytedeco.javacpp.Loader.load(Loader.java:353)
at org.bytedeco.javacpp.flandmark.(flandmark.java:13)

Caused by: java.lang.UnsatisfiedLinkError: no flandmark_static in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:535)
at org.bytedeco.javacpp.Loader.load(Loader.java:401)
... 4 more

from javacv-examples.

saudet avatar saudet commented on August 22, 2024

I follow the instructions, and it works just fine. To help you, I would need to reproduce the problem here on my machine. Please provide more details about what you are doing exactly.

from javacv-examples.

henriquem avatar henriquem commented on August 22, 2024

Ok. Thanks so much for your attention!

Firstly I did the download from http://cmp.felk.cvut.cz/~uricamic/flandmark/
I got the flandmark_v107.zip (latest zip from GitHub)

  • Descompressed at C:/flandmark
  • I already use opencv 2.4.9 and 2.4.8 ( I usually I use the 2.4.9)

I Noticed that when I extracted the flandmark, The structure of folders is:

  • data
  • examples
  • learning
  • libflandmark
  • matlab_toolbox
  • CMakeLists.txt
  • AUTHORS
  • INSTALL
  • LICENSE
  • README

Project JAVA
My libraries accorded as pom.xml :

M2_REPO/org/bytedeco/javacpp-presets/flandmark/1.07-0.9/flandmark-1.07-0.9.jar * not has .dll into this .jar, just has JNI class
M2_REPO/org/bytedeco/javacpp-presets/opencv/2.4.9-0.9/opencv-2.4.9-0.9.jar
M2_REPO/org/bytedeco/javacpp/0.9/javacpp-0.9.jar

The Simple Class
I simple class is bellow is enough to see the exception
public class SimpleExample {
public static void main(String[] args) {
org.bytedeco.javacpp.flandmark.FLANDMARK_Model model =
org.bytedeco.javacpp.flandmark.flandmark_init("C:/flandmark/data/model.dat");
}
}

When executed the method main :
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jniflandmark in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:535)
at org.bytedeco.javacpp.Loader.load(Loader.java:410)
at org.bytedeco.javacpp.Loader.load(Loader.java:353)
at org.bytedeco.javacpp.flandmark.(flandmark.java:13)
at SimpleExample.main(SimpleExample.java:5)
Caused by: java.lang.UnsatisfiedLinkError: no flandmark_static in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:535)
at org.bytedeco.javacpp.Loader.load(Loader.java:401)
... 3 more

I suppose that We needs the .dll files from flandmarks,
because when I downloaded flandmark, and came only source code in *.cpp

I struggled in generating files .dll from flandmarks_v107, But unsuccessful.

from javacv-examples.

saudet avatar saudet commented on August 22, 2024

How do you execute the main() method?

from javacv-examples.

henriquem avatar henriquem commented on August 22, 2024

I use simple command:
java SimpleExample.class
But I'm running by eclipse.
I know that I need to put the variable -Djava.library.path= ???

But My doubt is What the directory specific I need to put in this variable ?

I generated by Cmake-gui the c:/flandmark, And generated bellow is where build to binaries indicated by Cmake-gui, the results of generating is it:
C:\flandmark-bin

  • CMakeCache.txt
  • CMakeFiles
  • examples
  • libflandmark
  • matlab_toolbox
    C:\flandmark-bin\CMakeFiles
    • cmake.check_cache
    • CMakeGNUtoMS_lib.bat
    • CMakeOutput.log
    • CMakeTmp
      C:\flandmark-bin\CMakeFiles\3.0.1
    • CMakeCCompiler.cmake
    • CMakeCXXCompiler.cmake
    • CMakeDetermineCompilerABI_C.bin
    • CMakeDetermineCompilerABI_CXX.bin
    • CMakeRCCompiler.cmake
    • CMakeSystem.cmake
    • CompilerIdC
    • CompilerIdCXX
      C:\flandmark-bin\CMakeFiles\3.0.1\CompilerIdC
  • a.exe
  • CMakeCCompilerId.c
    C:\flandmark-bin\CMakeFiles\3.0.1\CompilerIdCXX
  • a.exe
  • CMakeCXXCompilerId.cpp
    C:\flandmark-bin\CMakeFiles\CMakeTmp
    C:\flandmark-bin\examples
  • CMakeFiles
  • face.jpg
  • flandmark_model.dat
  • groupphoto.jpg
  • haarcascade_frontalface_alt.xml
  • seq_bruges04_300frames.avi
    C:\flandmark-bin\examples\CMakeFiles
    C:\flandmark-bin\libflandmark
    • CMakeFiles
    • flandmarkConfig.cmake
      C:\flandmark-bin\libflandmark\CMakeFiles
      C:\flandmark-bin\matlab_toolbox
  • mex
    C:\flandmark-bin\matlab_toolbox\mex
    • CMakeFiles

Now, I dont know if I need to generate another compilation .dll files starting folders above, to After I can put something like variable java.library.path=C:/flandmark-bin/dlls ???

Could you clear my doubt, in detail ?
Thanks for your attention and patience!
I'm almost there !!!

Thks

from javacv-examples.

saudet avatar saudet commented on August 22, 2024

Ok so instead of using Eclipse, use Maven as shown in the simple example here and it will work:
https://github.com/bytedeco/javacpp-presets/tree/master/flandmark

from javacv-examples.

henriquem avatar henriquem commented on August 22, 2024

Thanks so much for your help !

I caught the jar flandmark-1.07-0.9-windows-x86.jar to solved the problem about JNI

Cheers

from javacv-examples.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.