IVideoDataSource.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. using System;
  2. using MathNet.Numerics.LinearAlgebra.Single;
  3. namespace bbiwarg
  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. DepthImage getDepthImage();
  51. /*
  52. * all handIndices have to be 1 or 2
  53. */
  54. bool isHandOpen(uint handIndex);
  55. Vector getPalmPosition3D(uint handIndex);
  56. Vector getTipPosition3D(uint handIndex);
  57. Vector getForearmPosition3D(uint handIndex);
  58. Vector getPalmNormal3D(uint handIndex);
  59. FingerStatus[] getFingerStatus(uint handIndex);
  60. Vector[] getFingerTipPositions3D(uint handIndex);
  61. HandSide getHandSide(uint handIndex);
  62. }
  63. }