using BBIWARG.Recognition.HandRecognition;
using BBIWARG.Recognition.TouchRecognition;
using BBIWARG.Recognition.Tracking;
using BBIWARG.Utility;
using Emgu.CV;
using System.Drawing;
namespace BBIWARG.Recognition.FingerRecognition
{
///
/// The Finger class represents a Finger.
///
public class Finger : TrackableObject
{
///
/// the direction of the finger (end to start)
///
public Vector2D Direction { get { return SliceTrail.FittedDirection; } }
///
/// the hand the finger belongs to
///
public Hand Hand { get; set; }
///
/// the position of the finger end (hand)
///
public Vector2D HandPoint { get { return SliceTrail.EndSlice.Mid; } }
///
/// the line segment from start to end
///
public LineSegment2D LineSegment { get { return SliceTrail.LineSegment; } }
///
/// a position in the middle of the finger
///
public Vector2D MidPoint { get { return SliceTrail.MidSlice.Mid; } }
///
/// the finger slices
///
public FingerSliceTrail SliceTrail { get; private set; }
///
/// the position of the finger tip
///
public Vector2D TipPoint { get { return SliceTrail.StartSlice.Mid; } }
///
/// 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;
}
///
/// 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);
}
///
/// Reverses the finger (start to end)
///
public void reverse()
{
SliceTrail.reverse();
}
}
}