public KMeansClusterFactory(ClusterDataSourceSettings settings, IClusterMergeStrategy mergeStrategy, IntSize size)
 {
     this.settings      = settings;
     this.mergeStrategy = mergeStrategy;
     this.algorithm     = new KMeans(this.settings.ClusterCount, settings.DepthRange, size);
     this.value         = new ClusterCollection();
 }
Esempio n. 2
0
        public MainViewModel(ClusterDataSourceSettings clusterDataSourceSettings, ShapeDataSourceSettings shapeDataSourceSettings, HandDataSourceSettings handDataSourceSettings)
        {
            this.Frames = new BindingList<TestDepthFrame>();
            this.clusterDataSourceSettings = clusterDataSourceSettings;
            this.shapeDataSourceSettings = shapeDataSourceSettings;
            this.handDataSourceSettings = handDataSourceSettings;

            this.VideoPresenter = new VideoViewModel(clusterDataSourceSettings, shapeDataSourceSettings, handDataSourceSettings);
            this.VideoPresenter.NewFrameCaptured += new Action<DepthDataFrame>(VideoPresenter_NewFrameCaptured);

            this.SaveFrameCommand = new RelayCommand(SaveCurrentFrame);
            this.LoadFrameCommand = new RelayCommand(LoadFrames);
            this.SelectPointCommand = new RelayCommand(SelectPoint);
            this.SelectFrameCommand = new RelayCommand<TestDepthFrame>(SelectFrame);
            this.RemoveFrameCommand = new RelayCommand(RemoveFrame);

            this.AddHandCommand = new RelayCommand(AddHand);
            this.RemoveHandCommand = new RelayCommand<HandDataViewModel>(RemoveHand);

            this.MarkPalmCenterCommand = new RelayCommand<HandDataViewModel>(MarkPalmCenter);
            this.MarkFingersCommand = new RelayCommand<HandDataViewModel>(MarkFingers);
            this.RemoveFingerCommand = new RelayCommand<FingerRoutedEventArgs>(RemoveFinger);

            this.OptionChangeCommand = new RelayCommand(ChangeOptions);

            this.LayerViewModel = new LayerViewModel();
        }
 public IClusterDataSource CreateClusterDataSource(ClusterDataSourceSettings clusterDataSourceSettings)
 {
     var size = new IntSize(this.Adapter.DepthStreamWidth, this.Adapter.DepthStreamHeight);
     var clusterFactory = new KMeansClusterFactory(clusterDataSourceSettings, size);
     var filter = new ImageFrameDepthPointFilter(size, clusterDataSourceSettings.MinimumDepthThreshold, clusterDataSourceSettings.MaximumDepthThreshold, clusterDataSourceSettings.LowerBorder);
     return new SDKClusterDataSource(this.Adapter, clusterFactory, filter);
 }
Esempio n. 4
0
 public KMeansClusterFactory(ClusterDataSourceSettings settings, IClusterMergeStrategy mergeStrategy, IntSize size)
 {
     this.settings = settings;
     this.mergeStrategy = mergeStrategy;
     this.algorithm = new KMeans(this.settings.ClusterCount, settings.DepthRange, size);
     this.value = new ClusterCollection();
 }
Esempio n. 5
0
 public SettingsForm(ClusterDataSourceSettings clusterSettings, ShapeDataSourceSettings shapeDataSourceSettings, HandDataSourceSettings handDetectionSettings)
     : this()
 {
     this.propertyGridClustering.SelectedObject = clusterSettings;
     this.propertyGridShape.SelectedObject = shapeDataSourceSettings;
     this.propertyGridHandDetection.SelectedObject = handDetectionSettings;
 }
Esempio n. 6
0
        public HandDataFactory(IntSize size, ClusterDataSourceSettings clusteringSettings, ShapeDataSourceSettings shapeSettings, HandDataSourceSettings handSettings)
        {
            this.clusteringSettings = clusteringSettings;
            this.shapeSettings = shapeSettings;
            this.handSettings = handSettings;

            this.clusterFactory = new KMeansClusterFactory(this.clusteringSettings, size);
            this.filter = new PointerDepthPointFilter(size, this.clusteringSettings.MinimumDepthThreshold, this.clusteringSettings.MaximumDepthThreshold, this.clusteringSettings.LowerBorder);

            this.shapeFactory = new ClusterShapeFactory(this.shapeSettings);
            this.handFactory = new ShapeHandDataFactory(this.handSettings);
        }
