NVIDIA DeepStream SDK API Reference

9.2 Release
sources/libs/nvmultiobjecttracker/include/modules/NvMultiObjectTracker/nvdstracker.h File Reference

Detailed Description

DeepStream object tracker API

Description: This file defines the DeepStream object tracker API.

Definition in file sources/libs/nvmultiobjecttracker/include/modules/NvMultiObjectTracker/nvdstracker.h.

Go to the source code of this file.

Data Structures

struct  _NvMOTTimeMeta
 Per-frame timing: stream PTS (when valid), host-local ns for deltas, and frame index. More...
 
struct  _NvMOTPerTransformBatchConfig
 Holds a configuration for batches for an input transform (a scaling/color conversion). More...
 
struct  _NvMOTMiscConfig
 Holds miscellaneous configurations. More...
 
struct  _NvMOTConfig
 Holds a tracker configuration. More...
 
struct  _NvMOTConfigResponse
 Holds a tracker's configuration status. More...
 
struct  _NvMOTRect
 Holds the definition of a rectangle. More...
 
struct  _NvMOTMask
 Holds the segmentaiton mask of an object. More...
 
struct  _NvMOTObjToTrack
 Holds information about an object to be tracked. More...
 
struct  _NvMOTObjToTrackList
 Holds a list of objects. More...
 
struct  _NvMOTFrame
 Holds a frame containing the image and objects to be tracked. More...
 
struct  _NvMOTTrackedObj
 Holds information about each tracked object. More...
 
struct  _NvMOTTrackedObjList
 Holds a list of tracked objects. More...
 
struct  _NvMOTTrackedObjBatch
 Holds a batch of lists of tracked objects. More...
 
struct  _NvMOTTrackerMiscData
 Tracker misc data. More...
 
struct  _NvMOTProcessParams
 Holds parameters for processing a batch. More...
 
struct  _NvMOTQuery
 Holds the capabilities and requirements reported by the tracker library. More...
 

Macros

#define NVMOT_MAX_TRANSFORMS   4
 
#define NVMOTCOMP_GPU   0x01
 Compute target flags. More...
 
#define NVMOTCOMP_CPU   0x02
 Defines the "CPU" compute target flag. More...
 
#define NVMOTCOMP_PVA   0x04
 Defines the "PVA" compute target flag. More...
 
#define NVMOTCOMP_ANY   0xff
 Defines a compute target flag for "any target.". More...
 
#define NVMOTCOMP_DEFAULT   NVMOTCOMP_ANY
 Defines the compute target flag for the default target. More...
 

Typedefs

typedef uint64_t NvMOTTimeStamp
 
typedef uint64_t NvMOTStreamId
 
typedef uint32_t NvMOTFrameNum
 
typedef uint16_t NvMOTClassId
 
typedef NvMOTTimeStamp TimeStamp
 
typedef struct _NvMOTTimeMeta NvMOTTimeMeta
 Holds the stream timestamp, host-local timestamp, and frame index. More...
 
typedef uint8_t NvMOTCompute
 
typedef struct _NvMOTPerTransformBatchConfig NvMOTPerTransformBatchConfig
 Holds a configuration for batches for an input transform (a scaling/color conversion). More...
 
typedef struct _NvMOTMiscConfig NvMOTMiscConfig
 Holds miscellaneous configurations. More...
 
typedef struct _NvMOTConfig NvMOTConfig
 Holds a tracker configuration. More...
 
typedef struct _NvMOTConfigResponse NvMOTConfigResponse
 Holds a tracker's configuration status. More...
 
typedef struct _NvMOTRect NvMOTRect
 Holds the definition of a rectangle. More...
 
typedef struct _NvMOTMask NvMOTMask
 Holds the segmentation mask of an object. More...
 
typedef struct _NvMOTObjToTrack NvMOTObjToTrack
 Holds information about an object to be tracked. More...
 
typedef struct _NvMOTObjToTrackList NvMOTObjToTrackList
 Holds a list of objects. More...
 
typedef struct _NvMOTFrame NvMOTFrame
 Holds a frame containing the image and objects to be tracked. More...
 
typedef struct _NvMOTTrackedObj NvMOTTrackedObj
 Holds information about each tracked object. More...
 
typedef struct _NvMOTTrackedObjList NvMOTTrackedObjList
 Holds a list of tracked objects. More...
 
typedef struct _NvMOTTrackedObjBatch NvMOTTrackedObjBatch
 Holds a batch of lists of tracked objects. More...
 
typedef struct _NvMOTTrackerMiscData NvMOTTrackerMiscData
 Tracker misc data. More...
 
