Esempio n. 1
0
        private void Setup()
        {
            foreach (var modeCombination in ModeCombination.ValidCombinations)
            {
                this.comboMode.Items.Add(modeCombination);
            }
            this.factory = new OpenNIDataSourceFactory("mouse_config.xml");
            this.trackingClusterDataSource = this.factory.CreateTrackingClusterDataSource();
            var depthImageDataSource = this.factory.CreateDepthImageDataSource();

            depthImageDataSource.NewDataAvailable += new Core.NewDataHandler <ImageSource>(MainWindow_NewDataAvailable);
            depthImageDataSource.Start();
            CreateController();
        }
Esempio n. 2
0
        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();
        }
Esempio n. 3
0
 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);
     }
 }