2017-05-31 2 views
0

Je ne sais vraiment pas ce que je fais de mal alors s'il vous plaît nu avec moi. Il y a quelques semaines, j'ai trouvé ce tutoriel sur la détection gestuelle de la main pour opencv et javacv. J'ai commencé à utiliser l'exemple mais j'ai continué à courir dans la même erreur encore et encore.Erreur lors du chargement d'un javacpp et javcv

Voici l'erreur:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no jniopencv_objdetect in java.library.path 
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1864) 
    at java.lang.Runtime.loadLibrary0(Runtime.java:870) 
    at java.lang.System.loadLibrary(System.java:1122) 
    at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:593) 
    at com.googlecode.javacpp.Loader.load(Loader.java:489) 
    at handDectector.Handy.<init>(Handy.java:32) 
    at handDectector.Handy.main(Handy.java:56) 
Caused by: java.lang.UnsatisfiedLinkError: no opencv_objdetect248 in java.library.path 
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1864) 
    at java.lang.Runtime.loadLibrary0(Runtime.java:870) 
    at java.lang.System.loadLibrary(System.java:1122) 
    at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:593) 
    at com.googlecode.javacpp.Loader.load(Loader.java:481) 

Je lis beaucoup de messages en ligne des problèmes connexes en ligne liés à cette question où les gens ont trouvé le même fichier javacpp et javacv. J'ai essayé de le faire à quelques reprises, mais ça n'a pas marché.

Voici le code:

package handDectector; 

import java.awt.*; 
import java.awt.event.*; 
import javax.swing.*; 

import org.opencv.core.Core; 

import java.io.*; 

import com.googlecode.javacv.*; 
import com.googlecode.javacv.cpp.*; 
import com.googlecode.javacpp.Loader; 



public class Handy extends JFrame 
{ 
    // GUI components 
private HandPanel handPanel; 


    public Handy() 
    { 
    super("Hand Detector"); 

    Container c = getContentPane(); 
    c.setLayout(new BorderLayout()); 


    // Preload the opencv_objdetect module to work around a known bug. 
    Loader.load(opencv_objdetect.class); 

    handPanel = new HandPanel(); // the webcam pictures and drums appear here 
    c.add(handPanel, BorderLayout.CENTER); 

    addWindowListener(new WindowAdapter() { 
     public void windowClosing(WindowEvent e) 
     { handPanel.closeDown(); // stop snapping pics, and any drum playing 
     System.exit(0); 
     } 
    }); 

    setResizable(false); 
    pack(); 
    setLocationRelativeTo(null); 
    setVisible(true); 
    } // end of Handy() 


    // ------------------------------------------------------- 

    public static void main(String args[]) 
    { 

    new Handy(); 

    } 

} // end of Handy class 

Le problème réside dans le fichier opencv_obj ne pas être présent.

Je n'ai pas beaucoup d'expérience avec cette bibliothèque. Est-ce possible si quelqu'un pouvait m'aider à résoudre le problème? Je suis sûr qu'il y a des posts sur github et stackoverflow sur le même problème ... Mais ils utilisent tous maven. Est-il possible de le faire sans maven?

Cordialement

Répondre

0

Ce link donne des instructions sur l'installation manuelle.

Cependant, je vous suggère fortement d'utiliser maven ou un outil de gestion des dépendances. Si vous insistez pour le faire manuellement, vous pouvez essayer d'ajouter toutes les dépendances listées dans la section dependencies dans ce link.