コード例 #1
0
ファイル: HandData.cs プロジェクト: gnavvy/ParaIF
 public HandData(int id, Shape shape, Palm palm, IList<FingerPoint> fingerPoints)
 {
     this.id = id;
     this.shape = shape;
     this.palm = palm;
     this.fingerPoints = fingerPoints;
 }
コード例 #2
0
ファイル: ShapeHandDataFactory.cs プロジェクト: gnavvy/ParaIF
        private HandData Create(int id, Shape shape, IList<FingerPoint> lastFrameFingerPoints)
        {
            var newFingerPoints = this.DetectFingerPoints(shape.ConvexHull, shape.Contour);
            var fingerPoints = this.MapFingerPoints(lastFrameFingerPoints, newFingerPoints);
            var palm = DetectPalm(shape, shape.Contour);

            if (settings.DetectFingerDirection) {
                this.fingerBaseDetector.Detect(shape.Contour, fingerPoints);
            }

            return new HandData(id, shape, palm, fingerPoints.Where(f => f.FrameCount >= this.settings.FramesForNewFingerPoint).ToList()) { NewlyDetectedFingerPoints = fingerPoints.Where(f => f.FrameCount < this.settings.FramesForNewFingerPoint).ToList() };
        }
コード例 #3
0
ファイル: ShapeHandDataFactory.cs プロジェクト: gnavvy/ParaIF
 private HandData Create(HandData lastFrameData, Shape shape)
 {
     return this.Create(lastFrameData.Id, shape, lastFrameData.FingerPoints.Union(lastFrameData.NewlyDetectedFingerPoints).ToList());
 }
コード例 #4
0
ファイル: ShapeHandDataFactory.cs プロジェクト: gnavvy/ParaIF
 private HandData Create(Shape shape)
 {
     return this.Create(idGenerator.GetNextId(), shape, new List<FingerPoint>());
 }
コード例 #5
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;
        }