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); }
public void Test_ToString() { var size = new IntSize(10, 12); var sizeText = size.ToString(); Assert.IsTrue(sizeText.Contains("10")); Assert.IsTrue(sizeText.Contains("12")); }
public void Test_Equals() { var size = new IntSize(10, 10); var equalSize = new IntSize(10, 10); var unequalSize = new IntSize(11, 10); Assert.AreEqual(size, equalSize); Assert.AreNotEqual(size, unequalSize); Assert.AreNotEqual(size, null); Assert.AreNotEqual(size, new object()); }
private void RunTest(string framePath, Action<HandCollection> assertions) { var frameSize = new IntSize(640, 480); var frame = new DepthDataFrameRepository(frameSize).Load(framePath); using (var frameDataSource = new DepthFramePointerDataSource(frame)) { var src = new HandDataSource(new ClusterShapeDataSource(new OpenNIClusterDataSource(frameDataSource, new ClusterDataSourceSettings()))); frameDataSource.Push(); assertions(src.CurrentValue); } }
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); }
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); }
private Point MapPoint(Point point, IntSize originalSize) { return new Point(point.X / originalSize.Width * this.ClientSize.Width, point.Y / originalSize.Height * this.ClientSize.Height, 0); }
public DepthDataFrameRepository(IntSize frameSize) { this.frameSize = frameSize; }
public void Setup() { this.size = new IntSize(20, 10); this.filter = new ImageFrameDepthPointFilter(this.size, 500, 700, 0); }
public DepthDataFrame(IntSize size, ushort[] data) { this.data = data; this.size = size; }
public DepthFrameEntity(IntSize size, ushort[] data) { this.data = data; this.size = size; }
public void Setup() { this.size = new IntSize(20, 10); this.filter = new PointerDepthPointFilter(size, 500, 800, 0); }
public HandDataFactory(IntSize size) : this(size, new ClusterDataSourceSettings(), new ShapeDataSourceSettings(), new HandDataSourceSettings()) { }
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); }