typedef struct _NvMOTProcessParams NvMOTProcessParams
 Holds parameters for processing a batch. More...
 
typedef struct NvMOTContext * NvMOTContextHandle
 
typedef struct _NvMOTQuery NvMOTQuery
 Holds the capabilities and requirements reported by the tracker library. More...
 

Enumerations

enum  NvMOTConfigStatus {
  NvMOTConfigStatus_OK,
  NvMOTConfigStatus_Error,
  NvMOTConfigStatus_Invalid,
  NvMOTConfigStatus_Unsupported,
  NvMOTConfigStatus_OK,
  NvMOTConfigStatus_Error,
  NvMOTConfigStatus_Invalid,
  NvMOTConfigStatus_Unsupported,
  NvMOTConfigStatus_OK,
  NvMOTConfigStatus_Error,
  NvMOTConfigStatus_Invalid,
  NvMOTConfigStatus_Unsupported,
  NvMOTConfigStatus_OK,
  NvMOTConfigStatus_Error,
  NvMOTConfigStatus_Invalid,
  NvMOTConfigStatus_Unsupported
}
 Defines configuration request return codes. More...
 
enum  NvMOTBatchMode {
  NvMOTBatchMode_Error = 0,
  NvMOTBatchMode_Batch = 1 << 0,
  NvMOTBatchMode_NonBatch = 1 << 1,
  NvMOTBatchMode_MaxValue = 3,
  NvMOTBatchMode_Error = 0,
  NvMOTBatchMode_Batch = 1 << 0,
  NvMOTBatchMode_NonBatch = 1 << 1,
  NvMOTBatchMode_MaxValue = 3,
  NvMOTBatchMode_Error = 0,
  NvMOTBatchMode_Batch = 1 << 0,
  NvMOTBatchMode_NonBatch = 1 << 1,
  NvMOTBatchMode_MaxValue = 3,
  NvMOTBatchMode_Error = 0,
  NvMOTBatchMode_Batch = 1 << 0,
  NvMOTBatchMode_NonBatch = 1 << 1,
  NvMOTBatchMode_MaxValue = 3
}
 Defines supported tracker batch-processing modes. More...
 
enum  NvMOTStatus {
  NvMOTStatus_OK,
  NvMOTStatus_Error,
  NvMOTStatus_Invalid_Path,
  NvMOTStatus_OK,
  NvMOTStatus_Error,
  NvMOTStatus_Invalid_Path,
  NvMOTStatus_OK,
  NvMOTStatus_Error,
  NvMOTStatus_Invalid_Path,
  NvMOTStatus_OK,
  NvMOTStatus_Error,
  NvMOTStatus_Invalid_Path
}
 Defines generic status codes for tracking operations. More...
 

Functions

static TimeStamp NvDsCurrentTimestampNs (void)
 Return wall-clock time in nanoseconds since the Unix epoch. More...
 
NvMOTStatus NvMOT_Init (NvMOTConfig *pConfigIn, NvMOTContextHandle *pContextHandle, NvMOTConfigResponse *pConfigResponse)
 Initializes a tracking context for a batch of one or more image streams. More...
 
void NvMOT_DeInit (NvMOTContextHandle contextHandle)
 Deinitialize a stream context. More...
 
NvMOTStatus NvMOT_Process (NvMOTContextHandle contextHandle, NvMOTProcessParams *pParams, NvMOTTrackedObjBatch *pTrackedObjectsBatch)
 Processes a batch. More...
 
NvMOTStatus NvMOT_RetrieveMiscData (NvMOTContextHandle contextHandle, NvMOTProcessParams *pParams, NvMOTTrackerMiscData *pTrackerMiscData)
 Retrieve past-frame, terminated-track, and shadow-track data from the low-level tracker. More...
 
NvMOTStatus NvMOT_Query (uint16_t customConfigFilePathSize, char *pCustomConfigFilePath, NvMOTQuery *pQuery)
 Query tracker library capabilities and requirements. More...
 
NvMOTStatus NvMOT_RemoveStreams (NvMOTContextHandle contextHandle, NvMOTStreamId streamIdMask)
 Removes streams from a batch. More...
 
NvMOTStatus NvMOT_UpdateParams (NvMOTContextHandle contextHandle, const std::string &configStr)
 Update dynamic parameters for the low-level tracker. More...
 

Typedef Documentation

◆ NvMOTCompute

◆ NvMOTConfig

typedef struct _NvMOTConfig NvMOTConfig

Holds a tracker configuration.

