Touch.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using bbiwarg.Recognition.FingerRecognition;
  7. using bbiwarg.Recognition.PalmRecognition;
  8. using bbiwarg.Recognition.Tracking;
  9. using bbiwarg.Utility;
  10. using Emgu.CV;
  11. using Emgu.CV.Structure;
  12. namespace bbiwarg.Recognition.TouchRecognition
  13. {
  14. /// <summary>
  15. /// Represents a touch (Finger<->Palm)
  16. /// </summary>
  17. public class Touch : TrackableObject
  18. {
  19. /// <summary>
  20. /// the absolute position of the touch
  21. /// </summary>
  22. public Vector2D AbsolutePosition { get; private set; }
  23. /// <summary>
  24. /// the relative position of the touch within the palm quad
  25. /// </summary>
  26. public Vector2D RelativePosition { get; private set; }
  27. /// <summary>
  28. /// the touching finger
  29. /// </summary>
  30. public Finger Finger { get; private set; }
  31. /// <summary>
  32. /// the touched palm
  33. /// </summary>
  34. public Palm Palm { get; private set; }
  35. /// <summary>
  36. /// Initializes a new instance of the Touch class.
  37. /// </summary>
  38. /// <param name="absolutePosition">The absolute position.</param>
  39. /// <param name="finger">The touching finger.</param>
  40. /// <param name="palm">The touched palm.</param>
  41. public Touch(Vector2D absolutePosition, Finger finger, Palm palm)
  42. {
  43. AbsolutePosition = absolutePosition;
  44. RelativePosition = palm.getRelativePosition(absolutePosition);
  45. Finger = finger;
  46. Palm = palm;
  47. finger.Touch = this;
  48. }
  49. }
  50. }