public TemplatedGestureDetector(string gestureName, Stream kbStream, int windowSize = 60) : base(windowSize) { if (gestureName == "Triangle") { Epsilon = 0.030f; // 0.035 -> 0.045 MinimalScore = 0.358f; // 0.348 -> 0.400 MinimalSize = 0.2f; // 0.2 -> 0.1 this.gestureName = gestureName; learningMachine = new LearningMachine(kbStream); //조져야할 부분 --> Success } else if (gestureName == "Circle") { Epsilon = 0.035f; MinimalScore = 0.80f; //0.80 -> 0.75 MinimalSize = 0.1f; this.gestureName = gestureName; learningMachine = new LearningMachine(kbStream); } else { Epsilon = 0.035f; MinimalScore = 0.80f; //0.80 -> 0.75 MinimalSize = 0.1f; this.gestureName = gestureName; learningMachine = new LearningMachine(kbStream); } }
public TemplatedGestureDetector(string gestureName, Stream kbStream, int windowSize = 60) : base(windowSize) { Epsilon = 0.035f; MinimalScore = 0.80f; MinimalSize = 0.1f; this.gestureName = gestureName; learningMachine = new LearningMachine(kbStream); }
public TemplatedPostureDetector(string postureName, Stream kbStream) : base(4) { this.postureName = postureName; learningMachine = new LearningMachine(kbStream); MinimalScore = 0.95f; MinimalSize = 0.1f; Epsilon = 0.02f; }
protected override void LookForGesture() { // Swipe to right //if (ScanPositions((p1, p2) => Math.Abs(p2.Y - p1.Y) < SwipeMaximalHeight, // Height // (p1, p2) => p2.X - p1.X > -0.01f, // Progression to right // (p1, p2) => Math.Abs(p2.X - p1.X) > SwipeMinimalLength, // Length // SwipeMininalDuration, SwipeMaximalDuration)) // Duration //{ // RaiseGestureDetected("SwipeToRight"); // return; //} //// Swipe to left //if (ScanPositions((p1, p2) => Math.Abs(p2.Y - p1.Y) < SwipeMaximalHeight, // Height // (p1, p2) => p2.X - p1.X < 0.01f, // Progression to right // (p1, p2) => Math.Abs(p2.X - p1.X) > SwipeMinimalLength, // Length // SwipeMininalDuration, SwipeMaximalDuration))// Duration //{ // RaiseGestureDetected("SwipeToLeft"); // return; //} //CONSIDERING DURATION OF GESTURE //if (LearningMachine.Match(Entries.Select(e => new Vector2(e.Position.X, e.Position.Y)).ToList(), Epsilon, MinimalScore, MinimalSize)) //{ // System.Console.WriteLine("Sit/Stand DETECTED --------------------SwipeMinimalLength:" + SwipeMinimalLength); // // Sitting // if (ScanPositions(//(p1, p2) => Math.Abs(p2.Y - p1.Y) < SwipeMaximalHeight, // Height // (p1, p2) => p2.Y - p1.Y > -0.01f, // Progression up // (p1, p2) => Math.Abs(p2.X - p1.X) > SwipeMinimalLength, // Length // SwipeMininalDuration, SwipeMaximalDuration)) // Duration // { // RaiseGestureDetected("Sit"); // return; // } // // Standing // if (ScanPositions(//(p1, p2) => Math.Abs(p2.Y - p1.Y) < SwipeMaximalHeight, // Height // (p1, p2) => p2.Y - p1.Y < 0.01f, // Progression down // (p1, p2) => Math.Abs(p2.X - p1.X) > SwipeMinimalLength, // Length // SwipeMininalDuration, SwipeMaximalDuration))// Duration // { // RaiseGestureDetected("Stand"); // return; // } //} if (LearningMachine.Match(Entries.Select(e => new Vector2(e.Position.X, e.Position.Y)).ToList(), Epsilon, MinimalScore, MinimalSize)) { System.Console.WriteLine("Sit/Stand DETECTED --------------------SwipeMinimalLength:" + SwipeMinimalLength); // Sitting if (ScanPositions( //(p1, p2) => Math.Abs(p2.Y - p1.Y) < SwipeMaximalHeight, // Height (p1, p2) => p2.Y - p1.Y > -0.01f, // Progression up (p1, p2) => Math.Abs(p2.X - p1.X) > SwipeMinimalLength, // Length SwipeMininalDuration, SwipeMaximalDuration)) // Duration { RaiseGestureDetected("Sit"); return; } // Standing if (ScanPositions( //(p1, p2) => Math.Abs(p2.Y - p1.Y) < SwipeMaximalHeight, // Height (p1, p2) => p2.Y - p1.Y <0.01f, // Progression down (p1, p2) => Math.Abs(p2.X - p1.X)> SwipeMinimalLength, // Length SwipeMininalDuration, SwipeMaximalDuration)) // Duration { RaiseGestureDetected("Stand"); return; } } }
public TemplatedPostureDetector(string postureName, Stream kbStream) : base(4) { this.postureName = postureName; learningMachine = new LearningMachine(kbStream); }
public TemplatedGestureDetector(string gestureName, Stream kbStream, int windowSize = 60) : base(windowSize) { this.gestureName = gestureName; learningMachine = new LearningMachine(kbStream); }