PalmImage.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 System.Drawing;
  9. namespace bbiwarg.Images
  10. {
  11. class PalmImage
  12. {
  13. private Image<Gray, Byte> image;
  14. private int width, height;
  15. public PalmImage(EdgeImage edgeImage)
  16. {
  17. image = edgeImage.getImage().Clone();
  18. width = image.Width;
  19. height = image.Height;
  20. findContours();
  21. }
  22. private void findContours()
  23. {
  24. Image<Gray, Byte> storage = image.Clone();
  25. MCvContour countour = new MCvContour();
  26. }
  27. public bool belongsToPalm(int x, int y)
  28. {
  29. return false;
  30. }
  31. private Point getPointWithDepth(Int16 depth)
  32. {
  33. for (int x = 0; x < width; ++x)
  34. {
  35. for (int y = 0; y < height; ++y)
  36. {
  37. if (image.Data[y, x, 0] == depth)
  38. return new Point(x, y);
  39. }
  40. }
  41. return new Point(0, 0);
  42. }
  43. }
  44. }