如何使用Kinect SDK跟踪眼睛? [英] How to track eyes using Kinect SDK?

查看:143
本文介绍了如何使用Kinect SDK跟踪眼睛?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要求是在3D空间中的每只眼睛周围定义一个矩形. 应该有一种使用Microsoft Kinect SDK跟踪眼睛的方法. 根据

The requirement is to define a rectangle around each eye in 3D space. There should be a way to track eyes using the Microsoft Kinect SDK. According to this

面部跟踪SDK使用Kinect坐标系输出其 3D跟踪结果.原点位于相机的光学元件上 中心(传感器),Z轴指向用户,Y轴指向 向上.度量单位是米的平移度和度 旋转角度.

The Face Tracking SDK uses the Kinect coordinate system to output its 3D tracking results. The origin is located at the camera’s optical center (sensor), Z axis is pointing towards a user, Y axis is pointing up. The measurement units are meters for translation and degrees for rotation angles.

添加

...
Debug3DShape("OuterCornerOfRightEye", faceTrackFrame.Get3DShape()
    [FeaturePoint.OuterCornerOfRightEye]);
Debug3DShape("InnerCornerRightEye", faceTrackFrame.Get3DShape()
    [FeaturePoint.InnerCornerRightEye]);
Debug3DShape("InnerCornerLeftEye", faceTrackFrame.Get3DShape()
    [FeaturePoint.InnerCornerLeftEye]);
Debug3DShape("OuterCornerOfLeftEye", faceTrackFrame.Get3DShape()
    [FeaturePoint.OuterCornerOfLeftEye]);
...
private void Debug3DShape(string s, Vector3DF v)
{
    Debug.WriteLine(s + " X " + v.X + " Y " + v.Y + " Z " + v.Z);
}

到Microsoft.Kinect.Toolkit.FaceTracking打印中的CreateResult()

to CreateResult() in Microsoft.Kinect.Toolkit.FaceTracking prints

OuterCornerOfRightEye X -0.05728126 Y 0.04850625 Z -0.1144406
InnerCornerRightEye X -0.01584376 Y 0.04850625 Z -0.1279687
InnerCornerLeftEye X 0.01584374 Y 0.04850625 Z -0.1279687
OuterCornerOfLeftEye X 0.05728124 Y 0.04850625 Z -0.1144406

当SDK开始跟踪人脸时. 我应该能够使用这些坐标在每只眼睛周围画一个盒子,但是 Z坐标可能应该更接近1.0,而不是-0.1 ..或-0.2 ..(根据我的设置),因此我不相信这些数字. XYZ是否应该是FeaturePoint在3D空间中相对于传感器的位置? 我会误解Kinect坐标系吗? 我是否正确使用Kinect SDK? 我使用Xbox 360 Kinect传感器有关系吗? (Microsoft不保证与Kinect for Windows应用程序和Xbox 360 Kinect Sensor完全兼容)

when the SDK starts tracking a face. I should be able to use these coordinates to paint a box around each eye but the Z coordinate should probably be closer to 1.0, not -0.1.. or -0.2.. (based on my setup) so I don't trust the numbers. Is the XYZ supposed to be the location of the FeaturePoint in 3D space relative to the sensor? Do I misunderstand the Kinect coordinate system? Am I using the Kinect SDK incorrectly? Does it matter that I am using an Xbox 360 Kinect Sensor? (Microsoft does not guarantee full compatibility for Kinect for Windows applications and the Xbox 360 Kinect Sensor)

修改:添加此

if (trackSucceeded) {
    ...
    if (headPointsObj != null) 
        for (int i = 0; i < 2; i++) 
            DebugHeadPoint(i, headPointsObj.Points);
}
private void DebugHeadPoint(int i, Vector3DF[] points) {
    if (points == null) throw new ArgumentNullException("points");
    Debug.WriteLine("HeadPoint[" + i + "] X " + points[i].X + 
        " Y " + points[i].Y + 
        " Z " + points[i].Z);
}

到FaceTracker.cs :: Track()会打印出

to FaceTracker.cs::Track() prints this

HeadPoint[0] X 0.01227657 Y -0.2290326 Z 1.319978
HeadPoint[1] X 0.00613283 Y -0.02143053 Z 1.280334
HeadPoint[0] X 0.003939687 Y -0.2297621 Z 1.319813
HeadPoint[1] X -0.003732742 Y -0.02388078 Z 1.277723
...

根据设置,这些数字似乎正确. FeaturePoints仅打印一次,但HeadTracks在trackSucceeded期间连续打印. FeaturePoint值是相对于HeadPoint的吗?

These numbers seem correct based on the setup. The FeaturePoints print only once but the HeadPoints print continuously while trackSucceeded. Are FeaturePoint values relative to the HeadPoint?

推荐答案

根据我们在MSDN论坛上的交谈:

Per our conversation on MSDN forums:

http://social.msdn.microsoft.com/Forums/en-US/93046062-05fe-4beb-9d69-94a4f004fb7b/how-to-track-eyes-using-kinect

这篇关于如何使用Kinect SDK跟踪眼睛?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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