Search code examples
c#kinect

Jointcollection for kinect SDK 2.0


I am now upgrading my Kinect program from SDK 1.8 to 2.0. In my old version, I used jointcollection very often. However, I do not now how can I rewrite the program without using this function. My example code is attached below:

    private static ResultUnit ProcessKneeLeft(JointCollection joints)
    {
        ResultUnit result = new ResultUnit();
        result.State = GetTrackingState(new Joint[] { joints[JointType.KneeLeft], joints[JointType.HipLeft], joints[JointType.AnkleLeft] });
        if (result.State != TrackingState.NotTracked)
            result.Value = VectorFunc.Angle(joints[JointType.KneeLeft].Position, joints[JointType.HipLeft].Position, joints[JointType.AnkleLeft].Position);
        return result;
    }

Please give me a hand. Thanks a lot! Sum


Solution

  • Joints is the new JointCollection for kinect for windows V2. In kinect for windows V2, Joints is a property of Body Class.