NVIDIA DeepStream SDK API Reference

4.0.2 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, 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 #ifndef _NVMOTRACKER_H_
13 #define _NVMOTRACKER_H_
14 
15 #include <stdint.h>
16 #include <time.h>
17 
18 #include "nvbufsurface.h"
19 
20 #ifdef __cplusplus
21 extern "C"
22 {
23 #endif
24 
29 #define NVMOT_MAX_TRANSFORMS 4
30 
31 typedef uint64_t NvMOTStreamId;
32 
39 #define NVMOTCOMP_GPU 0x01
40 #define NVMOTCOMP_CPU 0x02
41 #define NVMOTCOMP_PVA 0x04
42 #define NVMOTCOMP_ANY 0xff
43 #define NVMOTCOMP_DEFAULT NVMOTCOMP_ANY
44 typedef uint8_t NvMOTCompute;
45 
51 {
53  uint32_t maxWidth;
54  uint32_t maxHeight;
55  uint32_t maxPitch;
56  uint32_t maxSize;
57  uint32_t colorFormat;
59 
60 
65 typedef struct _NvMOTMiscConfig
66 {
67  uint32_t gpuId;
68  uint32_t maxObjPerStream;
69  uint32_t maxObjPerBatch;
70  typedef void (*logMsg) (int logLevel, const char * format, ...);
72 
80 typedef struct _NvMOTConfig
81 {
82  NvMOTCompute computeConfig;
83  uint32_t maxStreams;
84  uint8_t numTransforms;
90 } NvMOTConfig;
91 
95 typedef enum
96 {
102 
108 typedef struct _NvMOTConfigResponse
109 {
116 
120 typedef enum
121 {
125 } NvMOTStatus;
126 
130 typedef struct _NvMOTRect
131 {
132  int x;
133  int y;
134  int width;
135  int height;
136 } NvMOTRect;
137 
141 typedef struct _NvMOTObjToTrack
142 {
143  uint16_t classId;
145  float confidence;
146  bool doTracking;
149 
153 typedef struct _NvMOTObjToTrackList
154 {
158  uint32_t numAllocated;
159  uint32_t numFilled;
161 
169 typedef struct _NvMOTFrame
170 {
171  NvMOTStreamId streamID;
172  uint32_t frameNum;
173  time_t timeStamp;
175  bool doTracking;
176  bool reset;
177  uint8_t numBuffers;
180 } NvMOTFrame;
181 
185 typedef struct _NvMOTTrackedObj
186 {
187  uint16_t classId;
188  uint64_t trackingId;
190  float confidence;
191  uint32_t age;
193  uint8_t reserved[128];
195 
199 typedef struct _NvMOTTrackedObjList
200 {
201  NvMOTStreamId streamID;
202  uint32_t frameNum;
203  bool valid;
205  uint32_t numAllocated;
206  uint32_t numFilled;
208 
212 typedef struct _NvMOTTrackedObjBatch
213 {
215  uint32_t numAllocated;
216  uint32_t numFilled;
218 
224 typedef struct _NvMOTProcessParams
225 {
226  uint32_t numFrames;
229 
230 typedef struct _NvMOTQuery
231 {
232  NvMOTCompute computeConfig;
233  uint8_t numTransforms;
237 } NvMOTQuery;
238 
242 struct NvMOTContext;
243 typedef struct NvMOTContext* NvMOTContextHandle;
244 
261  NvMOTContextHandle *pContextHandle,
262  NvMOTConfigResponse *pConfigResponse);
263 
271 void NvMOT_DeInit(NvMOTContextHandle contextHandle);
272 
286 NvMOTStatus NvMOT_Process(NvMOTContextHandle contextHandle,
287  NvMOTProcessParams *pParams,
288  NvMOTTrackedObjBatch *pTrackedObjectsBatch);
289 
301 NvMOTStatus NvMOT_Query(uint16_t customConfigFilePathSize, char* pCustomConfigFilePath, NvMOTQuery *pQuery);
302 
303 
316 void NvMOT_RemoveStreams(NvMOTContextHandle contextHandle, NvMOTStreamId streamIdMask);
317  // end of API group
319 
320 #ifdef __cplusplus
321 }
322 #endif
323 
324 #endif
NvMOTStatus NvMOT_Process(NvMOTContextHandle contextHandle, NvMOTProcessParams *pParams, NvMOTTrackedObjBatch *pTrackedObjectsBatch)
Process a batch.
uint16_t customConfigFilePathSize
The char length in customConfigFilePath.
Definition: nvdstracker.h:88
Configuration for batches for each input transform (scaling/color conversion)
Definition: nvdstracker.h:50
struct _NvMOTQuery NvMOTQuery
int height
Height of the bounding box in pixels.
Definition: nvdstracker.h:135
Batch of lists of tracked objects.
Definition: nvdstracker.h:212
uint32_t maxObjPerBatch
Max number of objects to track per batch.
Definition: nvdstracker.h:69
NvMOTStatus
Generic status for tracking operations.
Definition: nvdstracker.h:120
uint8_t numTransforms
Number of NvMOTPerTransformBatchConfig entries in perTransformBatchConfig.
Definition: nvdstracker.h:233
NvBufSurface Interface
NvMOTCompute computeConfig
Compute target.
Definition: nvdstracker.h:82
Information for each tracked object.
Definition: nvdstracker.h:185
uint32_t numFilled
Number of populated blocks in the list.
Definition: nvdstracker.h:159
struct NvMOTContext * NvMOTContextHandle
Definition: nvdstracker.h:243
uint8_t reserved[128]
Definition: nvdstracker.h:193
uint32_t maxStreams
Maximum number of streams in a batch.
Definition: nvdstracker.h:83
bool reset
True: reset tracking for the stream.
Definition: nvdstracker.h:176
uint8_t numTransforms
Number of NvMOTPerTransformBatchConfig entries in perTransformBatchConfig.
Definition: nvdstracker.h:84
NvMOTObjToTrackList objectsIn
List of objects to be tracked in this frame.
Definition: nvdstracker.h:179
char * customConfigFilePath
Path to the tracker's custom config file.
Definition: nvdstracker.h:89
Tracker configuration.
Definition: nvdstracker.h:80
NvMOTTrackedObj * list
Pointer to a list/array of object info blocks.
Definition: nvdstracker.h:204
struct _NvMOTProcessParams NvMOTProcessParams
Parameters for processing each batch.
uint16_t classId
Class of the object to be tracked.
Definition: nvdstracker.h:143
NvMOTConfigStatus transformBatchStatus
Transform batch config request status.
Definition: nvdstracker.h:112
NvMOTCompute computeConfig
Supported compute targets.
Definition: nvdstracker.h:232
NvMOTFrame * frameList
Pointer to an array of frame data.
Definition: nvdstracker.h:227
bool doTracking
True: track this object.
Definition: nvdstracker.h:146
uint8_t NvMOTCompute
Definition: nvdstracker.h:44
bool doTracking
True: track objects in this frame; False: do not track this frame.
Definition: nvdstracker.h:175
int width
Width of the bounding box in pixels.
Definition: nvdstracker.h:134
struct _NvMOTObjToTrack NvMOTObjToTrack
Information for each object to be tracked.
NvMOTRect bbox
Bounding box.
Definition: nvdstracker.h:189
int x
Pixel coordinate of left edge of the object bounding box.
Definition: nvdstracker.h:132
uint32_t maxHeight
Maximum height of each frame.
Definition: nvdstracker.h:54
Hold the information of single buffer in the batch.
Definition: nvbufsurface.h:232
uint32_t numAllocated
Number of blocks allocated for the list.
Definition: nvdstracker.h:205
uint32_t numAllocated
Number of blocks allocated for the list.
Definition: nvdstracker.h:215
uint32_t frameNum
Frame number for objects in the list.
Definition: nvdstracker.h:202
Miscellaneous configurations.
Definition: nvdstracker.h:65
NvBufSurfaceColorFormat colorFormats[NVMOT_MAX_TRANSFORMS]
Required color formats for input buffers.
Definition: nvdstracker.h:234
void(* logMsg)(int logLevel, const char *format,...)
Callback for logging messages.
Definition: nvdstracker.h:70
struct _NvMOTObjToTrackList NvMOTObjToTrackList
List of objects.
NvMOTConfigStatus
Configuration request return status.
Definition: nvdstracker.h:95
uint8_t numBuffers
Number of entries in bufferList.
Definition: nvdstracker.h:177
NvMOTConfigStatus computeStatus
Compute target request status.
Definition: nvdstracker.h:111
uint32_t colorFormat
Color format: RGB, NV12 etc.
Definition: nvdstracker.h:57
uint16_t classId
Class of the object to be tracked.
Definition: nvdstracker.h:187
struct _NvMOTTrackedObjList NvMOTTrackedObjList
List of tracked objects.
NvMOTConfigStatus miscConfigStatus
Status of the miscellaneous configs.
Definition: nvdstracker.h:113
List of objects.
Definition: nvdstracker.h:153
struct _NvMOTPerTransformBatchConfig NvMOTPerTransformBatchConfig
Configuration for batches for each input transform (scaling/color conversion)
uint64_t trackingId
Unique ID for the object as assigned by the tracker.
Definition: nvdstracker.h:188
uint32_t gpuId
GPU to be used.
Definition: nvdstracker.h:67
struct _NvMOTMiscConfig NvMOTMiscConfig
Miscellaneous configurations.
NvMOTMiscConfig miscConfig
Miscellaneous configs.
Definition: nvdstracker.h:87
NvMOTObjToTrack * list
Pointer to a list/array of object info blocks.
Definition: nvdstracker.h:157
bool supportBatchProcessing
Whether batch processing is supported.
Definition: nvdstracker.h:236
bool detectionDone
True if detection was done on this frame even if the list of objects to track is empty.
Definition: nvdstracker.h:155
struct _NvMOTTrackedObj NvMOTTrackedObj
Information for each tracked object.
int y
Pixel coordinate of top edge of the object bounding box.
Definition: nvdstracker.h:133
uint64_t NvMOTStreamId
Definition: nvdstracker.h:31
NvBufSurfaceMemType
Defines memory types of NvBufSurface.
Definition: nvbufsurface.h:152
bool timeStampValid
The timestamp value is properly populated.
Definition: nvdstracker.h:174
List of tracked objects.
Definition: nvdstracker.h:199
uint32_t maxSize
Maximum size of the buffer in bytes.
Definition: nvdstracker.h:56
float confidence
Detection confidence of the object.
Definition: nvdstracker.h:145
uint32_t age
Track length in frames.
Definition: nvdstracker.h:191
NvMOTPerTransformBatchConfig * perTransformBatchConfig
List of numTransform batch configs including type and resolution, one for each transform.
Definition: nvdstracker.h:85
uint32_t frameNum
Frame number sequentially identifying the frame within a stream.
Definition: nvdstracker.h:172
uint32_t numFrames
Number of frames in the batch.
Definition: nvdstracker.h:226
Parameters for processing each batch.
Definition: nvdstracker.h:224
NvMOTRect bbox
Bounding box.
Definition: nvdstracker.h:144
Tracker configuration status.
Definition: nvdstracker.h:108
void NvMOT_RemoveStreams(NvMOTContextHandle contextHandle, NvMOTStreamId streamIdMask)
Optional handler for removing streams from a batch.
uint32_t maxObjPerStream
Max number of objects to track per stream.
Definition: nvdstracker.h:68
NvBufSurfaceMemType bufferType
Type of buffer.
Definition: nvdstracker.h:52
time_t timeStamp
Timestamp of the frame at the time of capture.
Definition: nvdstracker.h:173
struct _NvMOTConfigResponse NvMOTConfigResponse
Tracker configuration status.
NvBufSurfaceMemType memType
Preferred memory type of input buffers.
Definition: nvdstracker.h:235
NvMOTConfigStatus customConfigStatus
Status of the custom configs.
Definition: nvdstracker.h:114
struct _NvMOTFrame NvMOTFrame
Frame containing the image and objects to be tracked.
NvMOTStatus NvMOT_Init(NvMOTConfig *pConfigIn, NvMOTContextHandle *pContextHandle, NvMOTConfigResponse *pConfigResponse)
Initlize tracking context for a batch.
NvMOTStreamId streamID
Stream associated with objects in the list.
Definition: nvdstracker.h:201
NvMOTConfigStatus summaryStatus
Summary status of the entire configuration request.
Definition: nvdstracker.h:110
NvMOTStatus NvMOT_Query(uint16_t customConfigFilePathSize, char *pCustomConfigFilePath, NvMOTQuery *pQuery)
Query tracker lib capabilities and requirements.
uint32_t numAllocated
Number of blocks allocated for the list.
Definition: nvdstracker.h:158
Rectangle.
Definition: nvdstracker.h:130
Frame containing the image and objects to be tracked.
Definition: nvdstracker.h:169
void NvMOT_DeInit(NvMOTContextHandle contextHandle)
De-initialize a stream context.
Information for each object to be tracked.
Definition: nvdstracker.h:141
uint32_t maxWidth
Maximum width of each frame.
Definition: nvdstracker.h:53
uint32_t numFilled
Number of filled blocks in the list.
Definition: nvdstracker.h:216
float confidence
Tracking confidence of the object.
Definition: nvdstracker.h:190
struct _NvMOTRect NvMOTRect
Rectangle.
#define NVMOT_MAX_TRANSFORMS
Definition: nvdstracker.h:29
void * pPreservedData
Used for the client to keep track of any data associated with the object.
Definition: nvdstracker.h:147
bool valid
This entry in the batch is valid.
Definition: nvdstracker.h:203
uint32_t maxPitch
Maximum pitch of each buffer.
Definition: nvdstracker.h:55
struct _NvMOTTrackedObjBatch NvMOTTrackedObjBatch
Batch of lists of tracked objects.
struct _NvMOTConfig NvMOTConfig
Tracker configuration.
NvBufSurfaceColorFormat
Defines color formats for NvBufSurface.
Definition: nvbufsurface.h:58
uint32_t numFilled
Number of populated blocks in the list.
Definition: nvdstracker.h:206
NvMOTObjToTrack * associatedObjectIn
The associated input object if there is one.
Definition: nvdstracker.h:192
NvBufSurfaceParams ** bufferList
Array of pointers to buffer params.
Definition: nvdstracker.h:178
NvMOTTrackedObjList * list
Pointer to array of obj lists.
Definition: nvdstracker.h:214
NvMOTStreamId streamID
The stream source for this frame.
Definition: nvdstracker.h:171