public void Delete(Gesture gesture)
 {
     _recordedGestures.Remove(gesture);
 }
 /// <summary>
 /// Add a seqence with a label to the known sequences library.
 /// The gesture MUST start on the first observation of the sequence and end on the last one.
 /// Sequences may have different lengths.
 /// </summary>
 /// <param name="skeletnTimeSequence">The sequence</param>
 /// <param name="lab">Sequence name</param>
 public void AddOrUpdate(Gesture gesture)
 {
     var skeletonTimeSequence = gesture.JointRecords.ToDictionary(joint => joint.Id, joint => joint.Positions.ToList());
     _recordedGestures.Remove(gesture);
     /*
     var comparer = EnumComparer<JointID>.Instance;
     //Deep copy the time Sequence
     Dictionary<JointID, List<Vector4>> seqCopy = new Dictionary<JointID, List<Vector4>>(comparer);
     foreach (JointID joint in skeletonTimeSequence.Keys)
     {
         List<Vector4> newList = new List<Vector4>();
         foreach (Vector4 v in skeletonTimeSequence[joint])
         {
             Vector4 vClone = new Vector4(v.X, v.Y, v.Z, v.W);
             newList.Add(vClone);
         }
         seqCopy.Add(joint, newList);
     }
      * */
     _recordedGestures.Add(gesture, skeletonTimeSequence);
 }
Beispiel #3
0
 public void RemoveGesture(Gesture gesture)
 {
     dtw_.Delete(gesture);
 }
Beispiel #4
0
 public void AddOrUpdateGesture(Gesture gesture)
 {
     dtw_.AddOrUpdate(gesture);
 }
Beispiel #5
0
 public NuiEventArgs(Gesture gesture, int recordedFrameCount)
 {
     Gesture = gesture;
     RecordedFrameCount = recordedFrameCount;
 }
 void NuiProviderGestureDone(object sender, Nui.NuiEventArgs e)
 {
     if (!captureMode_)
     {
         var st = "Gesture recognized: " + e.Gesture.Name;
         if (e.Gesture == lastGesture_)
         {
             lastGestureCount_++;
             st += " (" + lastGestureCount_ + ")";
         }
         else
             lastGestureCount_ = 1;
         lastGesture_ = e.Gesture;
         StatusText = st;
     }
 }