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; }
public ClusterShapeDataSource(IClusterDataSource clusterDataSource, ShapeDataSourceSettings settings) : base(clusterDataSource) { this.factory = new ClusterShapeFactory(settings); this.size = clusterDataSource.Size; this.CurrentValue = new ShapeCollection(); }
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() { _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 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(); }
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 WpfClusterLayer(IClusterDataSource dataSource) { this.dataSource = dataSource; this.dataSource.NewDataAvailable += dataSource_NewDataAvailable; }
public ClusterLayer(IClusterDataSource dataSource, float zoomFactor) { this.dataSource = dataSource; this.dataSource.NewDataAvailable += dataSource_NewDataAvailable; this.zoomFactor = zoomFactor; }
public ClusterLayer(IClusterDataSource dataSource) : this(dataSource, 1) { }
private void SetClusterDataSource(IClusterDataSource dataSource) { this.SetDataSource(dataSource, new ClusterLayer(dataSource)); }
public IShapeDataSource CreateShapeDataSource(IClusterDataSource clusterdataSource) { return new ClusterShapeDataSource(clusterdataSource, new ShapeDataSourceSettings()); }
public IShapeDataSource CreateShapeDataSource(IClusterDataSource clusterdataSource) { return(new ClusterShapeDataSource(clusterdataSource, new ShapeDataSourceSettings())); }
public ClusterShapeDataSource(IClusterDataSource clusterDataSource) : this(clusterDataSource, new ShapeDataSourceSettings()) { }
public IShapeDataSource CreateShapeDataSource(IClusterDataSource clusterdataSource, ShapeDataSourceSettings shapeDataSourceSettings) { return new ClusterShapeDataSource(clusterdataSource, shapeDataSourceSettings); }
public IShapeDataSource CreateShapeDataSource(IClusterDataSource clusterdataSource, ShapeDataSourceSettings shapeDataSourceSettings) { return(new ClusterShapeDataSource(clusterdataSource, shapeDataSourceSettings)); }