using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using bbiwarg.Images;
using bbiwarg.Utility;
using bbiwarg.Output;
using bbiwarg.Recognition.HandRecognition;
using bbiwarg.Recognition.TouchRecognition;
using bbiwarg.Recognition.Tracking;
using Emgu.CV;
namespace bbiwarg.Recognition.FingerRecognition
{
///
/// The Finger class represents a Finger.
///
public class Finger : TrackableObject
{
///
/// the position of the finger tip
///
public Vector2D TipPoint { get { return SliceTrail.StartSlice.Mid; } }
///
/// the position of the finger end (hand)
///
public Vector2D HandPoint { get { return SliceTrail.EndSlice.Mid; } }
///
/// a position in the middle of the finger
///
public Vector2D MidPoint { get { return SliceTrail.MidSlice.Mid; } }
///
/// the direction of the finger (end to start)
///
public Vector2D Direction { get { return SliceTrail.FittedDirection; } }
///
/// the line segment from start to end
///
public LineSegment2D LineSegment { get { return SliceTrail.LineSegment; } }
///
/// the finger slices
///
public FingerSliceTrail SliceTrail { get; private set; }
///
/// the hand the finger belongs to
///
public Hand Hand { get; set; }
///
/// the touch of the current finger
///
public Touch Touch { get; set; }
///
/// Initializes a new instance of the Finger class.
///
/// The finger slice trail.
public Finger(FingerSliceTrail sliceTrail)
: base()
{
SliceTrail = sliceTrail;
}
///
/// Reverses the finger (start<->end)
///
public void reverse() {
SliceTrail.reverse();
}
///
/// Gets a contour of the finger
///
/// the margin around the finger (distance in pixels)
/// the contour of the finger
public Contour getContour(float margin) {
return SliceTrail.getContour(margin);
}
}
}