diff -r a9ebacd6c089 -r fda26bfcabef middleware/Tracking/Gestures/GestureDetector.cs --- a/middleware/Tracking/Gestures/GestureDetector.cs Wed Apr 04 10:51:21 2012 +0200 +++ b/middleware/Tracking/Gestures/GestureDetector.cs Thu Apr 05 15:54:44 2012 +0200 @@ -27,11 +27,14 @@ using System.Text; using Microsoft.Kinect; using System.Drawing; +using Trakers.Debug; -namespace Trakers.MainModule.Gestures +namespace Trakers.Tracking.Gestures { public class GestureDetector { + public DebugWindow debug; + //Historique des positions du squelette. protected static List> history = new List>(); //protected JointCollection previousSkeleton; @@ -55,9 +58,9 @@ //Estimation du nombre de positions du squelette à vérifier dans l'historique. protected int indexesToCheck;// = gesturePeriod * indexesPerSecond; - public GestureDetector() + public GestureDetector(DebugWindow _debug) { - + debug = _debug; } //Setters. @@ -115,40 +118,5 @@ history.RemoveAt(0); } } - - /*public bool CheckForHandWave() - { - //Crée un historique de squelette local, puisque l'historique est mis à jour toutes les ~1/30 s. - List history = new List(history); - //Si il n'y a pas assez de positions dans l'historique local pour vérifier le geste. - if (history.Count < indexesToCheck) - return false; - - float refDistance = Math.Abs(history[0].Joints.ElementAt(spineID).Position.Y - history[0].Joints.ElementAt(hipCenterID).Position.Y); - float startPos = history[history.Count - indexesToCheck].Joints.ElementAt(handRightID).Position.X; - bool movedRight = false; - for (int i = history.Count - indexesToCheck + 1; i < history.Count; i++) - { - // Throughout the gesture period, right hand should be above theelbow, below the head and hand should be higher than the wrist - if (!(history[i].Joints[JointID.HandRight].Position.Y > history[i].Joints[JointID.ElbowRight].Position.Y + refDistance && - history[i].Joints[JointID.HandRight].Position.Y < history[i].Joints[JointID.Head].Position.Y && - history[i].Joints[JointID.HandRight].Position.Y > history[i].Joints[JointID.WristRight].Position.Y + refDistance / 4)) - { - return false; - } - // If the previous condition was met, check if the hand has moved to the right - if (history[i].Joints[JointID.HandRight].Position.X >= startPos + refDistance / 2 && !movedRight) - { - movedRight = true; - } - // If the hand did move to the right, check if it returned near the original position - if (movedRight && history[i].Joints[JointID.HandRight].Position.X <= startPos + refDistance / 5) - { - skeletonHistory.Clear(); - return true; - } - } - return false; - }*/ } }