VzenseDS_types.py 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. import os, platform, numpy
  2. from ctypes import *
  3. from enum import Enum
  4. class VzRGB888Pixel(Structure):
  5. _pack_ = 1
  6. _fields_ = [("r", c_uint8),
  7. ("g", c_uint8),
  8. ("b", c_uint8)]
  9. class VzBGR888Pixel(Structure):
  10. _pack_ = 1
  11. _fields_ = [("g", c_uint8),
  12. ("g", c_uint8),
  13. ("r", c_uint8)]
  14. class VzVector3f(Structure):
  15. _pack_ = 1
  16. _fields_ = [("x", c_float),
  17. ("y", c_float),
  18. ("z", c_float)]
  19. class VzVector2u16(Structure):
  20. _pack_ = 1
  21. _fields_ = [("x", c_uint16),
  22. ("y", c_uint16)]
  23. class VzDepthVector3(Structure):
  24. _pack_ = 1
  25. _fields_ = [("depthX", c_int),
  26. ("depthY", c_int),
  27. ("depthZ", c_uint16)]
  28. class VzSensorIntrinsicParameters(Structure):
  29. _pack_ = 1
  30. _fields_ = [("fx", c_double),
  31. ("fy", c_double),
  32. ("cx", c_double),
  33. ("cy", c_double),
  34. ("k1", c_double),
  35. ("k2", c_double),
  36. ("p1", c_double),
  37. ("p2", c_double),
  38. ("k3", c_double),
  39. ("k4", c_double),
  40. ("k5", c_double),
  41. ("k6", c_double)]
  42. class VzSensorExtrinsicParameters(Structure):
  43. _pack_ = 1
  44. _fields_ = [("rotation", c_double * 9),
  45. ("translation", c_double * 3)]
  46. class VzTimeStamp(Structure):
  47. _pack_ = 1
  48. _fields_ = [("tm_sec", c_uint16),
  49. ("tm_min", c_uint16),
  50. ("tm_hour", c_uint16),
  51. ("tm_msec", c_uint16)]
  52. class VzFrame(Structure):
  53. _pack_ = 1
  54. _fields_ = [("frameIndex", c_uint32),
  55. ("frameType", c_int32),
  56. ("pixelFormat", c_int32),
  57. ("pFrameData", POINTER(c_uint8)),
  58. ("dataLen", c_uint32),
  59. ("exposureTime", c_float),
  60. ("depthRange", c_uint8),
  61. ("width", c_uint16),
  62. ("height", c_uint16),
  63. ("hardwaretimestamp", c_uint64)]
  64. class VzFrameReady(Structure):
  65. _pack_ = 1
  66. _fields_ = [("depth", c_uint, 1),
  67. ("ir", c_uint, 1),
  68. ("color", c_uint, 1),
  69. ("transformedColor", c_uint, 1),
  70. ("transformedDepth", c_uint, 1),
  71. ("transformedIR", c_uint, 1),
  72. ("confidence", c_uint, 1),
  73. ("reserved", c_uint, 25)]
  74. class VzDeviceInfo(Structure):
  75. _pack_ = 1
  76. _fields_ = [("productName", c_char * 64),
  77. ("uri", c_char * 256),
  78. ("alias", c_char * 64),
  79. ("serialNumber", c_char * 64),
  80. ("ip", c_char * 17),
  81. ("status", c_int32)]
  82. class VzConfidenceFilterParams(Structure):
  83. _pack_ = 1
  84. _fields_ = [("threshold", c_int32),
  85. ("enable", c_bool)]
  86. class VzFlyingPixelFilterParams(Structure):
  87. _pack_ = 1
  88. _fields_ = [("threshold", c_int32),
  89. ("enable", c_bool)]
  90. class VzTimeFilterParams(Structure):
  91. _pack_ = 1
  92. _fields_ = [("threshold", c_int32),
  93. ("enable", c_bool)]
  94. class VzExposureTimeParams(Structure):
  95. _pack_ = 1
  96. _fields_ = [("mode", c_int32),
  97. ("exposureTime", c_int32)]