Holds configuration options for the tracker, applied to the whole context.

Note
This structure must be deep-copied to be passed to a component that is to use it persistently.

◆ NvMOTConfigResponse

Holds a tracker's configuration status.

Holds the status of a configuration request; includes both summary and per-configuration status.

◆ NvMOTContextHandle

◆ NvMOTFrame

typedef struct _NvMOTFrame NvMOTFrame

Holds a frame containing the image and objects to be tracked.

Note
numBuffers is supposed to be less than or equal to numTransforms in NvMOTConfig.
The metadata in the NvBufSurfaceParams structures which bufferList points to must be checked with the parameters specified in perTransformBatchConfig in NvMOTConfig.

◆ NvMOTMask

typedef struct _NvMOTMask NvMOTMask

Holds the segmentation mask of an object.

◆ NvMOTMiscConfig

Holds miscellaneous configurations.

◆ NvMOTObjToTrack

Holds information about an object to be tracked.

NvMOT creates an instance of this structure for each tracked object.

◆ NvMOTObjToTrackList

Holds a list of objects.

◆ NvMOTPerTransformBatchConfig

Holds a configuration for batches for an input transform (a scaling/color conversion).

◆ NvMOTProcessParams

Holds parameters for processing a batch.

See also
NvMOTProcessFrame.

◆ NvMOTQuery

typedef struct _NvMOTQuery NvMOTQuery

Holds the capabilities and requirements reported by the tracker library.

◆ NvMOTRect

typedef struct _NvMOTRect NvMOTRect

Holds the definition of a rectangle.

◆ NvMOTTrackedObj

Holds information about each tracked object.

◆ NvMOTTrackedObjBatch

Holds a batch of lists of tracked objects.

◆ NvMOTTrackedObjList

Holds a list of tracked objects.

◆ NvMOTTrackerMiscData

Tracker misc data.

Enumeration Type Documentation

◆ NvMOTBatchMode

Defines supported tracker batch-processing modes.

Enumerator
NvMOTBatchMode_Error 

Unsupported batch mode.

At least either batch or non-batch should be supported.

NvMOTBatchMode_Batch 

Batch processing mode.

NvMOTBatchMode_NonBatch 

Non-batch processing mode.

NvMOTBatchMode_MaxValue 

Max value of the enum.

All bits are 1.

NvMOTBatchMode_Error 

Indicates that neither batch nor non-batch processing is supported.

NvMOTBatchMode_Batch 

Enables batch processing.

NvMOTBatchMode_NonBatch 

Enables non-batch processing.

NvMOTBatchMode_MaxValue 

Represents the maximum bit-mask value.

NvMOTBatchMode_Error 

Unsupported batch mode.

At least either batch or non-batch should be supported.

NvMOTBatchMode_Batch 

Batch processing mode.

NvMOTBatchMode_NonBatch 

Non-batch processing mode.

NvMOTBatchMode_MaxValue 

Max value of the enum.

All bits are 1.

NvMOTBatchMode_Error 

Indicates that neither batch nor non-batch processing is supported.

NvMOTBatchMode_Batch 

Enables batch processing.

NvMOTBatchMode_NonBatch 

Enables non-batch processing.

NvMOTBatchMode_MaxValue 

Represents the maximum bit-mask value.

Definition at line 148 of file sources/libs/nvmultiobjecttracker/include/modules/NvMultiObjectTracker/nvdstracker.h.

◆ NvMOTConfigStatus

Defines configuration request return codes.

Enumerator
NvMOTConfigStatus_OK 
NvMOTConfigStatus_Error 
NvMOTConfigStatus_Invalid 
NvMOTConfigStatus_Unsupported 
NvMOTConfigStatus_OK 

Configuration was accepted.

NvMOTConfigStatus_Error 

Configuration processing failed.

NvMOTConfigStatus_Invalid 

Configuration contained an invalid value.

NvMOTConfigStatus_Unsupported 

Configuration requested an unsupported option.

NvMOTConfigStatus_OK 
NvMOTConfigStatus_Error 
NvMOTConfigStatus_Invalid 
NvMOTConfigStatus_Unsupported 
NvMOTConfigStatus_OK 

Configuration was accepted.

NvMOTConfigStatus_Error 

Configuration processing failed.

NvMOTConfigStatus_Invalid 

Configuration contained an invalid value.

NvMOTConfigStatus_Unsupported 

Configuration requested an unsupported option.

Definition at line 139 of file sources/libs/nvmultiobjecttracker/include/modules/NvMultiObjectTracker/nvdstracker.h.

◆ NvMOTStatus

