/// <summary> /// Create a new instance of Gesture /// </summary> /// <param name="location">3Dpoint</param> /// <param name="joint">Joint must be in the location</param> /// <param name="sensor">Sensor to Maps a Skeleton to the screen</param> /// <param name="seconds">Seconds to maintain the position</param> /// <param name="tolerance">Tolerance of the error</param> public Gesture(SkeletonPoint location, JointType joint, KinectSensor sensor, float seconds, float tolerance = (float)0.15) { this.locations = new SkeletonPoint[1]; this.locations[0] = location; this.joints = new JointType[1]; this.joints[0] = joint; this.pens = new Pen[1]; this.pens[0] = new Pen(Brushes.Blue, 6); this.sensor = sensor; this.calculator = new Calculator(); this.screen_locations = new Point[1]; this.screen_locations[0] = calculator.SkeletonPointToScreen(sensor, locations[0]); this.seconds = seconds; this.tolerance = tolerance; initializeColors(); calculator = new Calculator(); }
/// <summary> /// Create a new instance of Gesture /// </summary> /// <param name="location">3Dpoint collection</param> /// <param name="joint">Joint collection must be in the location</param> /// <param name="sensor">Sensor to Maps a Skeleton to the screen</param> /// <param name="seconds">Seconds to maintain the position</param> /// <param name="tolerance">Tolerance of the error</param> public Gesture(SkeletonPoint[] locations, JointType[] joints, KinectSensor sensor, float seconds, float tolerance = (float)0.15) { this.locations = new SkeletonPoint[locations.Length]; this.locations = locations; this.joints = new JointType[joints.Length]; this.joints = joints; this.pens = new Pen[locations.Length]; this.calculator = new Calculator(); this.sensor = sensor; this.screen_locations = new Point[locations.Length]; for (int i = 0; i < locations.Length; i++) { this.screen_locations[i] = calculator.SkeletonPointToScreen(sensor,locations[i]); } this.seconds = seconds; this.tolerance = tolerance; initializeColors(); calculator = new Calculator(); }