Finger.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Drawing;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using bbiwarg.Images;
  8. using bbiwarg.Utility;
  9. using bbiwarg.Output;
  10. using bbiwarg.Recognition.HandRecognition;
  11. using bbiwarg.Recognition.TouchRecognition;
  12. using bbiwarg.Recognition.Tracking;
  13. using Emgu.CV;
  14. namespace bbiwarg.Recognition.FingerRecognition
  15. {
  16. public class Finger : TrackableObject
  17. {
  18. public Vector2D TipPoint { get { return SliceTrail.StartSlice.Mid; } }
  19. public Vector2D HandPoint { get { return SliceTrail.EndSlice.Mid; } }
  20. public Vector2D MidPoint { get { return SliceTrail.MidSlice.Mid; } }
  21. public Vector2D Direction { get { return SliceTrail.FittedDirection; } }
  22. public LineSegment2D LineSegment { get { return SliceTrail.LineSegment; } }
  23. public FingerSliceTrail SliceTrail { get; private set; }
  24. public Hand Hand { get; set; }
  25. public Touch Touch { get; set; }
  26. public Finger(FingerSliceTrail sliceTrail)
  27. : base()
  28. {
  29. SliceTrail = sliceTrail;
  30. }
  31. public void reverse() {
  32. SliceTrail.reverse();
  33. }
  34. public Contour<Point> getContour(float margin) {
  35. return SliceTrail.getContour(margin);
  36. }
  37. }
  38. }