nvdsmeta_schema.h 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. /*
  2. * Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.
  3. *
  4. * NVIDIA Corporation and its licensors retain all intellectual property
  5. * and proprietary rights in and to this software, related documentation
  6. * and any modifications thereto. Any use, reproduction, disclosure or
  7. * distribution of this software and related documentation without an express
  8. * license agreement from NVIDIA Corporation is strictly prohibited.
  9. *
  10. */
  11. /**
  12. * @file
  13. * <b>NVIDIA DeepStream: Metadata Extension Structures</b>
  14. *
  15. * @b Description: This file defines the NVIDIA DeepStream metadata structures
  16. * used to describe metadata objects.
  17. */
  18. /**
  19. * @defgroup metadata_extensions Metadata Extension Structures
  20. *
  21. * Defines metadata structures used to describe metadata objects.
  22. *
  23. * @ingroup NvDsMetaApi
  24. * @{
  25. */
  26. #ifndef NVDSMETA_H_
  27. #define NVDSMETA_H_
  28. #include <glib.h>
  29. #ifdef __cplusplus
  30. extern "C"
  31. {
  32. #endif
  33. /**
  34. * Defines event type flags.
  35. */
  36. typedef enum NvDsEventType {
  37. NVDS_EVENT_ENTRY,
  38. NVDS_EVENT_EXIT,
  39. NVDS_EVENT_MOVING,
  40. NVDS_EVENT_STOPPED,
  41. NVDS_EVENT_EMPTY,
  42. NVDS_EVENT_PARKED,
  43. NVDS_EVENT_RESET,
  44. /** Reserved for future use. Custom events must be assigned values
  45. greater than this. */
  46. NVDS_EVENT_RESERVED = 0x100,
  47. /** Specifies a custom event. */
  48. NVDS_EVENT_CUSTOM = 0x101,
  49. NVDS_EVENT_FORCE32 = 0x7FFFFFFF
  50. } NvDsEventType;
  51. /**
  52. * Defines object type flags.
  53. */
  54. typedef enum NvDsObjectType {
  55. NVDS_OBJECT_TYPE_VEHICLE,
  56. NVDS_OBJECT_TYPE_PERSON,
  57. NVDS_OBJECT_TYPE_FACE,
  58. NVDS_OBJECT_TYPE_BAG,
  59. NVDS_OBJECT_TYPE_BICYCLE,
  60. NVDS_OBJECT_TYPE_ROADSIGN,
  61. /** Reserved for future use. Custom objects must be assigned values
  62. greater than this. */
  63. NVDS_OBJECT_TYPE_RESERVED = 0x100,
  64. /** Specifies a custom object. */
  65. NVDS_OBJECT_TYPE_CUSTOM = 0x101,
  66. /** "object" key will be missing in the schema */
  67. NVDS_OBJECT_TYPE_UNKNOWN = 0x102,
  68. NVDS_OBEJCT_TYPE_FORCE32 = 0x7FFFFFFF
  69. } NvDsObjectType;
  70. /**
  71. * Defines payload type flags.
  72. */
  73. typedef enum NvDsPayloadType {
  74. NVDS_PAYLOAD_DEEPSTREAM,
  75. NVDS_PAYLOAD_DEEPSTREAM_MINIMAL,
  76. /** Reserved for future use. Custom payloads must be assigned values
  77. greater than this. */
  78. NVDS_PAYLOAD_RESERVED = 0x100,
  79. /** Specifies a custom payload. You must implement the nvds_msg2p_*
  80. interface. */
  81. NVDS_PAYLOAD_CUSTOM = 0x101,
  82. NVDS_PAYLOAD_FORCE32 = 0x7FFFFFFF
  83. } NvDsPayloadType;
  84. /**
  85. * Holds a rectangle's position and size.
  86. */
  87. typedef struct NvDsRect {
  88. float top; /**< Holds the position of rectangle's top in pixels. */
  89. float left; /**< Holds the position of rectangle's left side in pixels. */
  90. float width; /**< Holds the rectangle's width in pixels. */
  91. float height; /**< Holds the rectangle's height in pixels. */
  92. } NvDsRect;
  93. /**
  94. * Holds geolocation parameters.
  95. */
  96. typedef struct NvDsGeoLocation {
  97. gdouble lat; /**< Holds the location's latitude. */
  98. gdouble lon; /**< Holds the location's longitude. */
  99. gdouble alt; /**< Holds the location's altitude. */
  100. } NvDsGeoLocation;
  101. /**
  102. * Hold a coordinate's position.
  103. */
  104. typedef struct NvDsCoordinate {
  105. gdouble x; /**< Holds the coordinate's X position. */
  106. gdouble y; /**< Holds the coordinate's Y position. */
  107. gdouble z; /**< Holds the coordinate's Z position. */
  108. } NvDsCoordinate;
  109. /**
  110. * Holds an object's signature.
  111. */
  112. typedef struct NvDsObjectSignature {
  113. /** Holds a pointer to an array of signature values. */
  114. gdouble *signature;
  115. /** Holds the number of signature values in @a signature. */
  116. guint size;
  117. } NvDsObjectSignature;
  118. /**
  119. * Holds a vehicle object's parameters.
  120. */
  121. typedef struct NvDsVehicleObject {
  122. gchar *type; /**< Holds a pointer to the type of the vehicle. */
  123. gchar *make; /**< Holds a pointer to the make of the vehicle. */
  124. gchar *model; /**< Holds a pointer to the model of the vehicle. */
  125. gchar *color; /**< Holds a pointer to the color of the vehicle. */
  126. gchar *region; /**< Holds a pointer to the region of the vehicle. */
  127. gchar *license; /**< Holds a pointer to the license number of the vehicle.*/
  128. } NvDsVehicleObject;
  129. /**
  130. * Holds a person object's parameters.
  131. */
  132. typedef struct NvDsPersonObject {
  133. gchar *gender; /**< Holds a pointer to the person's gender. */
  134. gchar *hair; /**< Holds a pointer to the person's hair color. */
  135. gchar *cap; /**< Holds a pointer to the type of cap the person is
  136. wearing, if any. */
  137. gchar *apparel; /**< Holds a pointer to a description of the person's
  138. apparel. */
  139. guint age; /**< Holds the person's age. */
  140. } NvDsPersonObject;
  141. /**
  142. * Holds a face object's parameters.
  143. */
  144. typedef struct NvDsFaceObject {
  145. gchar *gender; /**< Holds a pointer to the person's gender. */
  146. gchar *hair; /**< Holds a pointer to the person's hair color. */
  147. gchar *cap; /**< Holds a pointer to the type of cap the person
  148. is wearing, if any. */
  149. gchar *glasses; /**< Holds a pointer to the type of glasses the person
  150. is wearing, if any. */
  151. gchar *facialhair;/**< Holds a pointer to the person's facial hair color. */
  152. gchar *name; /**< Holds a pointer to the person's name. */
  153. gchar *eyecolor; /**< Holds a pointer to the person's eye color. */
  154. guint age; /**< Holds the person's age. */
  155. } NvDsFaceObject;
  156. /**
  157. * Holds event message meta data.
  158. *
  159. * You can attach various types of objects (vehicle, person, face, etc.)
  160. * to an event by setting a pointer to the object in @a extMsg.
  161. *
  162. * Similarly, you can attach a custom object to an event by setting a pointer to the object in @a extMsg.
  163. * A custom object must be handled by the metadata parsing module accordingly.
  164. */
  165. typedef struct NvDsEventMsgMeta {
  166. /** Holds the event's type. */
  167. NvDsEventType type;
  168. /** Holds the object's type. */
  169. NvDsObjectType objType;
  170. /** Holds the object's bounding box. */
  171. NvDsRect bbox;
  172. /** Holds the object's geolocation. */
  173. NvDsGeoLocation location;
  174. /** Holds the object's coordinates. */
  175. NvDsCoordinate coordinate;
  176. /** Holds the object's signature. */
  177. NvDsObjectSignature objSignature;
  178. /** Holds the object's class ID. */
  179. gint objClassId;
  180. /** Holds the ID of the sensor that generated the event. */
  181. gint sensorId;
  182. /** Holds the ID of the analytics module that generated the event. */
  183. gint moduleId;
  184. /** Holds the ID of the place related to the object. */
  185. gint placeId;
  186. /** Holds the ID of the component (plugin) that generated this event. */
  187. gint componentId;
  188. /** Holds the video frame ID of this event. */
  189. gint frameId;
  190. /** Holds the confidence level of the inference. */
  191. gdouble confidence;
  192. /** Holds the object's tracking ID. */
  193. gint trackingId;
  194. /** Holds a pointer to the generated event's timestamp. */
  195. gchar *ts;
  196. /** Holds a pointer to the detected or inferred object's ID. */
  197. gchar *objectId;
  198. /** Holds a pointer to a string containing the sensor's identity. */
  199. gchar *sensorStr;
  200. /** Holds a pointer to a string containing other attributes associated with
  201. the object. */
  202. gchar *otherAttrs;
  203. /** Holds a pointer to the name of the video file. */
  204. gchar *videoPath;
  205. /** Holds a pointer to event message meta data. This can be used to hold
  206. data that can't be accommodated in the existing fields, or an associated
  207. object (representing a vehicle, person, face, etc.). */
  208. gpointer extMsg;
  209. /** Holds the size of the custom object at @a extMsg. */
  210. guint extMsgSize;
  211. /*My data*/
  212. guint occupancy;
  213. guint source_id;
  214. guint lccum_cnt_entry;
  215. guint lccum_cnt_exit;
  216. } NvDsEventMsgMeta;
  217. /**
  218. * Holds event information.
  219. */
  220. typedef struct _NvDsEvent {
  221. /** Holds the type of event. */
  222. NvDsEventType eventType;
  223. /** Holds a pointer to event metadata. */
  224. NvDsEventMsgMeta *metadata;
  225. } NvDsEvent;
  226. /**
  227. * Holds payload metadata.
  228. */
  229. typedef struct NvDsPayload {
  230. /** Holds a pointer to the payload. */
  231. gpointer payload;
  232. /** Holds the size of the payload. */
  233. guint payloadSize;
  234. /** Holds the ID of the component (plugin) which attached the payload
  235. (optional). */
  236. guint componentId;
  237. } NvDsPayload;
  238. #ifdef __cplusplus
  239. }
  240. #endif
  241. #endif /* NVDSMETA_H_ */
  242. /** @} */