Ejemplo n.º 1
0
 public static KinectBodyInternal BodyWithRightHandState(ulong id, TrackingConfidence confidence, HandState state)
 {
     var result = new KinectBodyInternal()
     {
         ClippedEdges = FrameEdges.None,
         HandLeftConfidence = TrackingConfidence.High,
         HandLeftState = HandState.NotTracked,
         HandRightConfidence = confidence,
         HandRightState = state,
         IsRestricted = false,
         IsTracked = true,
         JointOrientations = new JointOrientation[Microsoft.Kinect.Body.JointCount],
         Joints = FakeJoints.ValidRandomJoints(),
         LeanTrackingState = TrackingState.NotTracked,
         TrackingId = id
     };
     return result;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Converts body to it's internal representation
 /// </summary>
 /// <param name="body">Body to convert</param>
 /// <returns>Converted body</returns>
 public static KinectBodyInternal Convert(KinectBody body)
 {
     KinectBodyInternal result = new KinectBodyInternal()
     {
         ClippedEdges = body.ClippedEdges,
         HandLeftConfidence = body.HandLeftConfidence,
         HandLeftState = body.HandLeftState,
         HandRightConfidence = body.HandRightConfidence,
         HandRightState = body.HandRightState,
         IsRestricted = body.IsRestricted,
         IsTracked = body.IsTracked,
         JointOrientations = body.JointOrientations.Select(kvp => kvp.Value).ToArray(),
         Joints = body.Joints.Select(kvp => kvp.Value).ToArray(),
         Lean = body.Lean,
         LeanTrackingState = body.LeanTrackingState,
         TrackingId = body.TrackingId
     };
     return result;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Converts body to it's internal representation
        /// </summary>
        /// <param name="body">Body to convert</param>
        /// <returns>Converted body</returns>
        public static KinectBodyInternal Convert(KinectBody body)
        {
            KinectBodyInternal result = new KinectBodyInternal()
            {
                ClippedEdges        = body.ClippedEdges,
                HandLeftConfidence  = body.HandLeftConfidence,
                HandLeftState       = body.HandLeftState,
                HandRightConfidence = body.HandRightConfidence,
                HandRightState      = body.HandRightState,
                IsRestricted        = body.IsRestricted,
                IsTracked           = body.IsTracked,
                JointOrientations   = body.JointOrientations.Select(kvp => kvp.Value).ToArray(),
                Joints            = body.Joints.Select(kvp => kvp.Value).ToArray(),
                Lean              = body.Lean,
                LeanTrackingState = body.LeanTrackingState,
                TrackingId        = body.TrackingId
            };

            return(result);
        }
Ejemplo n.º 4
0
 public static KinectBodyInternal RandomBodySpine(ulong id, bool tracked, CameraSpacePoint cp)
 {
     var result = new KinectBodyInternal()
     {
         ClippedEdges = FrameEdges.None,
         HandLeftConfidence = TrackingConfidence.High,
         HandLeftState = HandState.NotTracked,
         HandRightConfidence = TrackingConfidence.High,
         HandRightState = HandState.NotTracked,
         IsRestricted = false,
         IsTracked = tracked,
         JointOrientations = new JointOrientation[Microsoft.Kinect.Body.JointCount],
         Joints = FakeJoints.ValidRandomJointsSpinePosition(cp),
         LeanTrackingState = TrackingState.NotTracked,
         TrackingId = id
     };
     return result;
 }