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实际位置进行判断

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值