基于骨骼运动的Kinect 3D手势识别-存在哪些库? [英] Kinect 3D gesture recognition based on skeleton movements - What libraries exist?

查看:220
本文介绍了基于骨骼运动的Kinect 3D手势识别-存在哪些库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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?

推荐答案

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

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.

如果您可以在没有骨架和用户识别的情况下进行操作,则还有ManagedNite.dll库,该库是PrimeSense NITE安装随附的冗余库. ManagedNite.dll也具有手/手势识别功能,但没有骨架/用户检测功能.

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.

这篇关于基于骨骼运动的Kinect 3D手势识别-存在哪些库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