How can I access the Kinect using Java?

前端 未结 3 1211
梦如初夏
梦如初夏 2021-02-14 07:13

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

3条回答
  •  北恋
    北恋 (楼主)
    2021-02-14 07:39

    I will give you some ideas, but I admit - I did no try them with Kinect.
    You question can be categorized under questions of "How to access some hardware via Java". The tutorial you presented us presents libraries for accessing Kinect, and even wrappers for Python.
    What you can do is see how the Python code implemented the wrappers, and use either JNI/JNA to build your own wrappers.
    In addition, I looked into the JNect project, mentioned here in another answer, posted by @npinti.
    The eclipse plugin has two parts of it -
    the JNI code, which wraps theo riginal SDK code, and the Ecipse RCP code for the eclipse plugin itself.
    I would recommend you to ignore the Eclipse RCP part, and focus on their JNI implementation as a reference to what you need to develop your own JNI wrapper.
    Even if this is windows-based implementation (i.e - Kinect SDK works on windows, and you need to do run your code on mac, for example) - I think that by reading their code + some JNI tutorials + the python wrappers at the link you provided you will understand how to create a JNI wrapper to the library presented in the link you provided.
    In addition, consider using JNA and not JNI as a way to communicate with hardware, I find it easier.
    One last option is maybe to use the Java Script Engine and to invoke Python code (the python wrappers) from your java vode - not sure how much it will help you, but you can give it a shot.

提交回复
热议问题