FingerSlice.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using BBIWARG.Utility;
  2. namespace BBIWARG.Recognition.FingerRecognition
  3. {
  4. /// <summary>
  5. /// A Finger consists of multiple FingerSlices, each one represented by a line preferably orthogonal to the fingers direction.
  6. /// </summary>
  7. public class FingerSlice
  8. {
  9. /// <summary>
  10. /// the direction of the slice
  11. /// </summary>
  12. public Vector2D Direction { get { return LineSegment.Direction; } }
  13. /// <summary>
  14. /// the end point of the slice
  15. /// </summary>
  16. public Vector2D End { get; private set; }
  17. /// <summary>
  18. /// the length of the slice (in pixels)
  19. /// </summary>
  20. public float Length { get { return LineSegment.Length; } }
  21. /// <summary>
  22. /// the line segment connecting start and end
  23. /// </summary>
  24. public LineSegment2D LineSegment { get; private set; }
  25. /// <summary>
  26. /// the point in the middle of the slice
  27. /// </summary>
  28. public Vector2D Mid { get; private set; }
  29. /// <summary>
  30. /// the start point of the slice
  31. /// </summary>
  32. public Vector2D Start { get; private set; }
  33. /// <summary>
  34. /// Initializes a new instance of the FingerSlice class.
  35. /// </summary>
  36. /// <param name="start">The start point</param>
  37. /// <param name="end">The end point</param>
  38. public FingerSlice(Vector2D start, Vector2D end)
  39. {
  40. Start = start;
  41. End = end;
  42. Mid = (start + end) / 2;
  43. LineSegment = new LineSegment2D(Start, End);
  44. }
  45. }
  46. }