private void Start() { this.Cursor = Cursors.Wait; this.checkClusterLayer.IsEnabled = true; this.checkHandLayer.IsEnabled = true; this.factory = new SDKDataSourceFactory(); this.clusterDataSource = this.factory.CreateClusterDataSource(new ClusterDataSourceSettings { MaximumDepthThreshold = 1000 }); this.handDataSource = new HandDataSource(this.factory.CreateShapeDataSource(this.clusterDataSource, new Core.Shape.ShapeDataSourceSettings())); //this.rgbImageDataSource = this.factory.CreateRGBImageDataSource(); //this.rgbImageDataSource.Start(); var depthImageSource = this.factory.CreateDepthImageDataSource(); depthImageSource.NewDataAvailable += new NewDataHandler <ImageSource>(MainWindow_NewDataAvailable); depthImageSource.Start(); handDataSource.Start(); //this.mouseController = new MouseController(handDataSource,true); this.Cursor = Cursors.Arrow; handDataSource.NewDataAvailable += new NewDataHandler <HandCollection>(handDataSource_NewDataAvailable); }
private void Start() { this.Cursor = Cursors.Wait; this.buttonHandInterface.IsEnabled = true; this.buttonManipulation.IsEnabled = true; this.buttonRectangleVideo.IsEnabled = true; this.buttonTouch.IsEnabled = true; this.checkClusterLayer.IsEnabled = true; this.checkHandLayer.IsEnabled = true; this.radioKinectSDK.IsEnabled = false; this.radioOpenNI.IsEnabled = false; if (this.radioKinectSDK.IsChecked.GetValueOrDefault()) { this.factory = new SDKDataSourceFactory(); } else { this.factory = new OpenNIDataSourceFactory("config.xml"); } this.clusterDataSource = this.factory.CreateClusterDataSource(new Core.Clustering.ClusterDataSourceSettings { MaximumDepthThreshold = 900 }); this.handDataSource = new HandDataSource(this.factory.CreateShapeDataSource(this.clusterDataSource, new Core.Shape.ShapeDataSourceSettings())); this.rgbImageDataSource = this.factory.CreateRGBImageDataSource(); this.rgbImageDataSource.Start(); var depthImageSource = this.factory.CreateDepthImageDataSource(); depthImageSource.NewDataAvailable += new NewDataHandler<ImageSource>(MainWindow_NewDataAvailable); depthImageSource.Start(); handDataSource.Start(); this.Cursor = Cursors.Arrow; }
private void Start() { this.Cursor = Cursors.Wait; this.checkClusterLayer.IsEnabled = true; this.checkHandLayer.IsEnabled = true; this.factory = new SDKDataSourceFactory(); this.clusterDataSource = this.factory.CreateClusterDataSource(new ClusterDataSourceSettings { MaximumDepthThreshold = 1000 }); this.handDataSource = new HandDataSource(this.factory.CreateShapeDataSource(this.clusterDataSource, new Core.Shape.ShapeDataSourceSettings())); //this.rgbImageDataSource = this.factory.CreateRGBImageDataSource(); //this.rgbImageDataSource.Start(); var depthImageSource = this.factory.CreateDepthImageDataSource(); depthImageSource.NewDataAvailable += new NewDataHandler<ImageSource>(MainWindow_NewDataAvailable); depthImageSource.Start(); handDataSource.Start(); //this.mouseController = new MouseController(handDataSource,true); this.Cursor = Cursors.Arrow; handDataSource.NewDataAvailable += new NewDataHandler<HandCollection>(handDataSource_NewDataAvailable); }
private void Start() { // initialize sensor Microsoft Kinect SDK sensor = Microsoft.Kinect.KinectSensor.KinectSensors.FirstOrDefault(); sensor.Start(); sensor.ElevationAngle = 13; // initialize some element this.Cursor = Cursors.Wait; this.factory = new SDKDataSourceFactory(); this.clusterDataSource = this.factory.CreateClusterDataSource(new Core.Clustering.ClusterDataSourceSettings { MaximumDepthThreshold = 900 }); this.handDataSource = new HandDataSource(this.factory.CreateShapeDataSource(this.clusterDataSource, new Core.Shape.ShapeDataSourceSettings())); var depthImageSource = this.factory.CreateDepthImageDataSource(); depthImageSource.NewDataAvailable += new NewDataHandler <ImageSource>(MainWindow_NewDataAvailable); handDataSource.NewDataAvailable += new NewDataHandler <HandCollection>(handDataSource_NewDataAvailable); HandInterfaceWindow(this.handDataSource, depthImageSource); //new HandInterfaceWindow(this.handDataSource, this.rgbImageDataSource).Show(); depthImageSource.Start(); handDataSource.Start(); this.Cursor = Cursors.Arrow; }
private void Start() { this.Cursor = Cursors.Wait; this.buttonHandInterface.IsEnabled = true; this.buttonManipulation.IsEnabled = true; this.buttonRectangleVideo.IsEnabled = true; this.buttonTouch.IsEnabled = true; this.checkClusterLayer.IsEnabled = true; this.checkHandLayer.IsEnabled = true; this.radioKinectSDK.IsEnabled = false; this.radioOpenNI.IsEnabled = false; if (this.radioKinectSDK.IsChecked.GetValueOrDefault()) { this.factory = new SDKDataSourceFactory(); } else { this.factory = new OpenNIDataSourceFactory("config.xml"); } this.clusterDataSource = this.factory.CreateClusterDataSource(new Core.Clustering.ClusterDataSourceSettings { MaximumDepthThreshold = 900 }); this.handDataSource = new HandDataSource(this.factory.CreateShapeDataSource(this.clusterDataSource, new Core.Shape.ShapeDataSourceSettings())); this.rgbImageDataSource = this.factory.CreateRGBImageDataSource(); this.rgbImageDataSource.Start(); var depthImageSource = this.factory.CreateDepthImageDataSource(); depthImageSource.NewDataAvailable += new NewDataHandler <ImageSource>(MainWindow_NewDataAvailable); depthImageSource.Start(); handDataSource.Start(); this.Cursor = Cursors.Arrow; }
public HandInterfaceWindow(IHandDataSource handDataSource, IImageDataSource imageDataSource) : this() { //var brush = new SolidColorBrush(Color.FromArgb(160, 255, 255, 255)); var brush = new SolidColorBrush(Color.FromArgb(0, 255, 255, 255));// transparent this.element = new HandInterfaceElement(); element.CharEnter += new System.Timers.ElapsedEventHandler(element_Tick); element.Reset += new EventHandler(element_Reset); this.canvas.Children.Add(element); this.label = CreateLabel("Please identify...", brush, 50, 50); this.labelCode = CreateLabel("", brush, 50, 80); this.labelAccess = CreateLabel("", brush, 50, 110); this.textBlock = new TextBlock(); textBlock.TextWrapping = TextWrapping.Wrap; textBlock.Text = string.Empty; this.labelData = CreateLabel(textBlock, brush, 50, 140); this.labelData.MaxWidth = 540; this.labelData.MaxHeight = 320; handDataSource.NewDataAvailable += new NewDataHandler<HandCollection>(handDataSource_NewDataAvailable); imageDataSource.NewDataAvailable += new NewDataHandler<ImageSource>(imageDataSource_NewDataAvailable); }
private void Start() { _checkClusterLayer.IsEnabled = true; _checkClusterLayer.IsChecked = true; _checkHandLayer.IsEnabled = true; _checkHandLayer.IsChecked = true; _factory = new SDKDataSourceFactory(); _depthImageSource = _factory.CreateDepthImageDataSource(); _depthImageSource.NewDataAvailable += new NewDataHandler <ImageSource>(MainWindow_NewDataAvailable); _depthImageSource.Start(); _clusterDataSource = _factory.CreateClusterDataSource(new ClusterDataSourceSettings { MaximumDepthThreshold = 900 }); _clusterDataSource.NewDataAvailable += new NewDataHandler <ClusterCollection>(ClusterDataSource_NewDataAvailable); _clusterDataSource.Start(); _handDataSource = new HandDataSource(_factory.CreateShapeDataSource(_clusterDataSource, new ShapeDataSourceSettings())); _handDataSource.NewDataAvailable += new NewDataHandler <HandCollection>(HandDataSource_NewDataAvailable); _handDataSource.Start(); UpdateLayers(); }
//This function starts the communcation between the Candescent NUI library with the Kinect device. private void Start() { //Specifies that the Kinect device is in not in Near Mode this.factory = new SDKDataSourceFactory(useNearMode: false); //This specifies the minimum and maximum depth threshold that the Kinect will use to find hands. this.clusterDataSource = this.factory.CreateClusterDataSource(new Core.Clustering.ClusterDataSourceSettings { MaximumDepthThreshold = 1000 }); this.handDataSource = new HandDataSource(this.factory.CreateShapeDataSource(this.clusterDataSource, new Core.Shape.ShapeDataSourceSettings())); //This will output the display of the video feed in depth mode var depthImageSource = this.factory.CreateDepthImageDataSource(); depthImageSource.NewDataAvailable += new NewDataHandler <ImageSource>(MainWindow_NewDataAvailable); depthImageSource.Start(); handDataSource.Start(); handDataSource.NewDataAvailable += new NewDataHandler <HandCollection>(handDataSource_NewDataAvailable); //This add a layer and paint any detected hands in the colour green with a white dot for detected palms and purple dots for each finger tip detected. var layers = new List <IWpfLayer>(); layers.Add(new WpfHandLayer(this.handDataSource)); this.videoControl.Layers = layers; }
private void CreateControllerInTrackingMode() { this.handDataSource = new HandDataSource(this.factory.CreateShapeDataSource(this.trackingClusterDataSource)); this.mouseController = new MouseController(this.handDataSource, this.trackingClusterDataSource); this.mouseController.Enabled = this.buttonToggle.IsChecked.Value; this.handDataSource.Start(); }
public HandInterfaceWindow(IHandDataSource handDataSource, IImageDataSource imageDataSource) : this() { //var brush = new SolidColorBrush(Color.FromArgb(160, 255, 255, 255)); var brush = new SolidColorBrush(Color.FromArgb(0, 255, 255, 255));// transparent this.element = new HandInterfaceElement(); element.CharEnter += new System.Timers.ElapsedEventHandler(element_Tick); element.Reset += new EventHandler(element_Reset); this.canvas.Children.Add(element); this.label = CreateLabel("Please identify...", brush, 50, 50); this.labelCode = CreateLabel("", brush, 50, 80); this.labelAccess = CreateLabel("", brush, 50, 110); this.textBlock = new TextBlock(); textBlock.TextWrapping = TextWrapping.Wrap; textBlock.Text = string.Empty; this.labelData = CreateLabel(textBlock, brush, 50, 140); this.labelData.MaxWidth = 540; this.labelData.MaxHeight = 320; handDataSource.NewDataAvailable += new NewDataHandler <HandCollection>(handDataSource_NewDataAvailable); imageDataSource.NewDataAvailable += new NewDataHandler <ImageSource>(imageDataSource_NewDataAvailable); }
private void CreateController() { this.handDataSource = new HandDataSource(this.factory.CreateShapeDataSource(this.factory.CreateClusterDataSource(new Core.Clustering.ClusterDataSourceSettings { MaximumDepthThreshold = 900 }), new Core.Shape.ShapeDataSourceSettings())); this.mouseController = new MouseController(this.handDataSource, this.buttonToggle.IsChecked.Value); this.handDataSource.Start(); }
public ImageForm(IHandDataSource handDataSource) : this() { this.handDataSource = handDataSource; this.handDataSource.NewDataAvailable += new NewDataHandler<HandCollection>(handDataSource_NewDataAvailable); this.handLayer = new HandLayer(this.handDataSource); this.handLayer.ShowConvexHull = false; }
public ImageForm(IHandDataSource handDataSource) : this() { this.handDataSource = handDataSource; this.handDataSource.NewDataAvailable += new NewDataHandler <HandCollection>(handDataSource_NewDataAvailable); this.handLayer = new HandLayer(this.handDataSource); this.handLayer.ShowConvexHull = false; }
public KinectMultiTouchDevice(IHandDataSource handDataSource, FrameworkElement area) { this.touchDevices = new Dictionary <int, KinectTouchDevice>(); this.TargetSize = new Size(area.ActualWidth, area.ActualHeight); this.presentationSource = PresentationSource.FromVisual(area); this.handDataSource = handDataSource; handDataSource.NewDataAvailable += new Core.NewDataHandler <HandCollection>(handDataSource_NewDataAvailable); area.SizeChanged += new SizeChangedEventHandler(area_SizeChanged); }
private void CreateDataSources() { var settings = new HandDataSourceSettings(); settings.DetectCenterOfPalm = false; //Not used, so disabling this makes the app faster this.handDataSource = new HandDataSource(this.factory.CreateShapeDataSource(), settings); handDataSource.NewDataAvailable += new NewDataHandler <HandCollection>(handDataSource_NewDataAvailable); this.handDataSource.Start(); }
public VideoManipulationWindow(IHandDataSource handDataSource, IImageDataSource imageSource) : this() { this.handDataSource = handDataSource; this.imageSource = imageSource; imageSource.NewDataAvailable += new NewDataHandler<ImageSource>(imageSource_NewDataAvailable); handDataSource.NewDataAvailable += new NewDataHandler<HandCollection>(handDataSource_NewDataAvailable); imageSource.Start(); }
public KinectMultiTouchDevice(IHandDataSource handDataSource, FrameworkElement area) { this.touchDevices = new Dictionary<int, KinectTouchDevice>(); this.TargetSize = new Size(area.ActualWidth, area.ActualHeight); this.presentationSource = PresentationSource.FromVisual(area); this.handDataSource = handDataSource; handDataSource.NewDataAvailable += new Core.NewDataHandler<HandCollection>(handDataSource_NewDataAvailable); area.SizeChanged += new SizeChangedEventHandler(area_SizeChanged); }
public VideoManipulationWindow(IHandDataSource handDataSource, IImageDataSource imageSource) : this() { this.handDataSource = handDataSource; this.imageSource = imageSource; imageSource.NewDataAvailable += new NewDataHandler <ImageSource>(imageSource_NewDataAvailable); handDataSource.NewDataAvailable += new NewDataHandler <HandCollection>(handDataSource_NewDataAvailable); imageSource.Start(); }
public HandLayer(IHandDataSource dataSource, float zoomFactor) { this.dataSource = dataSource; this.dataSource.NewDataAvailable += dataSource_NewDataAvailable; this.SetZoomFactor(zoomFactor); this.ShowConvexHull = true; this.ShowContour = true; this.ShowFingerDepth = true; }
private void Window_Loaded(object sender, RoutedEventArgs e) { this.factory = new OpenNIDataSourceFactory("config.xml"); this.handDataSource = new HandDataSource(this.factory.CreateShapeDataSource(this.factory.CreateClusterDataSource(new Core.Clustering.ClusterDataSourceSettings { MaximumDepthThreshold = 900 }), new Core.Shape.ShapeDataSourceSettings())); this.factory.CreateRGBImageDataSource().Start(); var depthImageSource = this.factory.CreateDepthImageDataSource(); depthImageSource.NewDataAvailable += new NewDataHandler<ImageSource>(MainWindow_NewDataAvailable); depthImageSource.Start(); handDataSource.Start(); }
private void RefreshDepthFrame() { using (var depthFrameSource = new DepthFramePointerDataSource(this.CurrentFrame.Frame)) { this.clusterDataSource = new OpenNIClusterDataSource(depthFrameSource, this.clusterDataSourceSettings); this.shapeDataSource = new ClusterShapeDataSource(this.clusterDataSource, this.shapeDataSourceSettings); this.handDataSource = new HandDataSource(this.shapeDataSource, this.handDataSourceSettings); this.ToggleLayers(); this.ImageSource = new DepthImageDataSource(depthFrameSource); depthFrameSource.Push(); } }
private void CreateControllerInTrackingMode() { //this.handDataSource = new HandDataSource(this.factory.CreateShapeDataSource(this.trackingClusterDataSource)); //this.mouseController = new MouseController(this.handDataSource, this.trackingClusterDataSource); this.clusterDataSource = this.factory.CreateClusterDataSource(new ClusterDataSourceSettings { MaximumDepthThreshold = 900 }); this.handDataSource = new HandDataSource(this.factory.CreateShapeDataSource(this.clusterDataSource, new Core.Shape.ShapeDataSourceSettings())); this.mouseController = new MouseController(this.handDataSource); this.mouseController.Enabled = this.buttonToggle.IsChecked.Value; this.handDataSource.Start(); }
private void Window_Loaded(object sender, RoutedEventArgs e) { this.factory = new OpenNIDataSourceFactory("config.xml"); this.handDataSource = new HandDataSource(this.factory.CreateShapeDataSource(this.factory.CreateClusterDataSource(new Core.Clustering.ClusterDataSourceSettings { MaximumDepthThreshold = 900 }), new Core.Shape.ShapeDataSourceSettings())); this.factory.CreateRGBImageDataSource().Start(); var depthImageSource = this.factory.CreateDepthImageDataSource(); depthImageSource.NewDataAvailable += new NewDataHandler <ImageSource>(MainWindow_NewDataAvailable); depthImageSource.Start(); handDataSource.Start(); }
public void ToggleLayers(IClusterDataSource clusterDataSource, IHandDataSource handDataSource) { foreach (var layer in this.Layers) { layer.Dispose(); } var layers = new List<IWpfLayer>(); if (this.DisplayClusteringLayer && clusterDataSource != null) { layers.Add(new WpfClusterLayer(clusterDataSource)); } if (this.DisplayHandLayer && handDataSource != null) { layers.Add(new WpfHandLayer(handDataSource)); } this.Layers = layers; }
public void ToggleLayers(IClusterDataSource clusterDataSource, IHandDataSource handDataSource) { foreach (var layer in this.Layers) { layer.Dispose(); } var layers = new List <IWpfLayer>(); if (this.DisplayClusteringLayer && clusterDataSource != null) { layers.Add(new WpfClusterLayer(clusterDataSource)); } if (this.DisplayHandLayer && handDataSource != null) { layers.Add(new WpfHandLayer(handDataSource)); } this.Layers = layers; }
private void StartDepthSource() { try { if (this.VideoSource == null) { Mouse.OverrideCursor = Cursors.Wait; this.dataSourceFactory = new OpenNIDataSourceFactory("config.xml"); this.VideoSource = dataSourceFactory.CreateDepthImageDataSource(); this.clusterdataSource = dataSourceFactory.CreateClusterDataSource(this.clusterDataSourceSettings); this.shapeDataSourceVideo = dataSourceFactory.CreateShapeDataSource(this.clusterdataSource, this.shapeDataSourceSettings); this.handDataSourceVideo = new HandDataSource(this.shapeDataSourceVideo, this.handDataSourceSettings); this.depthFrameFactory = new DepthDataFrameFactory(this.clusterdataSource.Size); this.VideoSource.Start(); Mouse.OverrideCursor = Cursors.Arrow; } this.ToggleLayers(); } catch (Exception exc) { MessageBox.Show("Error: " + exc.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }
private void Start() { _checkClusterLayer.IsEnabled = true; _checkClusterLayer.IsChecked = true; _checkHandLayer.IsEnabled = true; _checkHandLayer.IsChecked = true; _factory = new SDKDataSourceFactory(); _depthImageSource = _factory.CreateDepthImageDataSource(); _depthImageSource.NewDataAvailable += new NewDataHandler<ImageSource>(MainWindow_NewDataAvailable); _depthImageSource.Start(); _clusterDataSource = _factory.CreateClusterDataSource(new ClusterDataSourceSettings { MaximumDepthThreshold = 900 }); _clusterDataSource.NewDataAvailable += new NewDataHandler<ClusterCollection>(ClusterDataSource_NewDataAvailable); _clusterDataSource.Start(); _handDataSource = new HandDataSource(_factory.CreateShapeDataSource(_clusterDataSource, new ShapeDataSourceSettings())); _handDataSource.NewDataAvailable += new NewDataHandler<HandCollection>(HandDataSource_NewDataAvailable); _handDataSource.Start(); UpdateLayers(); }
public HandLayer(IHandDataSource dataSource) : this(dataSource, 1) { }
public ManipulationWindow(IHandDataSource handDataSource) { InitializeComponent(); this.handDataSource = handDataSource; }
public MouseController(IHandDataSource handSource, bool enabled) : this(handSource) { this.Enabled = enabled; }
public TouchWindow(IHandDataSource handDataSource) : this() { this.handDataSource = handDataSource; }
public MouseController(IHandDataSource handSource, TrackingClusterDataSource trackingClusterDataSource) : this(handSource) { this.trackingClusterDataSource = trackingClusterDataSource; }
public MouseController(IHandDataSource handSource) { this.handSource = handSource; this.handSource.NewDataAvailable += new NewDataHandler<HandCollection>(handSource_NewDataAvailable); }
private void SetHandDataSource(IHandDataSource dataSource) { this.SetDataSource(dataSource, new HandLayer(dataSource)); }
public MouseController(IHandDataSource handSource) { this.handSource = handSource; this.handSource.NewDataAvailable += new NewDataHandler <HandCollection>(handSource_NewDataAvailable); }
void Start() { DataSource = DataSourceGameObject?.GetComponent <IHandDataSource>(); }
public KinectMultiTouchDevice(IHandDataSource handDataSource, PresentationSource presentationSource, Size targetSize) { this.presentationSource = presentationSource; this.TargetSize = targetSize; }
public void HandInterfaceWindow(IHandDataSource handDataSource, IImageDataSource imageDataSource) { this.element = new HandInterfaceElement(); }
public WpfHandLayer(IHandDataSource dataSource) { this.dataSource = dataSource; this.dataSource.NewDataAvailable += dataSource_NewDataAvailable; }