protected virtual void PaintContour(HandData hand, DrawingContext drawingContext) { if (hand.Contour.Points.Count > 1) { var points = hand.Contour.Points.Select(p => new System.Windows.Point(p.X, p.Y)).ToArray(); DrawLines(drawingContext, this.yellowPen, points); } }
protected virtual void DrawCenter(HandData hand, DrawingContext drawingContext) { drawingContext.DrawEllipse(Brushes.Blue, null, new System.Windows.Point(hand.Location.X, hand.Location.Y), 5, 5); if (hand.HasPalmPoint) { drawingContext.DrawEllipse(Brushes.SpringGreen, null, new System.Windows.Point(hand.PalmPoint.Value.X, hand.PalmPoint.Value.Y), 5, 5); var palmSize = hand.PalmDistance; drawingContext.DrawEllipse(null, this.greenPen, new System.Windows.Point(hand.PalmPoint.Value.X, hand.PalmPoint.Value.Y), palmSize, palmSize); } }
private HandData Create(HandData lastFrameData, Shape shape) { return(this.Create(lastFrameData.Id, shape, lastFrameData.FingerPoints.Union(lastFrameData.NewlyDetectedFingerPoints).ToList())); }
private HandData Create(HandData lastFrameData, Shape shape) { return this.Create(lastFrameData.Id, shape, lastFrameData.FingerPoints.Union(lastFrameData.NewlyDetectedFingerPoints).ToList()); }
private void DrawHand(HandData hand, DrawingContext drawingContext) { this.PaintCovexHull(hand, drawingContext); if (hand.Contour != null) { this.PaintContour(hand, drawingContext); } this.DrawFingerPoints(hand, drawingContext); this.DrawCenter(hand, drawingContext); }
protected virtual void PaintCovexHull(HandData cluster, DrawingContext drawingContext) { if (cluster.ConvexHull.Count > 3) { this.DrawLines(drawingContext, this.whitePen, cluster.ConvexHull.Points.Select(p => new System.Windows.Point(p.X, p.Y)).ToArray()); } }
protected virtual void DrawFingerPoints(HandData cluster, DrawingContext drawingContext) { foreach (var point in cluster.FingerPoints) { PaintFingerPoint(point, drawingContext); } }