コード例 #1
0
ファイル: FingerPointDetector.cs プロジェクト: gnavvy/ParaIF
 public IList<FingerPoint> FindFingerPoints(Contour contour, ConvexHull convexHull)
 {
     this.contourPoints = contour.Points;
     var thinnedHullPoints = this.lineThinner.Filter(convexHull.Points);
     var verifiedHullPoints = this.VerifyPointsByContour(thinnedHullPoints);
     return verifiedHullPoints.Select(r => new FingerPoint(r)).ToList();
 }
コード例 #2
0
ファイル: Shape.cs プロジェクト: gnavvy/ParaIF
 public Shape(Point center, Volume volume, Contour contour, ConvexHull convexHull, IList<Point> points)
 {
     this.center = center;
     this.volume = volume;
     this.contour = contour;
     this.convexHull = convexHull;
     this.points = points;
 }
コード例 #3
0
ファイル: FingerBaseDetector.cs プロジェクト: gnavvy/ParaIF
        private void FindBasePoints(Contour contour, FingerPoint fingerPoint)
        {
            var fingerPointIndex = FindIndex(fingerPoint.Fingertip, contour);
            var distanceAdjustedOffset = (int)(offsetDistance * indexOffset / fingerPoint.Fingertip.Z);

            fingerPoint.BaseLeft = contour.GetPointAt(Rollover(fingerPointIndex - distanceAdjustedOffset, contour.Count));
            fingerPoint.BaseRight = contour.GetPointAt(Rollover(fingerPointIndex + distanceAdjustedOffset, contour.Count));

            var baseCenter = Point.Center(fingerPoint.BaseLeft, fingerPoint.BaseRight);
            fingerPoint.DirectionVector = Point.Subtract(fingerPoint.Fingertip, baseCenter).GetNormalizedVector();
        }
コード例 #4
0
ファイル: PalmFinder.cs プロジェクト: gnavvy/ParaIF
 public Palm FindCenter(ConvexHull hull, Contour contour, IList<Point> candidates)
 {
     this.result = null;
     candidates = ReduceCandidatePoints(hull, candidates);
     if (candidates.Count > 0) {
         var minimizedContour = new LineThinner(contourReduction, false).Filter(contour.Points);
         this.FindCenterFromCandidates(minimizedContour, candidates);
         if (this.result != null) {
             this.IncreaseAccuracy(this.result.Location, minimizedContour);
         }
     }
     return result;
 }
コード例 #5
0
ファイル: ShapeHandDataFactory.cs プロジェクト: gnavvy/ParaIF
 private IList<FingerPoint> DetectFingerPoints(ConvexHull convexHull, Contour contour)
 {
     if (!this.settings.DetectFingers) {
         return new List<FingerPoint>();
     }
     return this.fingerPointDetector.FindFingerPoints(contour, convexHull);
 }
コード例 #6
0
ファイル: ShapeHandDataFactory.cs プロジェクト: gnavvy/ParaIF
        private Palm DetectPalm(Shape shape, Contour contour)
        {
            var candidates = shape.Points;
            Palm palm = null;

            if (this.settings.DetectCenterOfPalm && shape.PointCount > 0 && contour.Count > 0) {
                palm = this.palmFinder.FindCenter(shape.ConvexHull, contour, shape.Points);
            }
            return palm;
        }
コード例 #7
0
ファイル: FingerBaseDetector.cs プロジェクト: gnavvy/ParaIF
 private int FindIndex(Point point, Contour contour)
 {
     return Point.FindIndexOfNearestPoint(point, contour.Points);
 }
コード例 #8
0
ファイル: FingerBaseDetector.cs プロジェクト: gnavvy/ParaIF
 public void Detect(Contour contour, IList<FingerPoint> fingerTips)
 {
     foreach (var fingerPoint in fingerTips) {
         FindBasePoints(contour, fingerPoint);
     }
 }