Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get JointType from Body class Kinect

Tags:

c#

kinect

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?

like image 294
PTN Avatar asked Dec 03 '25 15:12

PTN


1 Answers

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.

like image 133
Vito Gentile Avatar answered Dec 07 '25 19:12

Vito Gentile