Example #1
0
        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);
        }
Example #3
0
 private void ImageSourcePropertyChanged(object sender, EventArgs args)
 {
     if (this.imageSource != null)
     {
         this.imageSource.NewDataAvailable -= new NewDataHandler<System.Windows.Media.ImageSource>(imageSource_NewDataAvailable);
     }
     this.imageSource = this.ImageSource;
     this.imageSource.NewDataAvailable += new NewDataHandler<System.Windows.Media.ImageSource>(imageSource_NewDataAvailable);
 }
 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();
 }
Example #5
0
        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();
        }
Example #6
0
 public void HandInterfaceWindow(IHandDataSource handDataSource, IImageDataSource imageDataSource)
 {
     this.element = new HandInterfaceElement();
 }
 public ChatMessageToInlines()
 {
     dataService = ServiceLocator.Current.GetInstance <IImageDataSource>();
 }