问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/34832590/get-jointtype-from-body-class-kinect