NVIDIA DeepStream SDK API Reference

4.0.1 Release

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups
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 
28 #ifndef _NVMOTRACKER_H_
29 #define _NVMOTRACKER_H_
30 
31 #include <stdint.h>
32 #include <time.h>
33 
34 #include "nvbufsurface.h"
35 
36 #ifdef __cplusplus
37 extern "C"
38 {
39 #endif
40 
41 #define NVMOT_MAX_TRANSFORMS 4
42 
43 typedef uint64_t NvMOTStreamId;
44 
51 #define NVMOTCOMP_GPU 0x01
52 #define NVMOTCOMP_CPU 0x02
53 #define NVMOTCOMP_PVA 0x04
54 #define NVMOTCOMP_ANY 0xff
55 #define NVMOTCOMP_DEFAULT NVMOTCOMP_ANY
56 typedef uint8_t NvMOTCompute;
57 
63 {
65  uint32_t maxWidth;
66  uint32_t maxHeight;
67  uint32_t maxPitch;
68  uint32_t maxSize;
69  uint32_t colorFormat;
71 
72 
77 typedef struct _NvMOTMiscConfig
78 {
79  uint32_t gpuId;
80  uint32_t maxObjPerStream;
81  uint32_t maxObjPerBatch;
82  typedef void (*logMsg) (int logLevel, const char * format, ...);
84 
92 typedef struct _NvMOTConfig
93 {
94  NvMOTCompute computeConfig;
95  uint32_t maxStreams;
96  uint8_t numTransforms;
102 } NvMOTConfig;
103 
107 typedef enum
108 {
114 
120 typedef struct _NvMOTConfigResponse
121 {
128 
132 typedef enum
133 {
137 } NvMOTStatus;
138 
142 typedef struct _NvMOTRect
143 {
144  int x;
145  int y;
146  int width;
147  int height;
148 } NvMOTRect;
149 
153 typedef struct _NvMOTObjToTrack
154 {
155  uint16_t classId;
157  float confidence;
158  bool doTracking;
161 
165 typedef struct _NvMOTObjToTrackList
166 {
170  uint32_t numAllocated;
171  uint32_t numFilled;
173 
181 typedef struct _NvMOTFrame
182 {
183  NvMOTStreamId streamID;
184  uint32_t frameNum;
185  time_t timeStamp;
187  bool doTracking;
188  bool reset;
189  uint8_t numBuffers;
192 } NvMOTFrame;
193 
197 typedef struct _NvMOTTrackedObj
198 {
199  uint16_t classId;
200  uint64_t trackingId;
202  float confidence;
203  uint32_t age;
205  uint8_t reserved[128];
207 
211 typedef struct _NvMOTTrackedObjList
212 {
213  NvMOTStreamId streamID;
214  uint32_t frameNum;
215  bool valid;
217  uint32_t numAllocated;
218  uint32_t numFilled;
220 
224 typedef struct _NvMOTTrackedObjBatch
225 {
227  uint32_t numAllocated;
228  uint32_t numFilled;
230 
236 typedef struct _NvMOTProcessParams
237 {
238  uint32_t numFrames;
241 
242 typedef struct _NvMOTQuery
243 {
244  NvMOTCompute computeConfig;
245  uint8_t numTransforms;
249 } NvMOTQuery;
250 
254 struct NvMOTContext;
255 typedef struct NvMOTContext* NvMOTContextHandle;
256 
274  NvMOTContextHandle *pContextHandle,
275  NvMOTConfigResponse *pConfigResponse);
276 
285 void NvMOT_DeInit(NvMOTContextHandle contextHandle);
286 
300 NvMOTStatus NvMOT_Process(NvMOTContextHandle contextHandle,
301  NvMOTProcessParams *pParams,
302  NvMOTTrackedObjBatch *pTrackedObjectsBatch);
303 
315 NvMOTStatus NvMOT_Query(uint16_t customConfigFilePathSize, char* pCustomConfigFilePath, NvMOTQuery *pQuery);
316 
317 
331 void NvMOT_RemoveStreams(NvMOTContextHandle contextHandle, NvMOTStreamId streamIdMask);
332  // end of API group
334 
335 #ifdef __cplusplus
336 }
337 #endif
338 
339 #endif
NvMOTStatus NvMOT_Process(NvMOTContextHandle contextHandle, NvMOTProcessParams *pParams, NvMOTTrackedObjBatch *pTrackedObjectsBatch)
Process a batch.
uint16_t customConfigFilePathSize
The char length in customConfigFilePath.
Definition: nvdstracker.h:100
Configuration for batches for each input transform (scaling/color conversion)
Definition: nvdstracker.h:62
struct _NvMOTQuery NvMOTQuery
uint8_t NvMOTCompute
Definition: nvdstracker.h:56
struct _NvMOTRect NvMOTRect
Rectangle.
struct _NvMOTConfig NvMOTConfig
Tracker configuration.
int height
Height of the bounding box in pixels.
Definition: nvdstracker.h:147
Batch of lists of tracked objects.
Definition: nvdstracker.h:224
uint32_t maxObjPerBatch
Max number of objects to track per batch.
Definition: nvdstracker.h:81
NvMOTStatus NvMOT_Init(NvMOTConfig *pConfigIn, NvMOTContextHandle *pContextHandle, NvMOTConfigResponse *pConfigResponse)
Initialize tracking context for a batch.
uint8_t numTransforms
Number of NvMOTPerTransformBatchConfig entries in perTransformBatchConfig.
Definition: nvdstracker.h:245
void NvMOT_DeInit(NvMOTContextHandle contextHandle)
De-initialize a stream context.
NvBufSurface Interface
NvMOTCompute computeConfig
Compute target.
Definition: nvdstracker.h:94
Information for each tracked object.
Definition: nvdstracker.h:197
uint32_t numFilled
Number of populated blocks in the list.
Definition: nvdstracker.h:171
uint8_t reserved[128]
Definition: nvdstracker.h:205
uint32_t maxStreams
Maximum number of streams in a batch.
Definition: nvdstracker.h:95
bool reset
True: reset tracking for the stream.
Definition: nvdstracker.h:188
uint64_t NvMOTStreamId
Definition: nvdstracker.h:43
uint8_t numTransforms
Number of NvMOTPerTransformBatchConfig entries in perTransformBatchConfig.
Definition: nvdstracker.h:96
struct _NvMOTPerTransformBatchConfig NvMOTPerTransformBatchConfig
Configuration for batches for each input transform (scaling/color conversion)
NvMOTObjToTrackList objectsIn
List of objects to be tracked in this frame.
Definition: nvdstracker.h:191
struct _NvMOTProcessParams NvMOTProcessParams
Parameters for processing each batch.
char * customConfigFilePath
Path to the tracker's custom config file.
Definition: nvdstracker.h:101
Tracker configuration.
Definition: nvdstracker.h:92
NvMOTTrackedObj * list
Pointer to a list/array of object info blocks.
Definition: nvdstracker.h:216
uint16_t classId
Class of the object to be tracked.
Definition: nvdstracker.h:155
NvMOTConfigStatus transformBatchStatus
Transform batch config request status.
Definition: nvdstracker.h:124
NvMOTCompute computeConfig
Supported compute targets.
Definition: nvdstracker.h:244
NvMOTFrame * frameList
Pointer to an array of frame data.
Definition: nvdstracker.h:239
bool doTracking
True: track this object.
Definition: nvdstracker.h:158
bool doTracking
True: track objects in this frame; False: do not track this frame.
Definition: nvdstracker.h:187
int width
Width of the bounding box in pixels.
Definition: nvdstracker.h:146
struct NvMOTContext * NvMOTContextHandle
Definition: nvdstracker.h:255
NvMOTRect bbox
Bounding box.
Definition: nvdstracker.h:201
int x
Pixel coordinate of left edge of the object bounding box.
Definition: nvdstracker.h:144
NvMOTStatus
Generic status for tracking operations.
Definition: nvdstracker.h:132
uint32_t maxHeight
Maximum height of each frame.
Definition: nvdstracker.h:66
struct _NvMOTMiscConfig NvMOTMiscConfig
Miscellaneous configurations.
Holds information about a single buffer in a batch.
Definition: nvbufsurface.h:252
uint32_t numAllocated
Number of blocks allocated for the list.
Definition: nvdstracker.h:217
uint32_t numAllocated
Number of blocks allocated for the list.
Definition: nvdstracker.h:227
uint32_t frameNum
Frame number for objects in the list.
Definition: nvdstracker.h:214
struct _NvMOTTrackedObj NvMOTTrackedObj
Information for each tracked object.
Miscellaneous configurations.
Definition: nvdstracker.h:77
NvBufSurfaceColorFormat colorFormats[NVMOT_MAX_TRANSFORMS]
Required color formats for input buffers.
Definition: nvdstracker.h:246
void NvMOT_RemoveStreams(NvMOTContextHandle contextHandle, NvMOTStreamId streamIdMask)
Optional handler for removing streams from a batch.
void(* logMsg)(int logLevel, const char *format,...)
Callback for logging messages.
Definition: nvdstracker.h:82
uint8_t numBuffers
Number of entries in bufferList.
Definition: nvdstracker.h:189
NvMOTStatus NvMOT_Query(uint16_t customConfigFilePathSize, char *pCustomConfigFilePath, NvMOTQuery *pQuery)
Query tracker lib capabilities and requirements.
NvMOTConfigStatus
Configuration request return status.
Definition: nvdstracker.h:107
struct _NvMOTObjToTrackList NvMOTObjToTrackList
List of objects.
struct _NvMOTConfigResponse NvMOTConfigResponse
Tracker configuration status.
NvMOTConfigStatus computeStatus
Compute target request status.
Definition: nvdstracker.h:123
uint32_t colorFormat
Color format: RGB, NV12 etc.
Definition: nvdstracker.h:69
uint16_t classId
Class of the object to be tracked.
Definition: nvdstracker.h:199
NvMOTConfigStatus miscConfigStatus
Status of the miscellaneous configs.
Definition: nvdstracker.h:125
List of objects.
Definition: nvdstracker.h:165
uint64_t trackingId
Unique ID for the object as assigned by the tracker.
Definition: nvdstracker.h:200
struct _NvMOTFrame NvMOTFrame
Frame containing the image and objects to be tracked.
NvBufSurfaceColorFormat
Specifies color formats for NvBufSurface.
Definition: nvbufsurface.h:75
uint32_t gpuId
GPU to be used.
Definition: nvdstracker.h:79
#define NVMOT_MAX_TRANSFORMS
Definition: nvdstracker.h:41
NvMOTMiscConfig miscConfig
Miscellaneous configs.
Definition: nvdstracker.h:99
NvMOTObjToTrack * list
Pointer to a list/array of object info blocks.
Definition: nvdstracker.h:169
bool supportBatchProcessing
Whether batch processing is supported.
Definition: nvdstracker.h:248
struct _NvMOTTrackedObjBatch NvMOTTrackedObjBatch
Batch of lists of tracked objects.
bool detectionDone
True if detection was done on this frame even if the list of objects to track is empty.
Definition: nvdstracker.h:167
int y
Pixel coordinate of top edge of the object bounding box.
Definition: nvdstracker.h:145
bool timeStampValid
The timestamp value is properly populated.
Definition: nvdstracker.h:186
List of tracked objects.
Definition: nvdstracker.h:211
uint32_t maxSize
Maximum size of the buffer in bytes.
Definition: nvdstracker.h:68
float confidence
Detection confidence of the object.
Definition: nvdstracker.h:157
uint32_t age
Track length in frames.
Definition: nvdstracker.h:203
NvMOTPerTransformBatchConfig * perTransformBatchConfig
List of numTransform batch configs including type and resolution, one for each transform.
Definition: nvdstracker.h:97
uint32_t frameNum
Frame number sequentially identifying the frame within a stream.
Definition: nvdstracker.h:184
uint32_t numFrames
Number of frames in the batch.
Definition: nvdstracker.h:238
Parameters for processing each batch.
Definition: nvdstracker.h:236
NvMOTRect bbox
Bounding box.
Definition: nvdstracker.h:156
Tracker configuration status.
Definition: nvdstracker.h:120
uint32_t maxObjPerStream
Max number of objects to track per stream.
Definition: nvdstracker.h:80
NvBufSurfaceMemType bufferType
Type of buffer.
Definition: nvdstracker.h:64
time_t timeStamp
Timestamp of the frame at the time of capture.
Definition: nvdstracker.h:185
NvBufSurfaceMemType memType
Preferred memory type of input buffers.
Definition: nvdstracker.h:247
NvMOTConfigStatus customConfigStatus
Status of the custom configs.
Definition: nvdstracker.h:126
NvMOTStreamId streamID
Stream associated with objects in the list.
Definition: nvdstracker.h:213
NvMOTConfigStatus summaryStatus
Summary status of the entire configuration request.
Definition: nvdstracker.h:122
uint32_t numAllocated
Number of blocks allocated for the list.
Definition: nvdstracker.h:170
Rectangle.
Definition: nvdstracker.h:142
Frame containing the image and objects to be tracked.
Definition: nvdstracker.h:181
Information for each object to be tracked.
Definition: nvdstracker.h:153
uint32_t maxWidth
Maximum width of each frame.
Definition: nvdstracker.h:65
uint32_t numFilled
Number of filled blocks in the list.
Definition: nvdstracker.h:228
float confidence
Tracking confidence of the object.
Definition: nvdstracker.h:202
struct _NvMOTTrackedObjList NvMOTTrackedObjList
List of tracked objects.
NvBufSurfaceMemType
Specifies memory types for NvBufSurface.
Definition: nvbufsurface.h:169
struct _NvMOTObjToTrack NvMOTObjToTrack
Information for each object to be tracked.
void * pPreservedData
Used for the client to keep track of any data associated with the object.
Definition: nvdstracker.h:159
bool valid
This entry in the batch is valid.
Definition: nvdstracker.h:215
uint32_t maxPitch
Maximum pitch of each buffer.
Definition: nvdstracker.h:67
uint32_t numFilled
Number of populated blocks in the list.
Definition: nvdstracker.h:218
NvMOTObjToTrack * associatedObjectIn
The associated input object if there is one.
Definition: nvdstracker.h:204
NvBufSurfaceParams ** bufferList
Array of pointers to buffer params.
Definition: nvdstracker.h:190
NvMOTTrackedObjList * list
Pointer to array of obj lists.
Definition: nvdstracker.h:226
NvMOTStreamId streamID
The stream source for this frame.
Definition: nvdstracker.h:183