Azure Kinect 内置姿势识别 两种方法

这篇具有很好参考价值的文章主要介绍了Azure Kinect 内置姿势识别 两种方法。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

第一种方式:(适合单个姿势识别,多个场景多个姿势等复杂检测也可以实现,但是可能需要多创建几个类似脚本)

添加你要识别的内置姿势即可 

azure kinect动作检测,Azure Kinect,unity,c#,游戏引擎

 KinectManager 增加用户时添加个调用azure kinect动作检测,Azure Kinect,unity,c#,游戏引擎

  PoseDetector.Instance.UserWasAdded(userId, uidIndex);

随便放哪里,这里识别的 必须在面板上添加你要识别的姿势,这里才能判断出来

using com.rfilkov.kinect;
using System.Collections.Generic;
using UnityEngine;

public class PoseDetector : MonoBehaviour
{
    [Tooltip("List of the gestures to detect.")]
    public List<GestureType> detectGestures = new List<GestureType>();
    public static PoseDetector Instance;
    private void Awake()
    {
        Instance = this;
    }
    KinectGestureManager gestureManager;
    KinectManager manager;
    private void Start()
    {
        manager = KinectManager.Instance;
        gestureManager = KinectManager.Instance.gestureManager;
    }
    public void UserDetected(ulong userId, int userIndex)
    {
        foreach (GestureType gesture in detectGestures)
        {
            gestureManager.DetectGesture(manager.GetPrimaryUserID(), gesture);
        }
    }

    void Update()
    {
        if (manager.IsUserDetected(0))
        {
            // 伸手
            bool bPush = gestureManager.IsGestureComplete(manager.GetPrimaryUserID(), GestureType.Push, true);
            if (bPush)
            {
                Debug.Log("bPush");
            }
        }
    }

    internal void UserWasAdded(ulong userId, int uidIndex)
    {
        UserDetected(userId, uidIndex);
    }
}

第二种方式:(推荐用这种)

azure kinect动作检测,Azure Kinect,unity,c#,游戏引擎

需要内置的SimpleGestureListener.cs 脚本,你不用去考虑这个脚本是干啥的,怎么实现的(原理跟我第一种方式是同理,只是我把它简化了,删掉了无用的代码),只要在GestureCompleted()该方法中添加委托(该脚本一直运行,无需任何隐藏之类的操作)

public Action<GestureType> action;
        // invoked when a (discrete) gesture is complete.
        public bool GestureCompleted(ulong userId, int userIndex, GestureType gesture,
                                      KinectInterop.JointType joint, Vector3 screenPos)
        {
            if (userIndex != playerIndex)
                return false;

            if (progressDisplayed)
                return true;

            string sGestureText = gesture + " detected";
            Debug.Log(sGestureText);

            if (gestureInfo != null)
            {
                gestureInfo.text = sGestureText;
            }

            action?.Invoke(gesture);

            return true;
        }

在你需要的地方,监听委托即可 

using com.rfilkov.components;
using com.rfilkov.kinect;
using UnityEngine;

//[RequireComponent(typeof(SimpleGestureListener))]
public class GestureActionTest : MonoBehaviour
{
    public SimpleGestureListener gestureListener;
    void Start()
    {
        gestureListener.action += GestureHandle;
    }

    private void GestureHandle(GestureType type)
    {
        switch (type)
        {
            case GestureType.None:
                break;

            case GestureType.SwipeLeft:
                Debug.Log("SwipeLeft");
                break;

            case GestureType.SwipeRight:
                Debug.Log("SwipeRight");
                break;

            case GestureType.Push:
                Debug.Log("Push");
                break;
          
            default:
                break;
        }
    }

}

azure kinect动作检测,Azure Kinect,unity,c#,游戏引擎文章来源地址https://www.toymoban.com/news/detail-702507.html

