Kinect for Java
来源:互联网 发布:windows 鼠标样式 编辑:程序博客网 时间:2024/05/29 14:50
Kinect for windows 10月在中国发布。发布第二天通过京东Kinec我就到手了。
微软的Kinect for windows sdk 发现范例中只包含C#或VB语言开发的项目.
网络上开源的OpenNI仅支持Xbox 360 Kinect 不支持 PC Kinect.
现发布一个JAVA调用kinect for windows的一个工具包(JAVASE).
工具包实现了身体每个部位的监听和语言识别。
安装说明:
需要安装kinect for windows Runtime.
不支持Xbox 360 kinect.不支持OpenNI kinect驱动,仅支持微软的kinect驱动.
kinectbridge.jar中已经包含了所有身体部位的监听listener,在代码中只需注册相应部位的监听器即可.
压缩包内personImage.png是每个节点的名称供大家参考。
需要安装.NET framework4.0
代码中注释就不详细,范例代码有点乱别见怪.那是我从我的java kinect for mario游戏项目中直接抠出来的。^_^
现在分享给大家。
范例中部分代码:
public class Runner extends Thread{/** * @param args * @throws InterruptedException */public static void main(String[] args) throws InterruptedException {ManagerHelper.INSTANCEOF.openKinect();//开启kinectManagerHelper.INSTANCEOF.regsitListener();//注册监听器}}
package org;import org.base.SystemListener;import org.control.listener.HeadListener;import org.control.listener.LeftFootListener;import org.control.listener.LeftHandListener;import org.control.listener.LeftKneeListener;import org.control.listener.RightFootListener;import org.control.listener.RightHandListener;import org.control.listener.RightKneeListener;import org.cxy.kinect.KinectManager;import org.cxy.kinect.body.Body;public class ManagerHelper {public static ManagerHelper INSTANCEOF=new ManagerHelper();/** * 注册身体监控事件 */public void regsitListener(){KinectManager.INSTANCEOF.getBody().getHead().setPartChangeListener(new HeadListener());KinectManager.INSTANCEOF.getBody().getLeftFoot().setPartChangeListener(new LeftFootListener());KinectManager.INSTANCEOF.getBody().getLeftHand().setPartChangeListener(new LeftHandListener());KinectManager.INSTANCEOF.getBody().getRightFoot().setPartChangeListener(new RightFootListener());KinectManager.INSTANCEOF.getBody().getRightHand().setPartChangeListener(new RightHandListener());KinectManager.INSTANCEOF.getBody().getRightKnee().setPartChangeListener(new RightKneeListener());KinectManager.INSTANCEOF.getBody().getLeftKnee().setPartChangeListener(new LeftKneeListener());}public void openKinect(){SystemListener systemListener=new SystemListener();KinectManager.INSTANCEOF.openKinect(systemListener);KinectManager.INSTANCEOF.openBodyProcess();//开启身体监控进程}/** * 开启语言识别 * @param words 关键词 */public void openSpeech(String[]words){KinectManager.INSTANCEOF.openSpeechProcess(words);}public void stopKinect(){KinectManager.INSTANCEOF.stopKinect();}public Body getBody(){return KinectManager.INSTANCEOF.getBody();}}
/** * 监听类 * @author Administrator * */public class HeadListener implements PartChangeListener {@Overridepublic void notifyChanged(Part part) {System.out.println("头:Y:"+part.getY());float newy=(part.getY());if(newy<0){System.out.println("你跳了");}else{}}}
public class SystemListener implements KinectListener{@Overridepublic void kinectStarted() {System.out.println("kinect 启动");}@Overridepublic void kinectStoped() {System.out.println("kinect 停止");}@Overridepublic void onNotifyBody() {ControlCenter.INSTANCEOF.doWork();}@Overridepublic void onSpeechListened(String word) {System.out.println("你说:"+word);}}
范例和工具包下载地址:
http://download.csdn.net/detail/cxy1238/4757227
- Kinect for Java
- Kinect for Windows SDK
- Kinect for Windows (1)
- Kinect for Windows Samples
- kinect for untiy
- kinect for Unity开发
- Kinect for windows 1.0 vs Kinect for windows 2.0
- Kinect for windows SDK 开发
- Kinect for windows安装测试
- Kinect for Windows SDK 1.7
- Kinect for windows SDK 开发
- Kinect for Windows培训视频
- 什么是OpenNI?Kinect for PC
- MSDN--Kinect for Windows SDK
- kinect for windows - 初认识
- kinect for windows - 环境搭建
- Kinect for windows SDK 简介
- kinect for window相关资料
- 第12贴:晶体三极管
- 如何使用pyflakes给python做语法检查
- U3D 4.0 beta 的局限
- hibernate数据类型与OR映射
- Ubuntu 12.04LTS tftp服务搭建
- Kinect for Java
- To Be an Dream Architect(2010年ACM亚洲预选赛杭州赛区第三题))
- javac -d 和-classpath 用法 .
- https://github.com/enormego/cocoa-helpers
- 用python实现网络爬虫
- POJ2259-Team Queue
- adb push时提示read-only file system
- C#获取路径方法
- oracle数据库PL/SQL之包