从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.
更多推荐
发布评论