到了这里,关于Azure Kinect 内置姿势识别 两种方法的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 史上最全Azure Kinect相关安装教程

    本教程旨在向无Azure Kinect开发经验的新手进行相关环境的安装。 https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/develop/docs/usage.md 安装 SDK 时,请记住要安装到的路径。 例如,“C:Program FilesAzure Kinect SDK 1.2”。 你将要在此路径中查找文章中参考的工具。此处建议按照默认位置安

    2024年02月07日
    浏览(30)
  • Azure kinect (二)项目创建和环境配置

    在此之前,你需要安装Microsoft Visual Studio,本人先使用的是2019版本,后转用2022版本,如版本问题对项目创建和环境配置产生影响,欢迎咨询。 新建一个C++空项目 创建完成后,将是以下界面,已经熟悉Visual Studio的朋友们可跳过, 右键项目,进入属性设置 在链接器 -- 输入 —

    2024年02月10日
    浏览(23)
  • Azure Kinect微软摄像头Unity开发小结

    Azure Kienct是微软的代替Kinect的摄像头,用处其实蛮多的,最近做了这个的一些开发,总结一下。 如果只是当普通摄像头用的话,有集成显卡就行了。如果要用人体跟踪,至少要1050的独显。 微软摄像头代的东西还不少,可以建立点云地图,但是没试过。 下面是官方的SDK。后面

    2024年02月04日
    浏览(41)
  • Unity 结合 Azure Kinect 开发体感游戏教程

    本教程将介绍如何使用 Unity 和 Azure Kinect SDK 开发体感游戏。我们将重点介绍环境安装和手势的实现。 1. 准备工作 确保你已经拥有以下硬件和软件: Azure Kinect DK 设备 Windows 10 Unity 2020或更高版本 Visual Studio 2019或更高版本 2. 安装 Azure Kinect SDK 访问 Azure Kinect DK 官方页面 并下载

    2024年02月03日
    浏览(33)
  • Azure Kinect DK + ROS1 Noetic使用教程

    作者: Herman Ye @Galbot @Auromix 版本: V1.0 测试环境: Ubuntu20.04 更新日期: 2023/08/16 注 1 : 本文内容中的硬件由 @Galbot 提供支持。 注 2 : @Auromix 是一个机器人爱好者开源组织。 注 3 : 本文在更新日期经过测试,确认有效。 可参考一键安装脚本,执行以下步骤,在Ubuntu18/20上安

    2024年02月13日
    浏览(27)
  • 多台Azure Kinect配准与三维重建点云融合

    提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 本文章讲解 多台Azure Kinect配准与三维重建点云融合 的相关理论及思路,相关代码将免费开源至github,敬请期待。 在进行多相机或者双相机的数据采集时,为了使得各相机所捕获的每一帧数据都是同一时

    2024年02月05日
    浏览(30)
  • Azure Kinect DK 在设备管理器找不到此设备

    参考 Azure Kinect DK 在设备管理器找不到此设备_Thomas_yx的博客-CSDN博客 type-c------------------type-c  接电脑,数据传输 圆------------------usb  电脑线  

    2024年02月17日
    浏览(35)
  • ubuntu20.04使用微软Azure Kinect DK 实现三维重建demo记录

    本文仅为在ubuntu20.04实现Azure Kinect DK 三维重建demo,此文记录实现过程仅供学习,同时为大家避坑,文中参考大量文章已列至末尾。 1 ros安装 2 安装微软 DK的sdk 3 ros之AzureKinect驱动 4 Azure Kinect DK 点云和RGBD图的获取 5 conda安装 6 Kinect DK 实现三维重建 1.1 安装源,添加sources.list 1

    2024年02月07日
    浏览(39)
  • Ubuntu 20.04 安装Azure Kinect SDK和ROS driver以及遇到k4a的报错

    这是我2022年2月22日的解决方案 git clone https://github.com/microsoft/Azure-Kinect-Sensor-SDK.git 详细要求看上面github的说明。接下来我只记载我在Ubuntu20.04的机器上运行的命令   curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc sudo apt-add-repository https://pack

    2024年02月04日
    浏览(29)
  • Azure Kinect DK点云实时可视化及图像点云按键交互存储(Open3D)

      Azure Kinect DK在python上的使用仍然很空白,开篇blog记录一下利用Open3D开发Kinect DK的笔记,内含利用Open3D对Azure Kinect DK相机读取的信息进行点云实时可视化及图像点云按键交互存储。   对官方的代码做些解读: main函数   代码首先是对argparse 模块的设置,argparse 模块可

    2024年02月05日
    浏览(27)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包