Esempio n. 7
0
        public VideoViewModel(ClusterDataSourceSettings clusterDataSourceSettings, ShapeDataSourceSettings shapeDataSourceSettings, HandDataSourceSettings handDataSourceSettings)
        {
            this.clusterDataSourceSettings = clusterDataSourceSettings;
            this.shapeDataSourceSettings = shapeDataSourceSettings;
            this.handDataSourceSettings = handDataSourceSettings;

            this.CaptureFrameCommand = new RelayCommand(CaptureFrame);
            this.CaptureFrameDelayedCommand = new RelayCommand(CaptureFrameDelayed);

            this.StartDepthSourceCommand = new RelayCommand(StartDepthSource);

            this.LayerViewModel = new LayerViewModel();
        }
        public void Setup()
        {
            var settings = new ClusterDataSourceSettings();
            settings.LowerBorder = 0;
            settings.MinimalPointsForClustering = 1;
            settings.MinimalPointsForValidCluster = 1;
            settings.PointModulo = 1;
            settings.MergeMaximumClusterCenterDistances = 1;
            settings.MergeMaximumClusterCenterDistances2D = 1;
            settings.MergeMinimumDistanceToCluster = 1;

            this.size = new IntSize(20, 10);

            this.factory = new KMeansClusterFactory(settings, this.size);
        }
Esempio n. 9
0
        public static void SetToDefault(ClusterDataSourceSettings settings)
        {
            settings.MinimalPointsForValidCluster = 10;
            settings.MinimalPointsForClustering   = 50;
            settings.PointModulo           = 5;
            settings.LowerBorder           = 75;
            settings.MinimumDepthThreshold = 500;
            settings.MaximumDepthThreshold = 800;
            settings.ClusterCount          = 2;

            settings.MergeMinimumDistanceToCluster        = 50;
            settings.MergeMaximumClusterCenterDistances   = 120;
            settings.MergeMaximumClusterCenterDistances2D = 100;

            settings.MaximumClusterDepth = 150;
        }
        public static void SetToDefault(ClusterDataSourceSettings settings)
        {
            settings.MinimalPointsForValidCluster = 10;
            settings.MinimalPointsForClustering = 50;
            settings.PointModulo = 5;
            settings.LowerBorder = 75;
            settings.MinimumDepthThreshold = 500;
            settings.MaximumDepthThreshold = 800;
            settings.ClusterCount = 2;

            settings.MergeMinimumDistanceToCluster = 50;
            settings.MergeMaximumClusterCenterDistances = 120;
            settings.MergeMaximumClusterCenterDistances2D = 100;

            settings.MaximumClusterDepth = 150;
        }
 public VolumeFilterClusterDataSource(IDepthPointerDataSource dataSource, ClusterDataSourceSettings settings)
     : base(dataSource, settings)
 {
     this.filterVolumes = new List<Volume>();
     this.settings = settings;
 }
Esempio n. 12
0
 public DefaultMergeStrategy(ClusterDataSourceSettings settings)
 {
     this.settings = settings;
 }
Esempio n. 13
0
 public IShapeDataSource CreateShapeDataSource(ClusterDataSourceSettings clusterDataSourceSettings, ShapeDataSourceSettings shapeDataSourceSettings)
 {
     return new ClusterShapeDataSource(this.CreateClusterDataSource(clusterDataSourceSettings), shapeDataSourceSettings);
 }
Esempio n. 14
0
 public IClusterDataSource CreateClusterDataSource(ClusterDataSourceSettings clusterDataSourceSettings)
 {
     return new OpenNIClusterDataSource(this.GetDepthPointerDataSource(), clusterDataSourceSettings);
 }
 public DefaultMergeStrategy(ClusterDataSourceSettings settings)
 {
     this.settings = settings;
 }
Esempio n. 16
0
 public KMeansClusterFactory(ClusterDataSourceSettings settings, IntSize size)
     : this(settings, new DefaultMergeStrategy(settings), size)
 { }
Esempio n. 17
0
 public HandDataFactory(IKinectSensor sensor, IntSize size, ClusterDataSourceSettings clusteringSettings, ShapeDataSourceSettings shapeSettings, HandDataSourceSettings handSettings)
     : this(size, clusteringSettings, shapeSettings, handSettings)
 {
     this.sdkFilter = new ImageFrameDepthPointFilter(sensor, size, this.clusteringSettings.MinimumDepthThreshold, this.clusteringSettings.MaximumDepthThreshold, this.clusteringSettings.LowerBorder);
 }
 public KMeansClusterFactory(ClusterDataSourceSettings settings, IntSize size)
     : this(settings, new DefaultMergeStrategy(settings), size)
 {
 }
 public IClusterDataSource CreateClusterDataSource()
 {
     var settings = new ClusterDataSourceSettings();
     settings.MaximumDepthThreshold = 950;
     return this.CreateClusterDataSource(settings);
 }
 public void Setup()
 {
     this.settings = new ClusterDataSourceSettings();
     this.depthPointerSourceStub = new DepthPointerDataSourceStub { Width = 20, Height = 20 };
     this.clusterDataSource = new OpenNIClusterDataSource(this.depthPointerSourceStub, this.settings);
 }