Using Kinect with JavaCV

223 views Asked by At

I'm trying to use the Kinect with JavaCV. I am trying to run this demo:

public static void main(String[] args) { 
    try{ 
        CanvasFrame frame = new CanvasFrame("Image Frame"); 
        OpenKinectFrameGrabber grabber = new OpenKinectFrameGrabber(0); 

        grabber.start();

        while (true) { 
            IplImage image = grabber.grab(); 
            frame.showImage(image); 
        } 

    }catch(Exception e){ 
        System.out.println(e.getMessage()); 
    }
} 

However I keep getting this error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no jnifreenect 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.freenect.<clinit>(freenect.java:10)
    at org.bytedeco.javacv.OpenKinectFrameGrabber.grabVideo(OpenKinectFrameGrabber.java:218)
    at org.bytedeco.javacv.OpenKinectFrameGrabber.grab(OpenKinectFrameGrabber.java:246)
    at javacv.KinectDemo.main(KinectDemo.java:27)
Caused by: java.lang.UnsatisfiedLinkError: C:\Users\15146049\AppData\Local\Temp\javacpp4757535499036509\jnifreenect.dll: Can't find dependent libraries
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(Unknown Source)
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.load0(Unknown Source)
    at java.lang.System.load(Unknown Source)
    at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:524)

I've made sure that all the jars have been added to the built path. I've checked the temp folder and both freenect.dll and jnifreenect.dll are there.

0

There are 0 answers