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(); }
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; }
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(); }
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; }
private IList<FingerPoint> DetectFingerPoints(ConvexHull convexHull, Contour contour) { if (!this.settings.DetectFingers) { return new List<FingerPoint>(); } return this.fingerPointDetector.FindFingerPoints(contour, convexHull); }
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; }
private int FindIndex(Point point, Contour contour) { return Point.FindIndexOfNearestPoint(point, contour.Points); }
public void Detect(Contour contour, IList<FingerPoint> fingerTips) { foreach (var fingerPoint in fingerTips) { FindBasePoints(contour, fingerPoint); } }