I am currently in a Computer Vision course and for my final project I am going to make a small game that interacts with the Kinect.
Now I want to make this game in Java as I have never really ventured into making a game before and I am very comfortable with the Language. But I cannot seem to find a way to just access the Depth data (I just need to pack it into some Java Data structure) and the RGB data (same idea).
Right now, I have a way to 'talk' to the Kinect. I followed this tutorial and can detect the kinect using the command glview
in terminal.
I have a thing called Processing which promised to be a Java library to let me use the Kinect but it is using it's own language which is 'built' using Java so it's not really Java which means I can't use all the GUI and normal Java features.
What I want to do is somehow call some import random.Kinect.code;
at the top of the Java program that lets me use the most basic Kinect features, like getDepth() or getRGB() and do everything else in Java.
Does anyone know a way I can do this? (BTW I'm running MAC OSX Lion)
If you're using Processing I recommend using one of the available wrappers:
Both are well documented and include plenty of helpful examples.
I had exactly the same problem. I wanted to use Kinect in Java for my Computer Vision research, and I had a Mac OSX Lion like you. The solution that I found is to run a virtual copy of Windows 7 in my Mac (using VMWare or Parallels or Microsoft HyperV) and then use the open source J4K Java for Kinect library, which is a Java binding for the Kinect SDK using the Java Native Interface (JNI). Of course you can also use this open source library directly in computers that run Windows.
The J4K Java library for Kinect also has a tutorial on how to write a kinect based application in just 10 lines of Java code.
There are also several source code examples that shows you how to read depth, video, and skeleton data from the Kinect and use them in Java classes. You can also use multiple Kinects, animate avatars, and other examples. The link to the source code examples is here .
A screenshot of the open source Kinect Viewer, which is useful for Computer Vision applications like yours is below:
I hope that this information helped.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With