NVIDIA DeepStream SDK API Reference

5.0 Release

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
nvdstracker.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019-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 
28 #ifndef _NVMOTRACKER_H_
29 #define _NVMOTRACKER_H_
30 
31 #include <stdint.h>
32 #include <time.h>
33 
34 #include "nvbufsurface.h"
35 #include "nvds_tracker_meta.h"
36 
37 #ifdef __cplusplus
38 extern "C"
39 {
40 #endif
41 
42 #define NVMOT_MAX_TRANSFORMS 4
43 
44 typedef uint64_t NvMOTStreamId;
45 
52 #define NVMOTCOMP_GPU 0x01
53 #define NVMOTCOMP_CPU 0x02
54 #define NVMOTCOMP_PVA 0x04
55 #define NVMOTCOMP_ANY 0xff
57 #define NVMOTCOMP_DEFAULT NVMOTCOMP_ANY
58 
62 typedef uint8_t NvMOTCompute;
63 
68 typedef struct _NvMOTPerTransformBatchConfig
69 {
73  uint32_t maxWidth;
75  uint32_t maxHeight;
77  uint32_t maxPitch;
79  uint32_t maxSize;
81  uint32_t colorFormat;
83 
84 
88 typedef struct _NvMOTMiscConfig
89 {
91  uint32_t gpuId;
94  uint32_t maxObjPerStream;
97  uint32_t maxObjPerBatch;
99  typedef void (*logMsg) (int logLevel, const char * format, ...);
101 
110 typedef struct _NvMOTConfig
111 {
113  NvMOTCompute computeConfig;
115  uint32_t maxStreams;
118  uint8_t numTransforms;
125  uint16_t customConfigFilePathSize;
128  char* customConfigFilePath;
130 
134 typedef enum
135 {
141 
148 typedef struct _NvMOTConfigResponse
149 {
162 
166 typedef enum
167 {
172 
176 typedef struct _NvMOTRect
177 {
179  float x;
181  float y;
183  float width;
185  float height;
187 
193 typedef struct _NvMOTObjToTrack
194 {
196  uint16_t classId;
198  NvMOTRect bbox;
200  float confidence;
202  bool doTracking;
204  void *pPreservedData;
206 
210 typedef struct _NvMOTObjToTrackList
211 {
214  bool detectionDone;
218  uint32_t numAllocated;
220  uint32_t numFilled;
222 
232 typedef struct _NvMOTFrame
233 {
235  NvMOTStreamId streamID;
238  uint32_t frameNum;
240  time_t timeStamp;
243  bool timeStampValid;
246  bool doTracking;
248  bool reset;
250  uint8_t numBuffers;
258 
262 typedef struct _NvMOTTrackedObj
263 {
265  uint16_t classId;
267  uint64_t trackingId;
269  NvMOTRect bbox;
271  float confidence;
273  uint32_t age;
276  uint8_t reserved[128];
278 
282 typedef struct _NvMOTTrackedObjList
283 {
285  NvMOTStreamId streamID;
287  uint32_t frameNum;
289  bool valid;
293  uint32_t numAllocated;
295  uint32_t numFilled;
297 
301 typedef struct _NvMOTTrackedObjBatch
302 {
306  uint32_t numAllocated;
308  uint32_t numFilled;
310 
316 typedef struct _NvMOTProcessParams
317 {
318  uint32_t numFrames;
321 
322 typedef struct _NvMOTQuery
323 {
325  NvMOTCompute computeConfig;
328  uint8_t numTransforms;
336  bool supportPastFrame;
338 
342 struct NvMOTContext;
343 typedef struct NvMOTContext* NvMOTContextHandle;
363  NvMOTContextHandle *pContextHandle,
364  NvMOTConfigResponse *pConfigResponse);
365 
373 void NvMOT_DeInit(NvMOTContextHandle contextHandle);
374 
393 NvMOTStatus NvMOT_Process(NvMOTContextHandle contextHandle,
394  NvMOTProcessParams *pParams,
395  NvMOTTrackedObjBatch *pTrackedObjectsBatch);
396 
409 NvMOTStatus NvMOT_ProcessPast(NvMOTContextHandle contextHandle,
410  NvMOTProcessParams *pParams,
411  NvDsPastFrameObjBatch *pPastFrameObjBatch);
426 NvMOTStatus NvMOT_Query(uint16_t customConfigFilePathSize, char* pCustomConfigFilePath, NvMOTQuery *pQuery);
427 
428 
444 void NvMOT_RemoveStreams(NvMOTContextHandle contextHandle, NvMOTStreamId streamIdMask);
445  // end of API group
447 
448 #ifdef __cplusplus
449 }
450 #endif
451 
452 #endif
uint16_t customConfigFilePathSize
Holds the length of customConfigFilePath.
Definition: nvdstracker.h:126
Holds a configuration for batches for an input transform (a scaling/color conversion).
Definition: nvdstracker.h:69
struct _NvMOTPerTransformBatchConfig NvMOTPerTransformBatchConfig
Holds a configuration for batches for an input transform (a scaling/color conversion).
Holds a batch of lists of tracked objects.
Definition: nvdstracker.h:302
uint32_t maxObjPerBatch
Holds the maximum number of objects to track per batch.
Definition: nvdstracker.h:98
NvBufSurfaceColorFormat
Specifies color formats for NvBufSurface.
Definition: nvbufsurface.h:66
uint8_t numTransforms
Holds the number of NvMOTPerTransformBatchConfig entries in perTransformBatchConfig.
Definition: nvdstracker.h:329
NvBufSurface Interface
NvMOTCompute computeConfig
Holds the compute target.
Definition: nvdstracker.h:114
struct _NvMOTObjToTrackList NvMOTObjToTrackList
Holds a list of objects.
Holds information about each tracked object.
Definition: nvdstracker.h:263
uint32_t numFilled
Holds the number of populated blocks in the list.
Definition: nvdstracker.h:221
NvMOTStatus NvMOT_Query(uint16_t customConfigFilePathSize, char *pCustomConfigFilePath, NvMOTQuery *pQuery)
Queries the tracker library's capabilities and requirements.
float width
Holds the width of the bounding box, in pixels.
Definition: nvdstracker.h:184
Batch of lists of buffered objects.
uint8_t reserved[128]
Definition: nvdstracker.h:277
uint32_t maxStreams
Holds the maximum number of streams in a batch.
Definition: nvdstracker.h:116
bool reset
Holds a Boolean which is true to reset tracking for the stream.
Definition: nvdstracker.h:249
void NvMOT_DeInit(NvMOTContextHandle contextHandle)
Deinitializes a stream context.
struct NvMOTContext * NvMOTContextHandle
Definition: nvdstracker.h:344
uint64_t NvMOTStreamId
Definition: nvdstracker.h:44
uint8_t numTransforms
Holds the number of NvMOTPerTransformBatchConfig entries in perTransformBatchConfig.
Definition: nvdstracker.h:119
NvMOTObjToTrackList objectsIn
Holds a list of objects in this frame which are to be tracked.
Definition: nvdstracker.h:257
char * customConfigFilePath
A pointer to the pathname of the tracker's custom configuration file.
Definition: nvdstracker.h:129
Holds a tracker configuration.
Definition: nvdstracker.h:111
NvMOTTrackedObj * list
Holds a pointer to a list or array of object information blocks.
Definition: nvdstracker.h:292
uint16_t classId
Holds the class of the object.
Definition: nvdstracker.h:197
NvMOTConfigStatus transformBatchStatus
Holds the transform batch configuration request status: summary status for all transforms.
Definition: nvdstracker.h:157
NvMOTCompute computeConfig
Holds flags for supported compute targets.
Definition: nvdstracker.h:326
float y
Holds the top edge position of the object bounding box, in pixels.
Definition: nvdstracker.h:182
NvMOTFrame * frameList
Holds a pointer to an array of frame data.
Definition: nvdstracker.h:320
struct _NvMOTConfigResponse NvMOTConfigResponse
Holds a tracker's configuration status.
bool doTracking
Holds a Boolean which is true if NvMOT is to track this object.
Definition: nvdstracker.h:203
bool doTracking
Holds a Boolean which is true if objects in this frame are to be tracked.
Definition: nvdstracker.h:247
struct _NvMOTRect NvMOTRect
Holds the definition of a rectangle.
NvMOTRect bbox
Holds the bounding box.
Definition: nvdstracker.h:270
uint32_t maxHeight
Holds the maximum height of each frame.
Definition: nvdstracker.h:76
struct _NvMOTObjToTrack NvMOTObjToTrack
Holds information about an object to be tracked.
Holds information about a single buffer in a batch.
Definition: nvbufsurface.h:253
uint32_t numAllocated
Holds the number of blocks allocated for the list.
Definition: nvdstracker.h:294
uint32_t numAllocated
Holds the number of blocks allocated for the list.
Definition: nvdstracker.h:307
uint32_t frameNum
Holds the frame number for objects in the list.
Definition: nvdstracker.h:288
struct _NvMOTTrackedObjList NvMOTTrackedObjList
Holds a list of tracked objects.
Holds miscellaneous configurations.
Definition: nvdstracker.h:89
NvBufSurfaceColorFormat colorFormats[NVMOT_MAX_TRANSFORMS]
Holds the color formats for input buffers; a required value.
Definition: nvdstracker.h:331
void(* logMsg)(int logLevel, const char *format,...)
Holds a pointer to a callback for logging messages.
Definition: nvdstracker.h:100
Defines Tracker Metadata
NvMOTStatus NvMOT_Process(NvMOTContextHandle contextHandle, NvMOTProcessParams *pParams, NvMOTTrackedObjBatch *pTrackedObjectsBatch)
Processes a batch.
NvMOTConfigStatus
Defines configuration request return codes.
Definition: nvdstracker.h:135
struct _NvMOTMiscConfig NvMOTMiscConfig
Holds miscellaneous configurations.
uint8_t numBuffers
Holds the number of entries in bufferList.
Definition: nvdstracker.h:251
NvMOTConfigStatus computeStatus
Holds the compute target request status.
Definition: nvdstracker.h:154
uint32_t colorFormat
Holds the color format: RGB, NV12 etc.
Definition: nvdstracker.h:82
uint16_t classId
Holds the class ID of the object to be tracked.
Definition: nvdstracker.h:266
NvMOTConfigStatus miscConfigStatus
Holds the status of the miscellaneous configurations.
Definition: nvdstracker.h:159
Holds a list of objects.
Definition: nvdstracker.h:211
uint64_t trackingId
Holds a unique ID for the object, assigned by the tracker.
Definition: nvdstracker.h:268
struct _NvMOTProcessParams NvMOTProcessParams
Holds parameters for processing a batch.
void NvMOT_RemoveStreams(NvMOTContextHandle contextHandle, NvMOTStreamId streamIdMask)
Removes streams from a batch.
uint32_t gpuId
Holds the ID of the GPU to be used.
Definition: nvdstracker.h:92
NvMOTStatus NvMOT_Init(NvMOTConfig *pConfigIn, NvMOTContextHandle *pContextHandle, NvMOTConfigResponse *pConfigResponse)
Initializes a tracking context for a batch of one or more image streams.
#define NVMOT_MAX_TRANSFORMS
Definition: nvdstracker.h:42
NvMOTMiscConfig miscConfig
Holds miscellaneous configurations.
Definition: nvdstracker.h:124
NvMOTStatus NvMOT_ProcessPast(NvMOTContextHandle contextHandle, NvMOTProcessParams *pParams, NvDsPastFrameObjBatch *pPastFrameObjBatch)
Process the past-frame data in the low-level tracker lib and retrieve.
NvMOTObjToTrack * list
Holds a pointer to a list or array of object information blocks.
Definition: nvdstracker.h:217
bool supportBatchProcessing
Holds a Boolean which is true if batch processing is supported.
Definition: nvdstracker.h:335
bool detectionDone
Holds a Boolean which is true if detection was done on this frame even if the list of objects to trac...
Definition: nvdstracker.h:215
float x
Holds the left edge position of the object bounding box, in pixels.
Definition: nvdstracker.h:180
bool timeStampValid
Holds a Boolean which is true if the timestamp value is properly populated.
Definition: nvdstracker.h:244
Holds a list of tracked objects.
Definition: nvdstracker.h:283
uint32_t maxSize
Holds the maximum size of the buffer in bytes.
Definition: nvdstracker.h:80
float confidence
Holds the detection confidence of the object.
Definition: nvdstracker.h:201
uint32_t age
Holds the track length in frames.
Definition: nvdstracker.h:274
NvMOTPerTransformBatchConfig * perTransformBatchConfig
Holds a pointer to a list of numTransform batch configurations, one per transform, including type and resolution.
Definition: nvdstracker.h:122
NvMOTStatus
Defines generic status codes for tracking operations.
Definition: nvdstracker.h:167
struct _NvMOTTrackedObjBatch NvMOTTrackedObjBatch
Holds a batch of lists of tracked objects.
struct _NvMOTQuery NvMOTQuery
uint32_t frameNum
Holds the sequential frame number that identifies the frame within the stream.
Definition: nvdstracker.h:239
uint32_t numFrames
Holds the number of frames in the batch.
Definition: nvdstracker.h:319
Holds parameters for processing a batch.
Definition: nvdstracker.h:317
NvMOTRect bbox
Holds the bounding box of the object.
Definition: nvdstracker.h:199
Holds a tracker's configuration status.
Definition: nvdstracker.h:149
NvBufSurfaceMemType
Specifies memory types for NvBufSurface.
Definition: nvbufsurface.h:170
uint32_t maxObjPerStream
Holds the maximum number of objects to track per stream.
Definition: nvdstracker.h:95
NvBufSurfaceMemType bufferType
Holds the type of buffer.
Definition: nvdstracker.h:72
time_t timeStamp
Holds the timestamp of the frame at the time of capture.
Definition: nvdstracker.h:241
NvBufSurfaceMemType memType
Holds the preferred memory type for input buffers.
Definition: nvdstracker.h:333
NvMOTConfigStatus customConfigStatus
Holds the status of the custom configurations.
Definition: nvdstracker.h:161
struct _NvMOTConfig NvMOTConfig
Holds a tracker configuration.
NvMOTStreamId streamID
Holds the stream ID of the stream associated with objects in the list.
Definition: nvdstracker.h:286
NvMOTConfigStatus summaryStatus
Holds the summary status of the entire configuration request.
Definition: nvdstracker.h:152
uint32_t numAllocated
Holds the number of blocks allocated for the list.
Definition: nvdstracker.h:219
float height
Holds the height of the bounding box, in pixels.
Definition: nvdstracker.h:186
Holds the definition of a rectangle.
Definition: nvdstracker.h:177
Holds a frame containing the image and objects to be tracked.
Definition: nvdstracker.h:233
Holds information about an object to be tracked.
Definition: nvdstracker.h:194
uint32_t maxWidth
Holds the maximum width of each frame.
Definition: nvdstracker.h:74
uint32_t numFilled
Holds the number of filled blocks in the list.
Definition: nvdstracker.h:309
float confidence
Holds the tracking confidence of the object.
Definition: nvdstracker.h:272
uint8_t NvMOTCompute
Definition: nvdstracker.h:63
void * pPreservedData
Holds a pointer to client data associated with the object.
Definition: nvdstracker.h:205
bool valid
Holds a Boolean which is true if this entry in the batch is valid.
Definition: nvdstracker.h:290
uint32_t maxPitch
Holds the maximum pitch of each buffer.
Definition: nvdstracker.h:78
struct _NvMOTFrame NvMOTFrame
Holds a frame containing the image and objects to be tracked.
uint32_t numFilled
Holds the number of populated blocks in the list.
Definition: nvdstracker.h:296
NvMOTObjToTrack * associatedObjectIn
Holds a pointer to the associated input object, if there is one.
Definition: nvdstracker.h:276
NvBufSurfaceParams ** bufferList
Holds a pointer to an array of pointers to buffer parameter structures.
Definition: nvdstracker.h:254
struct _NvMOTTrackedObj NvMOTTrackedObj
Holds information about each tracked object.
NvMOTTrackedObjList * list
Holds a pointer to an array of object lists.
Definition: nvdstracker.h:305
bool supportPastFrame
Holds a Boolean which is true if outputing past frame is supported.
Definition: nvdstracker.h:337
NvMOTStreamId streamID
Holds the stream ID of the stream source for this frame.
Definition: nvdstracker.h:236