Beispiel #1
0
 /// <summary>
 /// This suite consolidates all of the detectors to one suite
 /// so clients only have to add one overall detector to get all of the
 /// gestures
 /// </summary>
 public GestureSuite()
 {
     _circleDetector = new CircleGestureDetector();
     _swipeGestureRecognizer = new SwipeGestureDetector();
     _twoHandedDetector = new TwoHandedGestureDetector(_algorithmicPostureRecognizer);
     _circleDetector.OnGestureDetected += GestureDelegate;
     _swipeGestureRecognizer.OnGestureDetected += GestureDelegate;
     _twoHandedDetector.OnGestureDetected += GestureDelegate;
     _prevGesture = DateTime.MinValue;
 }
Beispiel #2
0
        private void Initialize()
        {
            if (kinectSensor == null)
                return;

            audioManager = new AudioStreamManager(kinectSensor.AudioSource);
            audioBeamAngle.DataContext = audioManager;

            kinectSensor.ColorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30);
            kinectSensor.ColorFrameReady += kinectRuntime_ColorFrameReady;

            kinectSensor.DepthStream.Enable(DepthImageFormat.Resolution640x480Fps30);
            kinectSensor.DepthFrameReady += kinectSensor_DepthFrameReady;

            kinectSensor.SkeletonStream.Enable(new TransformSmoothParameters
                                                   {
                                                 Smoothing = 0.5f,
                                                 Correction = 0.5f,
                                                 Prediction = 0.5f,
                                                 JitterRadius = 0.05f,
                                                 MaxDeviationRadius = 0.04f
                                             });
            kinectSensor.SkeletonFrameReady += kinectRuntime_SkeletonFrameReady;
            circleDetector = new CircleGestureDetector();
            circleDetector.OnGestureDetected += OnGestureDetected;
            circleDetector.OnGestureDetected += testingGestures;
            twoHandedDetector = new TwoHandedGestureDetector(algorithmicPostureRecognizer);
            twoHandedDetector.OnGestureDetected += OnGestureDetected;
            swipeGestureRecognizer = new SwipeGestureDetector();
            swipeGestureRecognizer.OnGestureDetected += OnGestureDetected;
            swipeGestureRecognizer.OnGestureDetected += testingGestures;

            skeletonDisplayManager = new SkeletonDisplayManager(kinectSensor, kinectCanvas);

            kinectSensor.Start();

            LoadLetterTPostureDetector();

            nuiCamera = new BindableNUICamera(kinectSensor);

            elevationSlider.DataContext = nuiCamera;

            voiceCommander = new VoiceCommander("record", "stop");
            voiceCommander.OrderDetected += voiceCommander_OrderDetected;

            StartVoiceCommander();

            kinectDisplay.DataContext = colorManager;
        }