none
How to get coordinates of a particular joint. RRS feed

  • Question

  • foreach (Joint joint in body.Joints.Values)
                                {
                                    JointType JT;

                                    if (joint.TrackingState == TrackingState.Tracked)
                                      {
                                        CameraSpacePoint jointPosition = joint.Position;
        Point point = new Point();

                                       ColorSpacePoint colorPoint = _sensor.CoordinateMapper.MapCameraPointToColorSpace(jointPosition);

                                            point.X = float.IsInfinity(colorPoint.X) ? 0 : colorPoint.X;
                                            point.Y = float.IsInfinity(colorPoint.Y) ? 0 : colorPoint.Y;
                                           if(this.JT==JointType.HandTipRight)

    {

    //My Code

    }

    }

    }


    Student of Software Engineering.

    Sunday, May 31, 2015 6:23 PM

Answers

  • If you just want to get the position of a known joint, you can get the joint by JointType without having to iterate over the joint collection:

    CameraSpacePoint rightHandTipPosition = 
        body.Joints[JointType.HandTipRight].Position;
    Monday, June 1, 2015 6:34 PM
    Moderator
  • I got it, colorPoint=_sensor.CoordinateMapper.MapCameraPointToColorSpace(rightHandTipPosition);

    Student of Software Engineering.

    • Marked as answer by Beaya Tuesday, June 2, 2015 7:43 AM
    Tuesday, June 2, 2015 7:43 AM

All replies

  • If you just want to get the position of a known joint, you can get the joint by JointType without having to iterate over the joint collection:

    CameraSpacePoint rightHandTipPosition = 
        body.Joints[JointType.HandTipRight].Position;
    Monday, June 1, 2015 6:34 PM
    Moderator
  • The 3D space points of CameraSpacePoint is not mapping onto a 2D ColorSpacePoint, how to map it?

    Student of Software Engineering.

    Tuesday, June 2, 2015 6:47 AM
  • I got it, colorPoint=_sensor.CoordinateMapper.MapCameraPointToColorSpace(rightHandTipPosition);

    Student of Software Engineering.

    • Marked as answer by Beaya Tuesday, June 2, 2015 7:43 AM
    Tuesday, June 2, 2015 7:43 AM