0

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

但是当我坐在电脑前时,我有误报。Skeleton 的 kinect 松动轨迹,然后使用了错误的数据。

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需要在骨骼跟踪丢失后恢复。但我不知道如何检测?事实上,我得到了很多找到/丢失的值,这些值在正常情况下工作正常,但当我在 PC 前面时会触发误报。

即使处于跟踪状态,是否有一种智能方法来检测 Skeleton 是否完全错误?

4

2 回答 2

0

当 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 等于 head.Z (我假设算法只做 ax 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
于 2013-08-20T22:59:05.580 回答
0

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

  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;
  }

如果脚和头之间的距离是完全错误的,我认为骨架是错误的

于 2013-08-21T21:51:55.267 回答