private void Window_Loaded(object sender, RoutedEventArgs e) { KinectSensor sensor = SensorExtensions.Default(); if (sensor != null) { sensor.EnableAllStreams(); sensor.ColorFrameReady += Sensor_ColorFrameReady; sensor.DepthFrameReady += Sensor_DepthFrameReady; sensor.SkeletonFrameReady += Sensor_SkeletonFrameReady; _gestureController = new GestureController(GestureType.All); _gestureController.GestureRecognized += GestureController_GestureRecognized; sensor.Start(); } }
public void Initialize(SettingsBase settings) //throws Exception { _kinectSensor = SensorExtensions.Default(); if (_kinectSensor != null) { _kinectSensor.EnableAllStreams(); _kinectSensor.ColorFrameReady += Sensor_ColorFrameReady; //sensor.DepthFrameReady += Sensor_DepthFrameReady; _kinectSensor.SkeletonFrameReady += Sensor_SkeletonFrameReady; _gestureController = new GestureController(GestureType.All); _gestureController.GestureRecognized += GestureController_GestureRecognized; _kinectSensor.Start(); } }
public MainWindow() { InitializeComponent(); this.DataContext = this; voltagePointCollection = new VoltagePointCollection(); updateCollectionTimer = new DispatcherTimer(); updateCollectionTimer.Interval = TimeSpan.FromMilliseconds(1000); updateCollectionTimer.Tick += new EventHandler(updateCollectionTimer_Tick); updateCollectionTimer.Start(); var ds = new EnumerableDataSource <VoltagePoint>(voltagePointCollection); ds.SetXMapping(x => dateAxis.ConvertToDouble(x.Date)); ds.SetYMapping(y => y.Voltage); plotter.AddLineGraph(ds, Colors.Green, 2, "SPEED"); // to use this method you need "using Microsoft.Research.DynamicDataDisplay;" MaxVoltage = 1; MinVoltage = -1; //After Initialization subscribe to the loaded event of the form Loaded += MainWindow_Loaded; //After Initialization subscribe to the unloaded event of the form //We use this event to stop the sensor when the application is being closed. Unloaded += MainWindow_Unloaded; if (sensor != null) { sensor.EnableAllStreams(); sensor.Start(); voiceController.SpeechRecognized += VoiceController_SpeechRecognized; // KinectSensor sensor = SensorExtensions.Default(); List <string> phrases = new List <string> { "Restart", "maggi" }; voiceController.StartRecognition(sensor, phrases); } }