为 Kinect 定义跟踪区域

Defining a tracking area for the Kinect

是否可以指定一个(矩形)区域用于使用 Kinect 进行骨骼跟踪(使用任何可用的 SDK)?我想确保只跟踪指定区域内的用户,并且传感器不会被外面的人分散注意力。想一想一个游戏区,玩家在其中与 Kinect 互动,并且应该忽略该区域外的旁观者,以免他们混淆传感器。

我想要这个的原因是很多时候 Kinect "locks" 到某人甚至某物上,无论是否应该,然后传感器很难跟踪其他进入跟踪范围的人.我想通过定义这个区域来避免这种情况。

无法使用 Microsoft 的官方 SDK 为骨骼跟踪指定目标区域,但有一些潜在的解决方法。

(请注意,我不熟悉 Kinect 的其他 SDK,请注意,我不确定您使用的是 Kinect v1 还是 v2。)

如果您使用的是 Kinect v1,请注意它可以同时跟踪 6 个玩家(使用骨骼 body 位置),但它只能同时为 2 个玩家提供 full-body 骨骼跟踪时间。可以在官方 SDK 中指定您想要对哪 2 名玩家进行完整的骨骼追踪,您可以根据目标游戏区域中的骨骼来执行此操作。

如果这不是问题,问题是 Kinect(v1 或 v2)已经检测到 6 名玩家并且它无法检测到您游戏区中的第 7 个人,那么这更难题。使用官方 SDK,您无法控制选择跟踪哪 6 位玩家。传感器将锁定它找到的前 6 名玩家,因此如果第 7 名玩家走进来,则没有简单的方法可以锁定该玩家。

但是,有一些可能的解决方法涉及重置传感器以清除所有骨架到 re-select 6 个被跟踪的骨架(参见线程 Skeleton tracking in crowds - Kinect v2):

Kinect body tracking is always scanning and finding candidate bodies to track. The body tracking only locks on when it detects head and shoulders of the person facing the camera. You could do something like look for stable blob points in the target area and if there isn't a tracked body, reset the Kinect Monitor service.

The SDK is resilient to this type of failure of the runtime, but it is a hard approach. Additionally, you could employ a way to cover the depth camera (your hand) to reset the tracking since this will make all depth/ir invalid and will need to rebuild.

-- Carmine Sirignano - MSFT

在同一线程中,RobAcheson 指出重新启动传感器是另一种解决方法:

I've been using the by-hand method successfully for a while and that definitely works - when I'm in the crowd :)

I have started calling KinectSensor.Close() and KinectSensor.Open() when there are >6 skeletons if none are in the target area. That seems to be working well too. Now I just need a crowd to test with.

-- RobAcheson