从Body类Kinect获取JointType(Get JointType from Body class Kinect)

编程入门 行业动态 更新时间:2024-10-24 15:17:55
从Body类Kinect获取JointType(Get JointType from Body class Kinect)

我知道在旧的SDK中,有一个Skeleton类,你可以做类似的事情

public void Compare(Skeleton skeleton) { var leftShoulderPosition = skeleton.Joints.Where(j => j.JointType == JointType.ShoulderLeft); }

但是,新的SDK出来了, Skeleton类被Body类取代。 现在,代码在j.JointType抛出错误。

这个问题有解决方法吗?

I know in the old SDK, there was a Skeleton class and you can do something like

public void Compare(Skeleton skeleton) { var leftShoulderPosition = skeleton.Joints.Where(j => j.JointType == JointType.ShoulderLeft); }

However, the new SDK came out and the Skeleton class is replaced by the Body class. Now, the code is throwing an error at j.JointType.

Is there a workaround for this problem?

最满意答案

使用Microsoft Kinect SDK v2.0,您可以获得ShoulderLeft关节(以及类似地,任何其他骨架关节),如下所示:

body.Joints[JointType.ShoulderLeft]

其中body是您引用的Body类的实例。

With Microsoft Kinect SDK v2.0, you can get the ShoulderLeft joint (and, similarly, any other skeletal joint) as follows:

body.Joints[JointType.ShoulderLeft]

where body is an instance of the Body class to which you refer.

更多推荐

本文发布于:2023-07-31 02:44:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1340459.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Kinect   Body   class   JointType

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!