Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 2
0
 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);
     }
 }
Exemplo n.º 3
0
 private HandData Create(HandData lastFrameData, Shape shape)
 {
     return(this.Create(lastFrameData.Id, shape, lastFrameData.FingerPoints.Union(lastFrameData.NewlyDetectedFingerPoints).ToList()));
 }
Exemplo n.º 4
0
 private HandData Create(HandData lastFrameData, Shape shape)
 {
     return this.Create(lastFrameData.Id, shape, lastFrameData.FingerPoints.Union(lastFrameData.NewlyDetectedFingerPoints).ToList());
 }
Exemplo n.º 5
0
 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);
 }
Exemplo n.º 6
0
 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());
     }
 }
Exemplo n.º 7
0
 protected virtual void DrawFingerPoints(HandData cluster, DrawingContext drawingContext)
 {
     foreach (var point in cluster.FingerPoints) {
         PaintFingerPoint(point, drawingContext);
     }
 }