public static void Configure(ICamera camera, GestureSensor gestureSensor) { var middleWidth = camera.ResolutionWidth / 2; var middleHeight = camera.ResolutionHeight / 2; var l = camera.LeftHand; var r = camera.RightHand; new GestureSlideLeft(l, middleWidth).SlideDetected += (s, a) => gestureSensor.OnSlideLeft(new GestureEventArgs("Left Hand Slide Left")); new GestureSlideRight(l, middleWidth).SlideDetected += (s, a) => gestureSensor.OnSlideRight(new GestureEventArgs("Left Hand Slide Right")); new GestureSlideUp(l, middleHeight).SlideDetected += (s, a) => gestureSensor.OnSlideUp(new GestureEventArgs("Left Hand Slide Up")); new GestureSlideDown(l, middleHeight).SlideDetected += (s, a) => gestureSensor.OnSlideDown(new GestureEventArgs("Left Hand Slide Down")); new GestureSlideLeft(r, middleWidth).SlideDetected += (s, a) => gestureSensor.OnSlideLeft(new GestureEventArgs("Right Hand Slide Left")); new GestureSlideRight(r, middleWidth).SlideDetected += (s, a) => gestureSensor.OnSlideRight(new GestureEventArgs("Right Hand Slide Right")); new GestureSlideUp(r, middleHeight).SlideDetected += (s, a) => gestureSensor.OnSlideUp(new GestureEventArgs("Right Hand Slide Up")); new GestureSlideDown(r, middleHeight).SlideDetected += (s, a) => gestureSensor.OnSlideDown(new GestureEventArgs("Right Hand Slide Down")); }
protected BaseCamera() { LeftHand = new Hand(Side.Left); RightHand = new Hand(Side.Right); _gestures = new GestureSensor(); _poses = new PoseSensor(); ImageStream = new ImageStream(); }
public FakeCamera() { LeftHand = new Hand(Side.Left); RightHand = new Hand(Side.Right); Face = new Face(null); Gestures = new GestureSensor(); Poses = new PoseSensor(); }
public static void Configure(ICamera camera, GestureSensor gestureSensor) { var middleWidth = camera.ResolutionWidth/2; var middleHeight = camera.ResolutionHeight/2; var l = camera.LeftHand; var r = camera.RightHand; new GestureSlideLeft(l, middleWidth).SlideDetected += (s, a) => gestureSensor.OnSlideLeft(new GestureEventArgs("Left Hand Slide Left")); new GestureSlideRight(l, middleWidth).SlideDetected += (s, a) => gestureSensor.OnSlideRight(new GestureEventArgs("Left Hand Slide Right")); new GestureSlideUp(l, middleHeight).SlideDetected += (s, a) => gestureSensor.OnSlideUp(new GestureEventArgs("Left Hand Slide Up")); new GestureSlideDown(l, middleHeight).SlideDetected += (s, a) => gestureSensor.OnSlideDown(new GestureEventArgs("Left Hand Slide Down")); new GestureSlideLeft(r, middleWidth).SlideDetected += (s, a) => gestureSensor.OnSlideLeft(new GestureEventArgs("Right Hand Slide Left")); new GestureSlideRight(r, middleWidth).SlideDetected += (s, a) => gestureSensor.OnSlideRight(new GestureEventArgs("Right Hand Slide Right")); new GestureSlideUp(r, middleHeight).SlideDetected += (s, a) => gestureSensor.OnSlideUp(new GestureEventArgs("Right Hand Slide Up")); new GestureSlideDown(r, middleHeight).SlideDetected += (s, a) => gestureSensor.OnSlideDown(new GestureEventArgs("Right Hand Slide Down")); }
protected Camera() { LeftHand = new Hand(Side.Left); RightHand = new Hand(Side.Right); _gestures = new GestureSensor(); _poses = new PoseSensor(); }
public void Configure(RealSenseCamera camera) { _camera = camera; camera.Manager.EnableHand(); using (var handModule = camera.Manager.QueryHand()) { using (var handConfig = handModule.CreateActiveConfiguration()) { //handConfig.EnableAllAlerts(); int numGestures = handConfig.QueryGesturesTotalNumber(); for (int i = 0; i < numGestures; i++) { string name; handConfig.QueryGestureNameByIndex(i, out name); Debug.WriteLine("Gestures: " + name); } handConfig.EnableAllGestures(); handConfig.SubscribeGesture(OnGesture); handConfig.EnableTrackedJoints(true); handConfig.ApplyChanges(); } } _sensor = (GestureSensor) camera.Gestures; GestureSlide.Configure(camera, (GestureSensor) camera.Gestures); }