IVideoDataSource.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. using System;
  2. using MathNet.Numerics.LinearAlgebra.Single;
  3. namespace bbiwarg.DataSource
  4. {
  5. public enum FingerStatus
  6. {
  7. Inactive,
  8. Detected,
  9. Tracked
  10. }
  11. public enum HandSide
  12. {
  13. Unknown,
  14. Left,
  15. Right
  16. }
  17. /*
  18. * Interface get data from a camera or a video file.
  19. * Completely independent of iisu.
  20. */
  21. interface IVideoDataSource
  22. {
  23. /*
  24. * Initializes the data source.
  25. */
  26. void init();
  27. /*
  28. * Starts the recording of data.
  29. */
  30. void start();
  31. /*
  32. * Stops the recording of data.
  33. */
  34. void stop();
  35. /*
  36. * Updates the data for the current frame.
  37. * Needs to be called before any method to read data.
  38. */
  39. void updateFrame();
  40. /*
  41. * Lets the data source process the next frame.
  42. */
  43. void releaseFrame();
  44. /*
  45. * Returns true iff new data is generated.
  46. * (e.g camera is running or video hasn't ended)
  47. */
  48. bool isActive();
  49. int getFrameRate();
  50. /**
  51. * The depth is given by the distance to the camera in millimeters.
  52. */
  53. DepthImage getDepthImage();
  54. ColorImage getColorImage();
  55. /*
  56. * all handIndices have to be 1 or 2
  57. */
  58. bool isHandOpen(uint handIndex);
  59. Vector getPalmPosition3D(uint handIndex);
  60. Vector getTipPosition3D(uint handIndex);
  61. Vector getForearmPosition3D(uint handIndex);
  62. Vector getPalmNormal3D(uint handIndex);
  63. FingerStatus[] getFingerStatus(uint handIndex);
  64. Vector[] getFingerTipPositions3D(uint handIndex);
  65. HandSide getHandSide(uint handIndex);
  66. }
  67. }