Hand.cs 752 B

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Emgu.CV;
  7. using Emgu.CV.Structure;
  8. using bbiwarg.Detectors.FingerDetection;
  9. using bbiwarg.Utility;
  10. namespace bbiwarg.Detectors.HandDetection
  11. {
  12. class Hand
  13. {
  14. public Image<Gray, byte> Mask { get; private set; }
  15. public List<Finger> Fingers { get; private set; }
  16. public Hand(Image<Gray, byte> mask) {
  17. Mask = mask;
  18. Fingers = new List<Finger>();
  19. }
  20. public bool isInside(Vector2D point) {
  21. return (Mask.Data[point.IntY, point.IntX, 0] == 1);
  22. }
  23. public void addFinger(Finger finger) {
  24. Fingers.Add(finger);
  25. }
  26. }
  27. }