コード例 #1
0
 public DepthMap Scan(DepthMap inputMap)
 {
     this.inputMap = inputMap;
     this.result = new DepthMap(inputMap.Width + 1, inputMap.Height + 1);
     Parallel.Invoke(this.ScanHorizontal, this.ScanVertical);
     return this.result;
 }
コード例 #2
0
 public IList <Point> GetContourPoints(DepthMap contourMap)
 {
     this.contourMap    = contourMap;
     this.contourPoints = new List <Point>();
     this.Process();
     return(this.contourPoints);
 }
コード例 #3
0
 public DepthMap Scan(DepthMap inputMap)
 {
     this.inputMap = inputMap;
     this.result   = new DepthMap(inputMap.Width + 1, inputMap.Height + 1);
     Parallel.Invoke(this.ScanHorizontal, this.ScanVertical);
     return(this.result);
 }
コード例 #4
0
ファイル: ContourTracer.cs プロジェクト: an83/KinectTouch2
 public IList<Point> GetContourPoints(DepthMap contourMap)
 {
     this.contourMap = contourMap;
     this.contourPoints = new List<Point>();
     this.Process();
     return this.contourPoints;
 }
コード例 #5
0
ファイル: ContourFactory.cs プロジェクト: an83/KinectTouch2
 public Contour CreateContour(DepthMap map, float left, float top)
 {
     if (map.FillRate < 0.01) 
     {
         return Contour.Empty;
     }
     var points = this.Translate(this.tracer.GetContourPoints(map), (int)left, (int)top);
     points = this.thinner.Filter(points);
     return new Contour(points);
 }
コード例 #6
0
        public Contour CreateContour(DepthMap map, float left, float top)
        {
            if (map.FillRate < 0.01)
            {
                return(Contour.Empty);
            }
            var points = this.Translate(this.tracer.GetContourPoints(map), (int)left, (int)top);

            points = this.thinner.Filter(points);
            return(new Contour(points));
        }
コード例 #7
0
        public void Test()
        {
            var tracer = new ContourTracer();

            var map = new DepthMap(10, 10);
            map[6, 6] = 100;
            map[5, 5] = 100;
            map[6, 5] = 100;
            map[4, 5] = 100;
            map[3, 5] = 100;
            map[4, 4] = 100;
            map[5, 4] = 100;
            map[6, 4] = 100;
            map[4, 3] = 100;
            map[5, 3] = 100;
            map[6, 3] = 100;
            map[5, 2] = 100;

            var result = tracer.GetContourPoints(map);

            Assert.IsTrue(!result.Contains(new Point(5, 4, 100)));
        }
コード例 #8
0
 private Contour CreateContour(DepthMap map, Cluster cluster)
 {
     return(this.contourFactory.CreateContour(map, cluster.X, cluster.Y));
 }
コード例 #9
0
 private Contour CreateContour(DepthMap map, Cluster cluster)
 {
     return this.contourFactory.CreateContour(map, cluster.X, cluster.Y);
 }