(三)Kinect姿势识别
Kinect给我们内置了许多姿势如举手等,具体可参考枚举KinectGestures.Gestures,也可以通过Kinect姿势管理器,自定义姿势导入(坑较多,内置的基本够用了)也可以根据关节坐标自己程序定义姿势。本节主要讲解内置姿势使用。
此部分可参考插件场景KinectGesturesDemo1和KinectGesturesDemo2,使用内置姿势只需要在自己的脚本中实现接口ModelGestureListener : MonoBehaviour, KinectGestures.GestureListenerInterface即可。参考脚本ModelGestureListener和CubeGestureListener
接口方法:
1)public void UserDetected(long userId, int userIndex)
通过此方法来注册检测的姿势,即对要检测的姿势进行定义
2)public void UserLost(long userId, int userIndex)
UserDetected中通过userIndex定义的用户丢失时执行此方法
3)public void GestureInProgress(long userId, int userIndex, KinectGestures.Gestures gesture,
float progress, KinectInterop.JointType joint, Vector3 screenPos)
姿势进行时激发方法
4)public bool GestureCompleted (long userId, int userIndex, KinectGestures.Gestures gesture,
KinectInterop.JointType joint, Vector3 screenPos)
当姿势完成时激活此方法
5)public bool GestureCancelled (long userId, int userIndex, KinectGestures.Gestures gesture,
KinectInterop.JointType joint)
当取消时激活此方法
注:通过代码自定义姿势时可以采用获取到的关节点screenPos来进行匹配,也可以通过joint来获取joint实际位置进行判断
最新文章
- InfoCube信息立方体的优化
- RichTextBox着色与着色不闪
- Sql Server 基础知识
- java 后台校验格式
- ModelState用法
- table 添加右键,并获取选中行信息
- 武汉科技大学ACM :1008: 小t和小w
- myeclipse 配置weblogic 异常
- java对excel表格上传和下载的处理方法
- 实现点击页面其他地方,隐藏div(原生和VUE)
- jenkins 关闭和重启的实现
- BZOJ1179或洛谷3672 [APIO2009]抢掠计划
- 【大数据】Scala学习笔记
- win32 数据类型 vs c#
- Git----02本地仓库进行文件添加&;修改&;删除&;查看
- OTL翻译(6) -- otl_connect类
- [OpenCV入门教程之十二】OpenCV边缘检测:Canny算子,Sobel算子,Laplace算子,Scharr滤波器合辑
- Elasticsearch之停用词
- 解决node-sass安装不了的问题
- Java 文件上传至leanCloud