Defines generic status codes for tracking operations.

Enumerator
NvMOTStatus_OK 
NvMOTStatus_Error 
NvMOTStatus_Invalid_Path 
NvMOTStatus_OK 

Operation completed successfully.

NvMOTStatus_Error 

Operation failed.

NvMOTStatus_Invalid_Path 

Operation received an invalid path.

NvMOTStatus_OK 
NvMOTStatus_Error 
NvMOTStatus_Invalid_Path 
NvMOTStatus_OK 

Operation completed successfully.

NvMOTStatus_Error 

Operation failed.

NvMOTStatus_Invalid_Path 

Operation received an invalid path.

Definition at line 174 of file sources/libs/nvmultiobjecttracker/include/modules/NvMultiObjectTracker/nvdstracker.h.

Function Documentation

◆ NvDsCurrentTimestampNs()

static TimeStamp NvDsCurrentTimestampNs ( void  )
inlinestatic

Return wall-clock time in nanoseconds since the Unix epoch.

Definition at line 62 of file sources/libs/nvmultiobjecttracker/include/modules/NvMultiObjectTracker/nvdstracker.h.

◆ NvMOT_DeInit()

void NvMOT_DeInit ( NvMOTContextHandle  contextHandle)

Deinitialize a stream context.

Parameters
[in]contextHandleThe handle for the stream context to retire.

◆ NvMOT_Init()

NvMOTStatus NvMOT_Init ( NvMOTConfig *  pConfigIn,
NvMOTContextHandle *  pContextHandle,
NvMOTConfigResponse *  pConfigResponse 
)

Initializes a tracking context for a batch of one or more image streams.

If successful, the context is configured as specified by pConfigIn.

Parameters
[in]pConfigInA pointer to a structure specifying the configuration.
[in,out]pContextHandleA pointer whose existing handle is retired and whose replacement handle is stored for later calls.
[out]pConfigResponseA pointer to a structure that describes the operation's status.
Returns
The outcome of the initialization attempt.

◆ NvMOT_Process()

NvMOTStatus NvMOT_Process ( NvMOTContextHandle  contextHandle,
NvMOTProcessParams *  pParams,
NvMOTTrackedObjBatch *  pTrackedObjectsBatch 
)

Processes a batch.

Parameters
[in]contextHandleA context handle obtained from NvMOT_Init().
[in]pParamsA pointer to parameters for the batch to be processed.
[out]pTrackedObjectsBatchA pointer to client-allocated tracked-object slots that receive bounding boxes scaled to the first input transform.
Returns
The status of batch processing.

◆ NvMOT_Query()

NvMOTStatus NvMOT_Query ( uint16_t  customConfigFilePathSize,
char *  pCustomConfigFilePath,
NvMOTQuery *  pQuery 
)

Query tracker library capabilities and requirements.

Parameters
[in]customConfigFilePathSizeLength of the custom configuration file's pathname.
[in]pCustomConfigFilePathA pointer to the custom configuration file's pathname.
[out]pQueryA pointer to a query structure to be filled by the tracker.
Returns
Status of the query.

◆ NvMOT_RemoveStreams()

NvMOTStatus NvMOT_RemoveStreams ( NvMOTContextHandle  contextHandle,
NvMOTStreamId  streamIdMask 
)

Removes streams from a batch.

Parameters
[in]contextHandleThe context handle obtained from NvMOTInit().
[in]streamIdMaskA mask that selects streams satisfying (streamId & streamIdMask) == streamIdMask.
Returns
Status of stream removal.

◆ NvMOT_RetrieveMiscData()

NvMOTStatus NvMOT_RetrieveMiscData ( NvMOTContextHandle  contextHandle,
NvMOTProcessParams *  pParams,
NvMOTTrackerMiscData *  pTrackerMiscData 
)

Retrieve past-frame, terminated-track, and shadow-track data from the low-level tracker.

Parameters
[in]contextHandleThe context handle obtained from NvMOT_Init().
[in]pParamsA pointer to parameters for the batch of frames with the available stream ID.
[out]pTrackerMiscDataMiscellaneous data from the low-level tracker to store in user metadata.
Returns
The status of the retrieval.

◆ NvMOT_UpdateParams()

NvMOTStatus NvMOT_UpdateParams ( NvMOTContextHandle  contextHandle,
const std::string &  configStr 
)

Update dynamic parameters for the low-level tracker.

Parameters
[in]contextHandleThe context handle obtained from NvMOTInit().
[in]configStrStringified configuration for the tracker.
Returns
Status of the configuration update.