public void Stop() { if (KinectAdapter == null || !KinectAdapter.IsRunning) { return; } KinectAdapter.ColorFrameReady -= KinectOnColorFrameReady; KinectAdapter.SkeletonFrameReady -= KinectOnSkeletonFrameReady; KinectAdapter.Stop(); }
private void KinectSensorsOnStatusChanged(object sender, StatusChangedEventArgs e) { if (KinectAdapter == null) { KinectAdapter = _kinectSensorAdapterFactory.GetFirstKinectSensor(); } else { if (e.Sensor.UniqueKinectId == KinectAdapter.UniqueKinectId && e.Status == KinectStatus.Disconnected) { KinectAdapter.Dispose(); KinectAdapter = null; } } OnKinectStatusChanged(e.Status); }
public void Start() { if (KinectAdapter == null || KinectAdapter.Status != KinectStatus.Connected) { return; } KinectAdapter.ColorFrameReady += KinectOnColorFrameReady; KinectAdapter.SkeletonFrameReady += KinectOnSkeletonFrameReady; KinectAdapter.ColorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30); if (_settings.SmoothingEnabled) { KinectAdapter.SkeletonStream.Enable(new TransformSmoothParameters { Smoothing = _settings.Smoothing, Correction = _settings.Correction, Prediction = _settings.Prediction, JitterRadius = _settings.JitterRadius, MaxDeviationRadius = _settings.MaxDeviationRadius }); } else { KinectAdapter.SkeletonStream.Enable(); } try { KinectAdapter.Start(); } catch (Exception) { Stop(); OnKinectStatusChanged(KinectStatus.Error); } }
private void InteractionStreamOnInteractionFrameReady(object sender, KinectAdapter.PhysicalRecognition.InteractiveGestureDetector.StringEventArgs dump) { tb.Text = dump.TextData; }