如何在一定深度内检测骨架 [英] how to detect skeleton only within a certain depth

查看:133
本文介绍了如何在一定深度内检测骨架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找出如何在距离Kinect一定距离内检测骨架。我对SDK的理解是,自动骨架检测是我们无法访问的SDK原始代码的一部分,因此我们无法告诉kinect
只能在一定深度内查看骨架。我对吗? (虽然我真的需要这个功能)谢谢!

I am trying to figure out how to detect skeleton only within the certain distance away from Kinect. My understanding of the SDK is, auto skeleton detection is part of the origin code of the SDK which is not accessible to us, so we cannot tell the kinect to see skeleton only within a certain depth. Am I right? (Although I really need this feature) Thank you!

推荐答案

正确,SDK会如果在支持的深度范围内有多个可见,则自动选择要跟踪的骨架。如果您只需要在一个范围内检测骨架,则可以检查属于SkeletonFrame.Skeletons数组的骨架,其中
具有TrackingState == SkeletonTrackingState.Tracked。从跟踪的代码中,您可以编写代码来忽略平均位置(SkeletonData.Position)超出范围的SkeletonData对象。例如,在SkeletalViewer中修改nui_SkeletonFrameReady中的代码
C#sample:

Correct, the SDK will automatically choose which skeletons to track, if there are multiple visible in supported depth range. If you need to detect skeletons only within a range, you can examine skeletons that are part of SkeletonFrame.Skeletons array which have TrackingState == SkeletonTrackingState.Tracked. From the tracked ones you can write code to ignore SkeletonData objects whose average position (SkeletonData.Position) is outside of your range. E.g., modifying code from nui_SkeletonFrameReady in SkeletalViewer C# sample:


foreach (SkeletonData data in skeletonFrame.Skeletons)
{
    if (SkeletonTrackingState.Tracked == data.TrackingState && data.Position.Z >= ZMin && data.Position.Z <= ZMax)
    {
        // Your code here
    }
    iSkeleton++;
} // for each skeleton


这篇关于如何在一定深度内检测骨架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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