基于骨骼运动的 Kinect 3D 手势识别 - 存在哪些库?

发布于 2024-10-21 03:31:55 字数 167 浏览 6 评论 0原文

Kinect 有哪些手势识别库(如果有)?现在我正在使用 OpenNI 记录骨骼运动,但不确定如何从该运动到触发离散动作。

我的问题可能像姿势检测一样简单,但也可能像基于时间的运动一样复杂(即检测他们何时将手绕圈移动),具体取决于其难度。我见过的姿势检测示例非常特殊 - 这是因为通用算法很难正确执行吗?

What gesture recognition libraries (if any) exist for the Kinect? Right now I'm using OpenNI to record skeleton movements but am not sure how to go from that to triggering discrete actions.

My problem might be as simple as pose detection but it could also be as complicated as time based movements (ie. detect when they are moving their hand in a circle) depending on how difficult that is. The examples that I've seen for pose detection have been very ad-hoc - is this because a generic algorithm is difficult to do right?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

裂开嘴轻声笑有多痛 2024-10-28 03:31:55

NITE 库(在 OpenNI 之上)具有用于检测滑动和其他手势的类,但就我个人而言,我在 C# 中同时使用基本 OpenNI 和 NITE 库时遇到了麻烦(我一直遇到 AccessViolationExceptions)。如果您正在编写托管代码,则 XnVNITE.net.dll 具有滑动检测功能。安装 NITE 后,可以在 PrimeSense/NITE 文件夹下找到它。

如果您不需要骨架和用户识别,还可以使用 ManagedNite.dll 库,它是 PrimeSense NITE 安装附带的冗余库。 ManagedNite.dll 还具有手部/手势识别功能,但没有骨架/用户检测功能。

否则,您当然可以按照您的建议检测自己的基于时间的滑动手势。您应该能够使用如下函数检测一系列手点是否沿直线行进:

static bool DetectSwipe(Point3D[] points)
{
    int LineSize = 10; // number of points in the array to look at
    int MinXDelta = 300; // required horizontal distance
    int MaxYDelta = 100; // max mount of vertical variation

    float x1 = points[0].X;
    float y1 = points[0].Y;
    float x2 = points[last].X;
    float y2 = points[last].Y;

    if (Math.Abs(x1 - x2) < MinXDelta)
        return false;

    if (y1 - y2 > MaxYDelta)
        return false;

    for (int i = 1; i < LineSize - 2; i++)
    {
        if (Math.Abs((points[i].Y - y1)) > MaxYDelta)
            return false;

        float result =
            (y1 - y1) * points[i].X +
            (x2 - x1) * points[i].Y +
            (x1 * y2 - x2 * y1);

        if (result > Math.Abs(result))
        {
            return false;
        }
    }
    return true;
}

您可以增强此代码以检测左右滑动。我在上面的示例中也没有包含时间计算 - 您需要查看第一个点和最后一个点的时间,并确定滑动是否在一定时间内完成。

The NITE library (on top of OpenNI) has classes for detecting swipe and other gestures, but personally I've had trouble with using both the base OpenNI and NITE libraries together in C# (I keep running in to AccessViolationExceptions). If you're writing managed code, the XnVNITE.net.dll is what has the swipe detection. It's found under the PrimeSense/NITE folder after you install NITE.

If you can do without the skeleton and user recognition there is also the ManagedNite.dll library, which is a redundant library shipped with the PrimeSense NITE install. ManagedNite.dll also has hand/gesture recognition but no skeleton/user detection.

Otherwise, you can certainly detect your own time-based swipe gesture, as you suggested. You should be able to detect if a series of hand points travels in a straight line with a function like this:

static bool DetectSwipe(Point3D[] points)
{
    int LineSize = 10; // number of points in the array to look at
    int MinXDelta = 300; // required horizontal distance
    int MaxYDelta = 100; // max mount of vertical variation

    float x1 = points[0].X;
    float y1 = points[0].Y;
    float x2 = points[last].X;
    float y2 = points[last].Y;

    if (Math.Abs(x1 - x2) < MinXDelta)
        return false;

    if (y1 - y2 > MaxYDelta)
        return false;

    for (int i = 1; i < LineSize - 2; i++)
    {
        if (Math.Abs((points[i].Y - y1)) > MaxYDelta)
            return false;

        float result =
            (y1 - y1) * points[i].X +
            (x2 - x1) * points[i].Y +
            (x1 * y2 - x2 * y1);

        if (result > Math.Abs(result))
        {
            return false;
        }
    }
    return true;
}

You could enhance this code to detect for right vs. left swiping. I also did not include time computation in my example above - you would need to look at the time of the first and last point and determine if the swipe was completed within a certain amount of time.

以往的大感动 2024-10-28 03:31:55

看看这个:http://kinectrecognizer.codeplex.com/

支持 3D 跟踪和识别微调。也应该易于重复使用

check this out: http://kinectrecognizer.codeplex.com/

supports 3D tracking and recognition fine-tuning.. should be easy to reuse as well

海的爱人是光 2024-10-28 03:31:55

Softkinetic 看起来很有前途,但 SDK 尚未免费提供。

Softkinetic looks promising, but the SDK is not freely available just yet.

别挽留 2024-10-28 03:31:55

我正在为 kinect 开发独立的骨架检测代码。 http://code42tiger.blogspot.com

我打算免费发布它,但是我还有很长的路要走从完美开始。我想知道您的要求是否只是手部位置跟踪,您可以自己编写,甚至不需要使用 OpenNI 或任何其他库。如果您需要简单的提示,请阅读下文。

1)背景去除(在我的博客中有解释)
2) Blob 检测(选择要跟踪的人,也在博客中进行了解释)
3)手部跟踪(现在,当您在数据中只有用户时,您可以通过考虑距身体最远的点来轻松找到手部。)
4) 跟踪手部位置以检测手势。 (每隔几帧跟踪手部的一些计算将为您提供运动的几何形状)

这应该在 75% 的时间内有效(如果不是完美的话)。除非用户试图找出该算法的错误,否则它应该适用于普通用户。

I am working on a standalone skeleton detection code for kinect. http://code42tiger.blogspot.com

I am planning to release it for free, however I still have a long way to go from perfection. I am wondering if your requirement is only hand position tracking, you can write it yourself without even using OpenNI or any other library. If you need a simple tip, read below.

1) Background removal (explained in my blog)
2) Blob detection (to choose which person to track, also explained in blog)
3) Hand tracking (Now when you have the user alone in the data, you can find easily find the hand by considering the farthest point from the body.)
4) Track the hand position to detect gestures. (some calculation that tracks the hand every few frames will given you the geometry of the movement)

This should work (if not perfect) 75% of the time. Unless the user tries to find fault with the algo, it should work for normal users.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文