什么不能获得骨骼关节? [英] what can't obtain skeleton joint ?

查看:65
本文介绍了什么不能获得骨骼关节?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我想更改  编码如下

I want to change the coding as follows

private void TrackClosestSkeleton()
  {
    if (this.kinect != null && this.kinect.SkeletonStream != null)
        {
        if (!this.kinect.SkeletonStream.AppChoosesSkeletons)
        {
        this.kinect.SkeletonStream.AppChoosesSkeletons = true; // Ensure AppChoosesSkeletons is set
        }

        float closestDistance = 10000f; // Start with a far enough distance
        int closestID = 0;

        foreach (Skeleton skeleton in this.skeletonData.Where(s => s.TrackingState != SkeletonTrackingState.NotTracked))
        {
        if (skeleton.Position.Z < closestDistance)
        {
          closestID = skeleton.TrackingId;
          closestDistance = skeleton.Position.Z;
        }
      }

      if (closestID > 0)
      {
        this.kinect.SkeletonStream.ChooseSkeletons(closestID); // Track this skeleton
      }
    }
  }

我想用骨架关节找到我喜欢的骨架,但是我无法在此代码中读取骨架的任何关节。

I want to use joints of skeleton to find the skeleton which i like, but I can't read any joints of skeleton in this code.

我尝试按如下方式更改代码:

I try to change the code as follows:

                            foreach (Skeleton skeleton1 in this.skeletonData.Where(s => s.TrackingState != SkeletonTrackingState.NotTracked))
                            {

                                var handrightPoint = skeleton1.Joints[JointType.HandRight];
                                double hand_Y = handrightPoint.Position.Y;

                                if (hand_Y > 0.1)
                                {
                                    closestID = skeleton1.TrackingId;
                                
                                }


                            }

我无法读取骨架的任何关节数据。 :(

I can't read any joints data of skeleton. :(

任何建议都是好的。




推荐答案

你得到的结果是什么?当你在var handrightPoint线上放一个断点时,调试器是否会进入应用程序?记住,v1那里只有2个被跟踪的物体才能获得完整的骷髅。除非你执行 this ,否则无法保证被跟踪的物体有任何
牌。
超高动力学 <跨度> <跨度> SkeletonStream <跨度> <跨度> ChooseSkeletons <跨度>( <跨度> c​​losestID );
//跟踪此骨架 行。您拥有的逻辑不会如果您有超过2人被跟踪,则可以工作。

What is the result you are getting? When you put a breakpoint on var handrightPoint line, does the debugger break into the app? Remember, v1 there are only 2 tracked bodies that get full skeletons. There is no guarantee that a body that is tracked has any hands unless you execute the this.kinect.SkeletonStream.ChooseSkeletons(closestID); // Track this skeleton line. The logic you have will not work if you have more than 2 people being tracked.

http: //msdn.microsoft.com/en-us/library/jj131025.aspx

您必须检查您是否正在根据骨架进行全身跟踪.TrackingSta te == SkeletonTrackingState.Tracked

You must check that your are getting full body tracking based on the skeleton.TrackingState == SkeletonTrackingState.Tracked


这篇关于什么不能获得骨骼关节?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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