コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: an83/KinectTouch2
        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;
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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;
        }
コード例 #5
0
ファイル: MainWindow.xaml.cs プロジェクト: whx/KinectTouch2
        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;
        }
コード例 #6
0
        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);
        }
コード例 #7
0
ファイル: MainWindow.xaml.cs プロジェクト: gnavvy/ParaIF
        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();
        }
コード例 #8
0
        //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;
        }
コード例 #9
0
 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();
 }
コード例 #10
0
        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);
        }
コード例 #11
0
ファイル: MainWindow.xaml.cs プロジェクト: whx/KinectTouch2
 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();
 }
コード例 #12
0
ファイル: ImageForm.cs プロジェクト: aabrohi/kinect-kollage
 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;
 }
コード例 #13
0
ファイル: ImageForm.cs プロジェクト: aabrohi/kinect-kollage
 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;
 }
コード例 #14
0
 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);
 }
コード例 #15
0
        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();
        }
コード例 #16
0
 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();
 }
コード例 #17
0
 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();
 }
コード例 #19
0
ファイル: HandLayer.cs プロジェクト: an83/KinectTouch2
        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;
        }
コード例 #20
0
        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;
        }
コード例 #21
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();
        }
コード例 #22
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();
     }
 }
コード例 #23
0
ファイル: MainWindow.xaml.cs プロジェクト: whx/KinectTouch2
        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();
        }
コード例 #24
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();
        }
コード例 #25
0
        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;
        }
コード例 #26
0
        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;
        }
コード例 #27
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);
     }
 }
コード例 #28
0
ファイル: MainWindow.xaml.cs プロジェクト: gnavvy/ParaIF
        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();
        }
コード例 #29
0
 public HandLayer(IHandDataSource dataSource)
     : this(dataSource, 1)
 {
 }
コード例 #30
0
ファイル: HandLayer.cs プロジェクト: an83/KinectTouch2
 public HandLayer(IHandDataSource dataSource)
     : this(dataSource, 1)
 { }
コード例 #31
0
 public ManipulationWindow(IHandDataSource handDataSource)
 {
     InitializeComponent();
     this.handDataSource = handDataSource;
 }
コード例 #32
0
 public MouseController(IHandDataSource handSource, bool enabled)
     : this(handSource)
 {
     this.Enabled = enabled;
 }
コード例 #33
0
 public TouchWindow(IHandDataSource handDataSource)
     : this()
 {
     this.handDataSource = handDataSource;
 }
コード例 #34
0
ファイル: MainWindow.xaml.cs プロジェクト: an83/KinectTouch2
        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();
        }
コード例 #35
0
 public MouseController(IHandDataSource handSource, TrackingClusterDataSource trackingClusterDataSource)
     : this(handSource)
 {
     this.trackingClusterDataSource = trackingClusterDataSource;
 }
コード例 #36
0
 public MouseController(IHandDataSource handSource)
 {
     this.handSource = handSource;
     this.handSource.NewDataAvailable += new NewDataHandler<HandCollection>(handSource_NewDataAvailable);
 }
コード例 #37
0
 private void SetHandDataSource(IHandDataSource dataSource)
 {
     this.SetDataSource(dataSource, new HandLayer(dataSource));
 }
コード例 #38
0
 public MouseController(IHandDataSource handSource)
 {
     this.handSource = handSource;
     this.handSource.NewDataAvailable += new NewDataHandler <HandCollection>(handSource_NewDataAvailable);
 }
コード例 #39
0
 public MouseController(IHandDataSource handSource, bool enabled)
     : this(handSource)
 {
     this.Enabled = enabled;
 }
コード例 #40
0
ファイル: HandController.cs プロジェクト: henningpohl/poros
 void Start()
 {
     DataSource = DataSourceGameObject?.GetComponent <IHandDataSource>();
 }
コード例 #41
0
ファイル: MainWindow.xaml.cs プロジェクト: an83/KinectTouch2
 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();
 }
コード例 #42
0
ファイル: TouchWindow.xaml.cs プロジェクト: an83/KinectTouch2
 public TouchWindow(IHandDataSource handDataSource)
     : this()
 {
     this.handDataSource = handDataSource;
 }
コード例 #43
0
 public MouseController(IHandDataSource handSource, TrackingClusterDataSource trackingClusterDataSource)
     : this(handSource)
 {
     this.trackingClusterDataSource = trackingClusterDataSource;
 }
コード例 #44
0
ファイル: MainForm.cs プロジェクト: an83/KinectTouch2
 private void SetHandDataSource(IHandDataSource dataSource)
 {
     this.SetDataSource(dataSource, new HandLayer(dataSource));
 }
コード例 #45
0
 public KinectMultiTouchDevice(IHandDataSource handDataSource, PresentationSource presentationSource, Size targetSize)
 {
     this.presentationSource = presentationSource;
     this.TargetSize         = targetSize;
 }
コード例 #46
0
 public ManipulationWindow(IHandDataSource handDataSource)
 {
     InitializeComponent();
     this.handDataSource = handDataSource;
 }
コード例 #47
0
 public KinectMultiTouchDevice(IHandDataSource handDataSource, PresentationSource presentationSource, Size targetSize)
 {
     this.presentationSource = presentationSource;
     this.TargetSize = targetSize;
 }
コード例 #48
0
 public void HandInterfaceWindow(IHandDataSource handDataSource, IImageDataSource imageDataSource)
 {
     this.element = new HandInterfaceElement();
 }
コード例 #49
0
 public WpfHandLayer(IHandDataSource dataSource)
 {
     this.dataSource = dataSource;
     this.dataSource.NewDataAvailable += dataSource_NewDataAvailable;
 }
コード例 #50
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);
     }
 }
コード例 #51
0
 public WpfHandLayer(IHandDataSource dataSource)
 {
     this.dataSource = dataSource;
     this.dataSource.NewDataAvailable += dataSource_NewDataAvailable;
 }
コード例 #52
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();
     }
 }