Kinect手势识别:重置、恢复和准确性

本文关键字:恢复 准确性 重置 手势识别 Kinect | 更新日期: 2023-09-27 18:27:57

在一个程序中,我开发了一个接近本文的手势识别框架。

但当我坐在电脑前时,我有假阳性。骨骼的运动学轨迹松动,然后使用错误的数据。

1) 我试图过滤这种行为:

return sk.Joints[JointType.Head].TrackingState == JointTrackingState.Tracked
       && sk.Joints[JointType.WristLeft].TrackingState  == JointTrackingState.Tracked
       && sk.Joints[JointType.WristRight].TrackingState == JointTrackingState.Tracked
       && sk.Joints[JointType.HipLeft].TrackingState    == JointTrackingState.Tracked
       && sk.Joints[JointType.HipRight].TrackingState   == JointTrackingState.Tracked;

但即使我的关节不可见。Kinect猜测并跟踪错误的骨骼!

2) 我也试着玩TransformSmoothParameters,但没有任何变化(不知道最好的参数)。

3) 我还读到,Kinect需要在骨骼追踪丢失后恢复。但我不知道如何检测?事实上,我得到了很多查找/丢失的值,在正常情况下运行良好,但当我在电脑前时会触发误报。

有没有一种智能的方法可以检测Skeleton是否完全错误,即使它处于跟踪状态

Kinect手势识别:重置、恢复和准确性

当API松散跟踪Skeleton时,防止与Skeleton Stream未匹配的唯一方法是使用深度传感器。

var head   = sk.Joints[JointType.Head].Position;
var color  = Sensor.MapSkeletonPointToColor(head, ColorFormat);
var depth1 = Sensor.MapSkeletonPointToDepth(head, DepthFormat);
var depth2 = DepthPixels[color.X + color.Y * DepthW];

最后,

  1. depth1等于头。Z(我假设算法只做x 1000)
  2. depth2更准确,可以为0

参见日志:

Skeleton: 1,259978 Depth1: 1260 Depth2: 0
Skeleton: 1,259845 Depth1: 1260 Depth2: 0
Skeleton: 1,259783 Depth1: 1260 Depth2: 0
Skeleton: 1,259672 Depth1: 1260 Depth2: 0
Skeleton: 1,259808 Depth1: 1260 Depth2: 0
Skeleton: 1,256333 Depth1: 1256 Depth2: 1221
Skeleton: 1,25608 Depth1: 1256 Depth2: 1216
Skeleton: 1,255606 Depth1: 1256 Depth2: 1216
Skeleton: 1,24086 Depth1: 1241 Depth2: 0
Skeleton: 1,236984 Depth1: 1237 Depth2: 735
Skeleton: 1,233512 Depth1: 1234 Depth2: 725

因为有时它说1221,我也必须忽略depthFrame.MinDepth+X(对我来说MinDepth=800)下的所有内容

但有时它仍然很疯狂:

Skeleton: 2,898029 Depth1: 2898 Depth2: 3528 Min: 800
Skeleton: 2,901603 Depth1: 2902 Depth2: 3565 Min: 800
Skeleton: 2,902839 Depth1: 2903 Depth2: 3528 Min: 800

好的,所以我找到了一个更好的方法:

  bool track = sk.Joints[JointType.Head].TrackingState == JointTrackingState.Tracked
            && sk.Joints[JointType.WristLeft].TrackingState == JointTrackingState.Tracked
            && sk.Joints[JointType.WristRight].TrackingState == JointTrackingState.Tracked
            && sk.Joints[JointType.HipLeft].TrackingState == JointTrackingState.Tracked
            && sk.Joints[JointType.HipRight].TrackingState == JointTrackingState.Tracked;
  if (track) {
    var head   = sk.Joints[JointType.Head].Position;
    var kludge = sk.Joints[JointType.FootLeft].Position;
    var diff = Math.Abs(head.Y - kludge.Y) * 100;
    track = diff > 80;
  }

如果脚和头之间的距离完全错误,我假设骨架有缺陷