PalmImage.cs 1.2 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. CvInvoke.cvFindContours(image.Ptr, storage.Ptr,
  27. }
  28. public bool belongsToPalm(int x, int y)
  29. {
  30. return false;
  31. }
  32. private Point getPointWithDepth(Int16 depth)
  33. {
  34. for (int x = 0; x < width; ++x)
  35. {
  36. for (int y = 0; y < height; ++y)
  37. {
  38. if (image.Data[y, x, 0] == depth)
  39. return new Point(x, y);
  40. }
  41. }
  42. return new Point(0, 0);
  43. }
  44. }
  45. }