コード例 #1
0
        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"));
        }
コード例 #2
0
ファイル: BaseCamera.cs プロジェクト: mbahar94/SharpSenses
 protected BaseCamera() {
     LeftHand = new Hand(Side.Left);
     RightHand = new Hand(Side.Right);
     _gestures = new GestureSensor();
     _poses = new PoseSensor();
     ImageStream = new ImageStream();
 }
コード例 #3
0
ファイル: FakeCamera.cs プロジェクト: mbahar94/SharpSenses
 public FakeCamera() {
     LeftHand = new Hand(Side.Left);
     RightHand = new Hand(Side.Right);
     Face = new Face(null);
     Gestures = new GestureSensor();
     Poses = new PoseSensor();
 }
コード例 #4
0
ファイル: GestureSlide.cs プロジェクト: paulopine/SharpSenses
        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"));
        }
コード例 #5
0
ファイル: Camera.cs プロジェクト: paulopine/SharpSenses
 protected Camera()
 {
     LeftHand = new Hand(Side.Left);
     RightHand = new Hand(Side.Right);
     _gestures = new GestureSensor();
     _poses = new PoseSensor();
 }
コード例 #6
0
 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);
 }