NVIDIA DeepStream SDK API Reference

6.1.1 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;
117  uint32_t maxBufSurfAddrSize;
120  uint8_t numTransforms;
127  uint16_t customConfigFilePathSize;
130  char* customConfigFilePath;
132 
136 typedef enum
137 {
143 
150 typedef struct _NvMOTConfigResponse
151 {
164 
168 typedef enum
169 {
174 
178 typedef enum
179 {
183  NvMOTBatchMode_Batch = 1 << 0,
185  NvMOTBatchMode_NonBatch = 1 << 1,
189 
193 typedef struct _NvMOTRect
194 {
196  float x;
198  float y;
200  float width;
202  float height;
204 
210 typedef struct _NvMOTObjToTrack
211 {
213  uint16_t classId;
215  NvMOTRect bbox;
217  float confidence;
219  bool doTracking;
221  void *pPreservedData;
223 
227 typedef struct _NvMOTObjToTrackList
228 {
231  bool detectionDone;
235  uint32_t numAllocated;
237  uint32_t numFilled;
239 
249 typedef struct _NvMOTFrame
250 {
252  NvMOTStreamId streamID;
255  uint32_t frameNum;
257  uint32_t srcFrameWidth;
259  uint32_t srcFrameHeight;
261  time_t timeStamp;
264  bool timeStampValid;
267  bool doTracking;
269  bool reset;
271  uint8_t numBuffers;
279 
283 typedef struct _NvMOTTrackedObj
284 {
286  uint16_t classId;
288  uint64_t trackingId;
290  NvMOTRect bbox;
292  float confidence;
294  uint32_t age;
297  uint8_t reserved[128];
299 
303 typedef struct _NvMOTTrackedObjList
304 {
306  NvMOTStreamId streamID;
308  uint32_t frameNum;
310  bool valid;
314  uint32_t numAllocated;
316  uint32_t numFilled;
318 
322 typedef struct _NvMOTTrackedObjBatch
323 {
327  uint32_t numAllocated;
329  uint32_t numFilled;
331 
337 typedef struct _NvMOTProcessParams
338 {
339  uint32_t numFrames;
342 
343 typedef struct _NvMOTQuery
344 {
346  NvMOTCompute computeConfig;
349  uint8_t numTransforms;
357  bool supportPastFrame;
359 
363 struct NvMOTContext;
364 typedef struct NvMOTContext* NvMOTContextHandle;
384  NvMOTContextHandle *pContextHandle,
385  NvMOTConfigResponse *pConfigResponse);
386 
394 void NvMOT_DeInit(NvMOTContextHandle contextHandle);
395 
414 NvMOTStatus NvMOT_Process(NvMOTContextHandle contextHandle,
415  NvMOTProcessParams *pParams,
416  NvMOTTrackedObjBatch *pTrackedObjectsBatch);
417 
430 NvMOTStatus NvMOT_ProcessPast(NvMOTContextHandle contextHandle,
431  NvMOTProcessParams *pParams,
432  NvDsPastFrameObjBatch *pPastFrameObjBatch);
447 NvMOTStatus NvMOT_Query(uint16_t customConfigFilePathSize, char* pCustomConfigFilePath, NvMOTQuery *pQuery);
448 
449 
466 NvMOTStatus NvMOT_RemoveStreams(NvMOTContextHandle contextHandle, NvMOTStreamId streamIdMask);
467  // end of API group
469 
470 #ifdef __cplusplus
471 }
472 #endif
473 
474 #endif
uint16_t customConfigFilePathSize
Holds the length of customConfigFilePath.
Definition: nvdstracker.h:128
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:323
uint32_t maxObjPerBatch
Holds the maximum number of objects to track per batch.
Definition: nvdstracker.h:98
NvBufSurfaceColorFormat
Defines color formats for NvBufSurface.
Definition: nvbufsurface.h:103
uint8_t numTransforms
Holds the number of NvMOTPerTransformBatchConfig entries in perTransformBatchConfig.
Definition: nvdstracker.h:350
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:284
uint32_t numFilled
Holds the number of populated blocks in the list.
Definition: nvdstracker.h:238
uint32_t maxBufSurfAddrSize
Holds the max number of surface buffer addresses from buffer pool.
Definition: nvdstracker.h:118
NvMOTStatus NvMOT_Query(uint16_t customConfigFilePathSize, char *pCustomConfigFilePath, NvMOTQuery *pQuery)
Query tracker lib capabilities and requirements.
float width
Holds the width of the bounding box, in pixels.
Definition: nvdstracker.h:201
Batch of lists of buffered objects.
uint8_t reserved[128]
Definition: nvdstracker.h:298
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:270
void NvMOT_DeInit(NvMOTContextHandle contextHandle)
Deinitializes a stream context.
struct NvMOTContext * NvMOTContextHandle
Definition: nvdstracker.h:365
uint64_t NvMOTStreamId
Definition: nvdstracker.h:44
uint8_t numTransforms
Holds the number of NvMOTPerTransformBatchConfig entries in perTransformBatchConfig.
Definition: nvdstracker.h:121
NvMOTObjToTrackList objectsIn
Holds a list of objects in this frame which are to be tracked.
Definition: nvdstracker.h:278
char * customConfigFilePath
A pointer to the pathname of the tracker's custom configuration file.
Definition: nvdstracker.h:131
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:313
Unsupported batch mode.
Definition: nvdstracker.h:182
uint16_t classId
Holds the class of the object.
Definition: nvdstracker.h:214
NvMOTConfigStatus transformBatchStatus
Holds the transform batch configuration request status: summary status for all transforms.
Definition: nvdstracker.h:159
NvMOTCompute computeConfig
Holds flags for supported compute targets.
Definition: nvdstracker.h:347
float y
Holds the top edge position of the object bounding box, in pixels.
Definition: nvdstracker.h:199
NvMOTFrame * frameList
Holds a pointer to an array of frame data.
Definition: nvdstracker.h:341
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:220
bool doTracking
Holds a Boolean which is true if objects in this frame are to be tracked.
Definition: nvdstracker.h:268
struct _NvMOTRect NvMOTRect
Holds the definition of a rectangle.
Max value of the enum.
Definition: nvdstracker.h:188
NvMOTRect bbox
Holds the bounding box.
Definition: nvdstracker.h:291
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.
Hold the information of single buffer in the batch.
Definition: nvbufsurface.h:427
uint32_t numAllocated
Holds the number of blocks allocated for the list.
Definition: nvdstracker.h:315
uint32_t numAllocated
Holds the number of blocks allocated for the list.
Definition: nvdstracker.h:328
uint32_t frameNum
Holds the frame number for objects in the list.
Definition: nvdstracker.h:309
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:352
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:137
struct _NvMOTMiscConfig NvMOTMiscConfig
Holds miscellaneous configurations.
uint8_t numBuffers
Holds the number of entries in bufferList.
Definition: nvdstracker.h:272
NvMOTConfigStatus computeStatus
Holds the compute target request status.
Definition: nvdstracker.h:156
uint32_t srcFrameHeight
Holds the height of the original source frame.
Definition: nvdstracker.h:260
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:287
NvMOTConfigStatus miscConfigStatus
Holds the status of the miscellaneous configurations.
Definition: nvdstracker.h:161
Holds a list of objects.
Definition: nvdstracker.h:228
uint64_t trackingId
Holds a unique ID for the object, assigned by the tracker.
Definition: nvdstracker.h:289
Batch processing mode.
Definition: nvdstracker.h:184
struct _NvMOTProcessParams NvMOTProcessParams
Holds parameters for processing 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:126
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:234
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:232
float x
Holds the left edge position of the object bounding box, in pixels.
Definition: nvdstracker.h:197
bool timeStampValid
Holds a Boolean which is true if the timestamp value is properly populated.
Definition: nvdstracker.h:265
Holds a list of tracked objects.
Definition: nvdstracker.h:304
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:218
uint32_t age
Holds the track length in frames.
Definition: nvdstracker.h:295
NvMOTPerTransformBatchConfig * perTransformBatchConfig
Holds a pointer to a list of numTransform batch configurations, one per transform, including type and resolution.
Definition: nvdstracker.h:124
NvMOTStatus
Defines generic status codes for tracking operations.
Definition: nvdstracker.h:169
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:256
uint32_t numFrames
Holds the number of frames in the batch.
Definition: nvdstracker.h:340
Holds parameters for processing a batch.
Definition: nvdstracker.h:338
NvMOTStatus NvMOT_RemoveStreams(NvMOTContextHandle contextHandle, NvMOTStreamId streamIdMask)
Removes streams from a batch.
NvMOTRect bbox
Holds the bounding box of the object.
Definition: nvdstracker.h:216
Holds a tracker's configuration status.
Definition: nvdstracker.h:151
NvBufSurfaceMemType
Specifies memory types for NvBufSurface.
Definition: nvbufsurface.h:265
uint32_t maxObjPerStream
Holds the maximum number of objects to track per stream.
Definition: nvdstracker.h:95
uint32_t srcFrameWidth
Holds the width of the original source frame.
Definition: nvdstracker.h:258
NvMOTBatchMode
Bitwise flag to define whether batch/nonbatch mode is supported.
Definition: nvdstracker.h:179
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:262
NvMOTBatchMode batchMode
Holds flags for whether batch or none batch mode is supported.
Definition: nvdstracker.h:356
NvBufSurfaceMemType memType
Holds the preferred memory type for input buffers.
Definition: nvdstracker.h:354
NvMOTConfigStatus customConfigStatus
Holds the status of the custom configurations.
Definition: nvdstracker.h:163
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:307
NvMOTConfigStatus summaryStatus
Holds the summary status of the entire configuration request.
Definition: nvdstracker.h:154
uint32_t numAllocated
Holds the number of blocks allocated for the list.
Definition: nvdstracker.h:236
float height
Holds the height of the bounding box, in pixels.
Definition: nvdstracker.h:203
Holds the definition of a rectangle.
Definition: nvdstracker.h:194
Holds a frame containing the image and objects to be tracked.
Definition: nvdstracker.h:250
Holds information about an object to be tracked.
Definition: nvdstracker.h:211
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:330
float confidence
Holds the tracking confidence of the object.
Definition: nvdstracker.h:293
uint8_t NvMOTCompute
Definition: nvdstracker.h:63
void * pPreservedData
Holds a pointer to client data associated with the object.
Definition: nvdstracker.h:222
bool valid
Holds a Boolean which is true if this entry in the batch is valid.
Definition: nvdstracker.h:311
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:317
Non-batch processing mode.
Definition: nvdstracker.h:186
NvMOTObjToTrack * associatedObjectIn
Holds a pointer to the associated input object, if there is one.
Definition: nvdstracker.h:297
NvBufSurfaceParams ** bufferList
Holds a pointer to an array of pointers to buffer parameter structures.
Definition: nvdstracker.h:275
struct _NvMOTTrackedObj NvMOTTrackedObj
Holds information about each tracked object.
NvMOTTrackedObjList * list
Holds a pointer to an array of object lists.
Definition: nvdstracker.h:326
bool supportPastFrame
Holds a Boolean which is true if outputing past frame is supported.
Definition: nvdstracker.h:358
NvMOTStreamId streamID
Holds the stream ID of the stream source for this frame.
Definition: nvdstracker.h:253