예제 #1
0
 public HandDataSource(IShapeDataSource shapeDataSource, HandDataSourceSettings settings)
     : base(shapeDataSource)
 {
     this.factory      = new ShapeHandDataFactory(settings);
     this.size         = shapeDataSource.Size;
     this.CurrentValue = new HandCollection();
 }
예제 #2
0
 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();
     }
 }
예제 #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);
     }
 }
예제 #4
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);
     }
 }
예제 #5
0
 public HandDataSource(IShapeDataSource shapeDataSource)
     : this(shapeDataSource, new HandDataSourceSettings())
 {
 }
예제 #6
0
 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();
     }
 }