NVIDIA DeepStream SDK API Reference

9.2 Release
sources/libs/nvmultiobjecttracker/include/modules/utility/DsLowLevelTracker.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef CV_FUNCSLIB_DSLOWLEVELTRACKER_HPP_
19 #define CV_FUNCSLIB_DSLOWLEVELTRACKER_HPP_
20 
21 #include <iostream>
22 #include <map>
23 
24 #include "modules/NvMultiObjectTracker/nvdstracker.h"
25 
27 typedef std::map<NvMOTStreamId, std::vector<std::tuple<int, cv::Rect2f, uint, float > > > RoiBatch;
28 
30 typedef std::map<NvMOTStreamId, std::pair<uint32_t, cv::Mat> > FrameBatch;
31 
34 {
35 public:
38  {
40  mp_MotCtx = nullptr;
41  m_motOutputObjectsMeta.list = nullptr;
42  m_motInputParams.frameList = nullptr;
43 
45 
46  m_isIntialized = false;
47  }
48 
51  {
53  if(mp_MotCtx != nullptr)
55 
58 
61  }
62 
64  bool isInitialized() { return m_isIntialized; }
65 
80  void initialize(
81  const uint32_t gpuId, const int maxVideoStreams, const int numVideoStreams,
82  const int maxObjectsPerFrame, const int numTransforms, const uint maxWidth,
83  const uint maxHeight, const uint maxPitch, const NvBufSurfaceColorFormat srcImgColorFormat,
84  std::string lowLevelTrackerConfigFilePath = "", const int debugVerboseLevel = 0
85  )
86  {
88  allocateMotOutputData(maxVideoStreams, maxObjectsPerFrame);
89 
91  allocateMotInputData(numTransforms, numVideoStreams, maxObjectsPerFrame);
92 
93  m_srcImgColorFormat = srcImgColorFormat;
94 
95  m_debugVerboseLevel = debugVerboseLevel;
96 
98  {
99  m_motMiscConfig.gpuId = gpuId;
101  m_motMiscConfig.maxObjPerStream = 0;
103  m_motMiscConfig.maxObjPerBatch = 0;
104  }
105 
108  maxWidth, maxHeight, maxPitch, m_srcImgColorFormat,
109  numVideoStreams, numTransforms, lowLevelTrackerConfigFilePath
110  );
111 
112  m_isIntialized = true;
113  }
114 
124  const FrameBatch &framesInBatch, const int numTransforms, RoiBatch rois = RoiBatch(),
125  const bool isDetectionDone = false, const uint32_t frameBatchNo = 0
126  )
127  {
129 
131  if(generateMotInputParams(framesInBatch, numTransforms, rois, isDetectionDone, frameBatchNo) == true)
132  {
135 
136  if (NvMOTStatus_OK != nvtstatus)
137  {
138  std::cerr << "NvMOT_Process() returned error " << nvtstatus << std::endl;
139  }
140  }
141 
142  return m_motOutputObjectsMeta;
143  }
144 
149  const void removeStream(const NvMOTStreamId videoStreamID)
150  {
151  NvMOT_RemoveStreams(mp_MotCtx, videoStreamID);
152  }
153 
155  const std::map<NvMOTStreamId, NvMOTFrame *> getMotInputParams()
156  {
157  std::map<NvMOTStreamId, NvMOTFrame *> inputParam;
158 
159  for(uint i=0; i<m_motInputParams.numFrames; i++)
160  {
162 
163  inputParam[frame->streamID] = frame;
164  }
165 
166  return inputParam;
167  }
168 
169 protected:
170 
182  uint maxWidth, uint maxHeight, uint maxPitch, NvBufSurfaceColorFormat colorFormat,
183  uint maxStream, uint numTransforms, std::string lowLevelTrackerConfigFilePath = ""
184  )
185  {
186  NvMOTPerTransformBatchConfig perTransformBatchConfig;
187  perTransformBatchConfig.bufferType = NVBUF_MEM_CUDA_UNIFIED;
188  perTransformBatchConfig.maxWidth = maxWidth;
189  perTransformBatchConfig.maxHeight = maxHeight;
190  perTransformBatchConfig.maxPitch = maxPitch;
192  perTransformBatchConfig.maxSize = maxPitch * maxHeight;
193  perTransformBatchConfig.colorFormat = colorFormat;
194 
196  NvMOTConfig motLlLibConfig;
197  motLlLibConfig.maxStreams = maxStream;
198  motLlLibConfig.numTransforms = numTransforms;
199  motLlLibConfig.computeConfig = m_computeType;
200  motLlLibConfig.miscConfig = m_motMiscConfig;
201  motLlLibConfig.perTransformBatchConfig = new NvMOTPerTransformBatchConfig[motLlLibConfig.numTransforms];
202  for(uint i=0; i<motLlLibConfig.numTransforms; i++)
203  {
204  motLlLibConfig.perTransformBatchConfig[i] = perTransformBatchConfig;
205  }
206 
207  motLlLibConfig.customConfigFilePathSize = lowLevelTrackerConfigFilePath.size();
208  motLlLibConfig.customConfigFilePath = new char[motLlLibConfig.customConfigFilePathSize+1];
209  strncpy(
210  motLlLibConfig.customConfigFilePath, (char *)(lowLevelTrackerConfigFilePath.c_str()),
211  motLlLibConfig.customConfigFilePathSize
212  );
213  motLlLibConfig.customConfigFilePath[motLlLibConfig.customConfigFilePathSize] = '\0';
214 
216  if(mp_MotCtx != nullptr)
218 
220  NvMOTStatus nvtstatus = NvMOT_Init(&motLlLibConfig, &mp_MotCtx, &m_motConfigResponse);
221 
222  assert(mp_MotCtx != nullptr);
223 
225  delete motLlLibConfig.perTransformBatchConfig;
226  delete motLlLibConfig.customConfigFilePath;
227 
228  if (NvMOTStatus_OK != nvtstatus)
229  {
230  std::cerr << "NvMOTInit returned error " << nvtstatus << std::endl;
231  }
232  }
233 
239  void allocateMotOutputData(const int maxVideoStreams, const int maxObjectsPerFrame)
240  {
241  if(m_motOutputObjectsMeta.list != nullptr)
242  {
244  }
245 
247  m_motOutputObjectsMeta.list = new NvMOTTrackedObjList[maxVideoStreams];
248 
249  m_motOutputObjectsMeta.numAllocated = maxVideoStreams;
251 
252  for(int i=0; i<maxVideoStreams; i++)
253  {
255 
256  objList->streamID = i;
257  objList->frameNum = 0;
258  objList->valid = false;
259  objList->list = new NvMOTTrackedObj[maxObjectsPerFrame];
260  objList->numAllocated = maxObjectsPerFrame;
261  objList->numFilled = 0;
262  }
263  }
264 
267  {
268  for(uint i=0; i<m_motOutputObjectsMeta.numAllocated; i++)
269  {
270  delete [] m_motOutputObjectsMeta.list[i].list;
271  }
272 
273  if(m_motOutputObjectsMeta.list != nullptr)
274  {
275  delete [] m_motOutputObjectsMeta.list;
276 
277  m_motOutputObjectsMeta.list = nullptr;
278  }
279  }
280 
287  void allocateMotInputData(const int numTransforms, const int numVideoStreams, const int maxObjectsPerFrame)
288  {
289  if(m_motInputParams.frameList != nullptr)
290  {
292  }
293 
294  m_motInputParams.numFrames = numVideoStreams;
295  m_motInputParams.frameList = new NvMOTFrame[numVideoStreams];
296 
297  for(int i=0; i<numVideoStreams; i++)
298  {
299  NvMOTFrame *newFrame = &m_motInputParams.frameList[i];
300  newFrame->streamID = i;
301  newFrame->frameNum = 0;
302  newFrame->timeMeta = NvMOTTimeMeta{};
303  newFrame->doTracking = false;
304  newFrame->reset = true;
305 
306  newFrame->numBuffers = numTransforms;
307  newFrame->bufferList = new NvBufSurfaceParams*;
308 
309  for(int i=0; i<numTransforms; i++)
310  {
311  newFrame->bufferList[i] = new NvBufSurfaceParams;
312  }
313 
314  newFrame->objectsIn.list = new NvMOTObjToTrack[maxObjectsPerFrame];
315  newFrame->objectsIn.numAllocated = maxObjectsPerFrame;
316  newFrame->objectsIn.numFilled = 0;
317  }
318  }
319 
322  {
323  for(uint i=0; i<m_motInputParams.numFrames; i++)
324  {
327  }
328 
329  if(m_motInputParams.frameList != nullptr)
330  {
331  delete [] m_motInputParams.frameList;
332 
333  m_motInputParams.frameList = nullptr;
334  }
335  }
336 
347  const FrameBatch &framesInBatch, const int numTransforms, RoiBatch &rois,
348  const bool isDetectionDone, const uint32_t frameBatchNo = 0
349  )
350  {
352 
353  for(auto it = framesInBatch.begin(); it != framesInBatch.end(); ++it)
354  {
355  NvMOTStreamId videoStreamId = it->first;
356  const uint32_t frameNumPerStream = it->second.first;
357  const uint32_t resolvedFrameNum = m_useBatchNumForFrameId ? frameBatchNo : frameNumPerStream;
358  const cv::Mat cvFrame = it->second.second;
359 
360  assert(cvFrame.type() == CV_8UC1 || cvFrame.type() == CV_8UC4);
361 
362  if(rois.find(videoStreamId) == rois.end())
363  continue;
364 
365  const std::vector<std::tuple<int, cv::Rect2f, uint, float > > &roisPerStream = rois.at(videoStreamId);
366 
368 
369  frame->streamID = videoStreamId;
370  frame->frameNum = resolvedFrameNum;
371  frame->sensorName = nullptr;
372  frame->timeMeta.frameNum = resolvedFrameNum;
373  frame->timeMeta.frameTimeStamp = 0;
374  frame->timeMeta.frameTimeValid = false;
376 
377  if(isDetectionDone)
378  {
379  frame->doTracking = true;
380  }
381  else
382  {
383  frame->doTracking = false;
384  }
385 
386  if(resolvedFrameNum == 0)
387  {
388  frame->reset = true;
389  }
390  else
391  {
392  frame->reset = false;
393  }
394 
395  frame->numBuffers = numTransforms;
396 
397  for(int j=0; j<numTransforms; j++)
398  {
399  NvBufSurfaceParams *transform = frame->bufferList[j];
401  transform->dataSize = cvFrame.step*cvFrame.rows;
402  transform->width = cvFrame.cols;
403  transform->pitch = cvFrame.step;
404  transform->colorFormat = m_srcImgColorFormat;
405 
406  transform->dataPtr = (void *)cvFrame.data;
407  transform->mappedAddr.addr[0] = (void *)cvFrame.data;
408 
410  {
412  transform->height = cvFrame.rows/1.5;
413 
415  transform->planeParams.num_planes = 2;
416 
417  transform->planeParams.width[0] = transform->width;
418  transform->planeParams.height[0] = transform->height;
419  transform->planeParams.pitch[0] = transform->pitch;
420  transform->planeParams.offset[0] = 0;
421  transform->planeParams.psize[0] = transform->pitch * transform->planeParams.height[0];
423  transform->planeParams.bytesPerPix[0] = 1;
424 
425  transform->planeParams.width[1] = transform->width;
427  transform->planeParams.height[1] = transform->height/2;
428  transform->planeParams.pitch[1] = transform->pitch;
430  transform->planeParams.offset[1] = transform->planeParams.psize[0];
431  transform->planeParams.psize[1] = transform->pitch * transform->planeParams.height[1];
433  transform->planeParams.bytesPerPix[1] = 1;
434 
435  }
437  {
438  transform->height = cvFrame.rows;
439 
441  transform->planeParams.num_planes = 1;
442 
443  transform->planeParams.width[0] = transform->width;
444  transform->planeParams.height[0] = transform->height;
445  transform->planeParams.pitch[0] = transform->pitch;
446  transform->planeParams.offset[0] = 0;
447  transform->planeParams.psize[0] = transform->pitch * transform->planeParams.height[0];
449  transform->planeParams.bytesPerPix[0] = 4;
450  }
451  else
452  {
453  std::runtime_error("Invalid color format!");
454  }
455  }
456 
457  NvMOTObjToTrackList *objs = &frame->objectsIn;
458 
459  if(objs->numAllocated < roisPerStream.size())
460  {
461  printf(
462  "(objs->numAllocated, roisPerStream.size() = (%d, %d)\n",
463  objs->numAllocated, (int)roisPerStream.size()
464  );
465  assert(objs->numAllocated > roisPerStream.size());
466  }
467 
468  objs->numFilled = 0;
469  objs->detectionDone = isDetectionDone;
470 
471  if(isDetectionDone && roisPerStream.size() > 0)
472  {
473  for(uint i=0; i<roisPerStream.size(); i++, objs->numFilled++)
474  {
476  int classId = std::get<2>(roisPerStream[i]);
477  cv::Rect2f bbox = std::get<1>(roisPerStream[i]);
478  float detectionConfidence = std::get<3>(roisPerStream[i]);
479 
480  objs->list[i].classId = classId;
481  objs->list[i].confidence = detectionConfidence;
482 
483  objs->list[i].doTracking = true;
484 
485  objs->list[i].bbox.x = bbox.x;
486  objs->list[i].bbox.y = bbox.y;
487  objs->list[i].bbox.width = bbox.width;
488  objs->list[i].bbox.height = bbox.height;
489 
490  }
491  }
492 
493  if(m_debugVerboseLevel > 0)
494  printf(
495  "[DsLowLevelTracker::generateMotInputParams()] videoStreamId[%lx], frameNum[%d]: feeding %d objects \n",
496  videoStreamId, resolvedFrameNum, objs->numFilled
497  );
498  }
499 
500  return m_motInputParams.numFrames > 0;
501  }
502 
512  bool m_useBatchNumForFrameId = false;
513 };
514 
515 #endif // CV_FUNCSLIB_DSLOWLEVELTRACKER_HPP_
_NvMOTPerTransformBatchConfig
Holds a configuration for batches for an input transform (a scaling/color conversion).
Definition: includes/nvdstracker.h:96
DsLowLevelTracker::m_motMiscConfig
NvMOTMiscConfig m_motMiscConfig
Miscellaneous tracker configuration.
Definition: sources/libs/nvmultiobjecttracker/include/modules/utility/DsLowLevelTracker.hpp:505
NvBufSurfaceParams::width
uint32_t width
Holds the width of the buffer.
Definition: includes/nvbufsurface.h:569
_NvMOTPerTransformBatchConfig::maxPitch
uint32_t maxPitch
Holds the maximum pitch of each buffer.
Definition: includes/nvdstracker.h:105
_NvMOTTimeMeta::frameNum
NvMOTFrameNum frameNum
Same logical frame as NvMOTFrame::frameNum.
Definition: includes/nvdstracker.h:68
NvMotDataTypes::Rect2f
Rect_< float, 2 > Rect2f
Definition: sources/libs/nvmultiobjecttracker/include/modules/utility/dataTypes.hpp:47
NvMOT_DeInit
void NvMOT_DeInit(NvMOTContextHandle contextHandle)
Deinitializes a stream context.
DsLowLevelTracker::m_computeType
NvMOTCompute m_computeType
Requested tracker compute target.
Definition: sources/libs/nvmultiobjecttracker/include/modules/utility/DsLowLevelTracker.hpp:508
NvMOTStatus_OK
@ NvMOTStatus_OK
Definition: includes/nvdstracker.h:202
DsLowLevelTracker::m_isIntialized
bool m_isIntialized
Indicates whether the low-level tracker is initialized.
Definition: sources/libs/nvmultiobjecttracker/include/modules/utility/DsLowLevelTracker.hpp:511
NvMOTStatus
NvMOTStatus
Defines generic status codes for tracking operations.
Definition: includes/nvdstracker.h:200
NvBufSurfacePlaneParams::num_planes
uint32_t num_planes
Holds the number of planes.
Definition: includes/nvbufsurface.h:415
_NvMOTObjToTrack::confidence
float confidence
Holds the detection confidence of the object.
Definition: includes/nvdstracker.h:249
NvBufSurfaceParams::dataPtr
void * dataPtr
Holds a pointer to allocated memory.
Definition: includes/nvbufsurface.h:585
DsLowLevelTracker::m_srcImgColorFormat
NvBufSurfaceColorFormat m_srcImgColorFormat
Source image color format.
Definition: sources/libs/nvmultiobjecttracker/include/modules/utility/DsLowLevelTracker.hpp:509
_NvMOTMiscConfig::gpuId
uint32_t gpuId
Holds the ID of the GPU to be used.
Definition: includes/nvdstracker.h:117
_NvMOTTimeMeta::frameTimeValid
bool frameTimeValid
True if frameTimeStamp is populated.
Definition: includes/nvdstracker.h:71
DsLowLevelTracker::m_useBatchNumForFrameId
bool m_useBatchNumForFrameId
Selects frame-batch numbers instead of per-stream frame numbers.
Definition: sources/libs/nvmultiobjecttracker/include/modules/utility/DsLowLevelTracker.hpp:512
NvBufSurfacePlaneParams::width
uint32_t width[NVBUF_MAX_PLANES]
Holds the widths of planes.
Definition: includes/nvbufsurface.h:417
NvBufSurfaceParams::dataSize
uint32_t dataSize
Holds the amount of allocated memory.
Definition: includes/nvbufsurface.h:582
DsLowLevelTracker::m_motInputParams
NvMOTProcessParams m_motInputParams
Input batch submitted to the tracker.
Definition: sources/libs/nvmultiobjecttracker/include/modules/utility/DsLowLevelTracker.hpp:504
_NvMOTTrackedObjBatch
Holds a batch of lists of tracked objects.
Definition: includes/nvdstracker.h:375
_NvMOTObjToTrackList::numFilled
uint32_t numFilled
Holds the number of populated blocks in the list.
Definition: includes/nvdstracker.h:269
DsLowLevelTracker::~DsLowLevelTracker
~DsLowLevelTracker()
Deinitialize the tracker context and release allocated metadata.
Definition: sources/libs/nvmultiobjecttracker/include/modules/utility/DsLowLevelTracker.hpp:50
_NvMOTPerTransformBatchConfig::maxHeight
uint32_t maxHeight
Holds the maximum height of each frame.
Definition: includes/nvdstracker.h:103
_NvMOTTrackedObjList::numAllocated
uint32_t numAllocated
Holds the number of blocks allocated for the list.
Definition: includes/nvdstracker.h:367
DsLowLevelTracker::removeStream
const void removeStream(const NvMOTStreamId videoStreamID)
Remove a stream from the low-level tracker context.
Definition: sources/libs/nvmultiobjecttracker/include/modules/utility/DsLowLevelTracker.hpp:149
NVBUF_MEM_CUDA_UNIFIED
@ NVBUF_MEM_CUDA_UNIFIED
Specifies CUDA Unified memory type.
Definition: includes/nvbufsurface.h:366
_NvMOTTrackedObjList::list
NvMOTTrackedObj * list
Holds a pointer to a list or array of object information blocks.
Definition: includes/nvdstracker.h:365
_NvMOTProcessParams::numFrames
uint32_t numFrames
Holds the number of frames in the batch.
Definition: includes/nvdstracker.h:410
DsLowLevelTracker::initialize
void initialize(const uint32_t gpuId, const int maxVideoStreams, const int numVideoStreams, const int maxObjectsPerFrame, const int numTransforms, const uint maxWidth, const uint maxHeight, const uint maxPitch, const NvBufSurfaceColorFormat srcImgColorFormat, std::string lowLevelTrackerConfigFilePath="", const int debugVerboseLevel=0)
Allocate tracker metadata and initialize a low-level tracking context.
Definition: sources/libs/nvmultiobjecttracker/include/modules/utility/DsLowLevelTracker.hpp:80
_NvMOTFrame::bufferList
NvBufSurfaceParams ** bufferList
Holds a pointer to an array of pointers to buffer parameter structures.
Definition: includes/nvdstracker.h:306
_NvMOTFrame
Holds a frame containing the image and objects to be tracked.
Definition: includes/nvdstracker.h:281
_NvMOTObjToTrackList::list
NvMOTObjToTrack * list
Holds a pointer to a list or array of object information blocks.
Definition: includes/nvdstracker.h:265
uint
unsigned int uint
Definition: sources/libs/nvmultiobjecttracker/include/modules/cuDCFv2/helper_math.h:25
_NvMOTFrame::reset
bool reset
Holds a Boolean which is true to reset tracking for the stream.
Definition: includes/nvdstracker.h:301
NvBufSurfacePlaneParams::psize
uint32_t psize[NVBUF_MAX_PLANES]
Holds the sizes of planes in bytes.
Definition: includes/nvbufsurface.h:425
_NvMOTTrackedObj
Holds information about each tracked object.
Definition: includes/nvdstracker.h:318
NvBufSurfacePlaneParams::offset
uint32_t offset[NVBUF_MAX_PLANES]
Holds the offsets of planes in bytes.
Definition: includes/nvbufsurface.h:423
_NvMOTFrame::timeMeta
NvMOTTimeMeta timeMeta
Holds stream PTS / NTP time, host-local receive time, and frame index.
Definition: includes/nvdstracker.h:293
_NvMOTFrame::objectsIn
NvMOTObjToTrackList objectsIn
Holds a list of objects in this frame which are to be tracked.
Definition: includes/nvdstracker.h:309
DsLowLevelTracker::generateMotInputParams
bool generateMotInputParams(const FrameBatch &framesInBatch, const int numTransforms, RoiBatch &rois, const bool isDetectionDone, const uint32_t frameBatchNo=0)
Populate low-level tracker input metadata from frame and ROI batches.
Definition: sources/libs/nvmultiobjecttracker/include/modules/utility/DsLowLevelTracker.hpp:346
_NvMOTTimeMeta::localTimestamp
TimeStamp localTimestamp
Host wall ns from NvDsCurrentTimestampNs when prepared.
Definition: includes/nvdstracker.h:70
_NvMOTTrackedObjList::frameNum
NvMOTFrameNum frameNum
Holds the frame number for objects in the list.
Definition: includes/nvdstracker.h:361
DsLowLevelTracker::DsLowLevelTracker
DsLowLevelTracker()
Initialize empty low-level tracker input and output storage.
Definition: sources/libs/nvmultiobjecttracker/include/modules/utility/DsLowLevelTracker.hpp:37
NVMOTCOMP_ANY
#define NVMOTCOMP_ANY
Defines a compute target flag for "any target.".
Definition: includes/nvdstracker.h:83
NvMOT_RemoveStreams
NvMOTStatus NvMOT_RemoveStreams(NvMOTContextHandle contextHandle, NvMOTStreamId streamIdMask)
Removes streams from a batch.
DsLowLevelTracker::deAllocateMotInputData
void deAllocateMotInputData()
Release low-level tracker input storage.
Definition: sources/libs/nvmultiobjecttracker/include/modules/utility/DsLowLevelTracker.hpp:321
_NvMOTObjToTrack::classId
NvMOTClassId classId
Holds the class of the object.
Definition: includes/nvdstracker.h:245
DsLowLevelTracker::update
const NvMOTTrackedObjBatch & update(const FrameBatch &framesInBatch, const int numTransforms, RoiBatch rois=RoiBatch(), const bool isDetectionDone=false, const uint32_t frameBatchNo=0)
Process a batch of frames and return the current tracker output.
Definition: sources/libs/nvmultiobjecttracker/include/modules/utility/DsLowLevelTracker.hpp:123
NvBufSurfaceParams
struct NvBufSurfaceParams NvBufSurfaceParams
Hold the information of single buffer in the batch.
NvMOT_Init
NvMOTStatus NvMOT_Init(NvMOTConfig *pConfigIn, NvMOTContextHandle *pContextHandle, NvMOTConfigResponse *pConfigResponse)
Initializes a tracking context for a batch of one or more image streams.
NvBufSurfaceParams
Hold the information of single buffer in the batch.
Definition: includes/nvbufsurface.h:567
_NvMOTConfigResponse
Holds a tracker's configuration status.
Definition: includes/nvdstracker.h:182
_NvMOTFrame::streamID
NvMOTStreamId streamID
Holds the stream ID of the stream source for this frame.
Definition: includes/nvdstracker.h:284
_NvMOTConfig::miscConfig
NvMOTMiscConfig miscConfig
Holds miscellaneous configurations.
Definition: includes/nvdstracker.h:145
_NvMOTConfig::customConfigFilePathSize
uint16_t customConfigFilePathSize
Holds the length of customConfigFilePath.
Definition: includes/nvdstracker.h:147
_NvMOTFrame::numBuffers
uint8_t numBuffers
Holds the number of entries in bufferList.
Definition: includes/nvdstracker.h:303
DsLowLevelTracker::allocateMotOutputData
void allocateMotOutputData(const int maxVideoStreams, const int maxObjectsPerFrame)
Allocate current-frame tracker output storage.
Definition: sources/libs/nvmultiobjecttracker/include/modules/utility/DsLowLevelTracker.hpp:239
DsLowLevelTracker::isInitialized
bool isInitialized()
Report whether the low-level tracker is initialized.
Definition: sources/libs/nvmultiobjecttracker/include/modules/utility/DsLowLevelTracker.hpp:64
_NvMOTObjToTrack::bbox
NvMOTRect bbox
Holds the bounding box of the object.
Definition: includes/nvdstracker.h:247
_NvMOTPerTransformBatchConfig::maxSize
uint32_t maxSize
Holds the maximum size of the buffer in bytes.
Definition: includes/nvdstracker.h:107
_NvMOTTrackedObjBatch::numFilled
uint32_t numFilled
Holds the number of filled blocks in the list.
Definition: includes/nvdstracker.h:382
DsLowLevelTracker
Adapts test frame and ROI batches to the low-level tracker API.
Definition: sources/libs/nvmultiobjecttracker/include/modules/utility/DsLowLevelTracker.hpp:33
NvBufSurfacePlaneParams::pitch
uint32_t pitch[NVBUF_MAX_PLANES]
Holds the pitches of planes in bytes.
Definition: includes/nvbufsurface.h:421
NvMOTCompute
uint8_t NvMOTCompute
Definition: includes/nvdstracker.h:90
NvMOTStreamId
uint64_t NvMOTStreamId
Definition: includes/nvdstracker.h:53
NvBufSurfacePlaneParams::bytesPerPix
uint32_t bytesPerPix[NVBUF_MAX_PLANES]
Holds the number of bytes occupied by a pixel in each plane.
Definition: includes/nvbufsurface.h:427
NvBufSurfaceParams::height
uint32_t height
Holds the height of the buffer.
Definition: includes/nvbufsurface.h:571
NvBufSurfaceMappedAddr::addr
void * addr[NVBUF_MAX_PLANES]
Holds planewise pointers to a CPU mapped buffer.
Definition: includes/nvbufsurface.h:506
_NvMOTTrackedObjBatch::numAllocated
uint32_t numAllocated
Holds the number of blocks allocated for the list.
Definition: includes/nvdstracker.h:380
_NvMOTObjToTrack
Holds information about an object to be tracked.
Definition: includes/nvdstracker.h:242
_NvMOTObjToTrackList::numAllocated
uint32_t numAllocated
Holds the number of blocks allocated for the list.
Definition: includes/nvdstracker.h:267
_NvMOTRect::height
float height
Holds the height of the bounding box, in pixels.
Definition: includes/nvdstracker.h:219
_NvMOTConfig::computeConfig
NvMOTCompute computeConfig
Holds the compute target.
Definition: includes/nvdstracker.h:133
NvMOTContext
Context for input video streams.
Definition: sources/libs/nvmultiobjecttracker/include/modules/NvMultiObjectTracker/context.hpp:23
NvBufSurfacePlaneParams::height
uint32_t height[NVBUF_MAX_PLANES]
Holds the heights of planes.
Definition: includes/nvbufsurface.h:419
_NvMOTObjToTrack::doTracking
bool doTracking
Holds a Boolean which is true if NvMOT is to track this object.
Definition: includes/nvdstracker.h:251
_NvMOTConfig::maxStreams
uint32_t maxStreams
Holds the maximum number of streams in a batch.
Definition: includes/nvdstracker.h:135
_NvMOTProcessParams
Holds parameters for processing a batch.
Definition: includes/nvdstracker.h:408
DsLowLevelTracker::initializeLowLeveTracker
void initializeLowLeveTracker(uint maxWidth, uint maxHeight, uint maxPitch, NvBufSurfaceColorFormat colorFormat, uint maxStream, uint numTransforms, std::string lowLevelTrackerConfigFilePath="")
Recreate the low-level tracker context for configured transforms and streams.
Definition: sources/libs/nvmultiobjecttracker/include/modules/utility/DsLowLevelTracker.hpp:181
NvBufSurfaceParams::planeParams
NvBufSurfacePlaneParams planeParams
Holds planewise information (width, height, pitch, offset, etc.).
Definition: includes/nvbufsurface.h:587
DsLowLevelTracker::allocateMotInputData
void allocateMotInputData(const int numTransforms, const int numVideoStreams, const int maxObjectsPerFrame)
Allocate low-level tracker input storage.
Definition: sources/libs/nvmultiobjecttracker/include/modules/utility/DsLowLevelTracker.hpp:287
_NvMOTTrackedObjList
Holds a list of tracked objects.
Definition: includes/nvdstracker.h:356
_NvMOTFrame::frameNum
NvMOTFrameNum frameNum
Holds the sequential frame number that identifies the frame within the stream.
Definition: includes/nvdstracker.h:291
_NvMOTPerTransformBatchConfig::maxWidth
uint32_t maxWidth
Holds the maximum width of each frame.
Definition: includes/nvdstracker.h:101
DsLowLevelTracker::m_motOutputObjectsMeta
NvMOTTrackedObjBatch m_motOutputObjectsMeta
Current-frame output from the tracker.
Definition: sources/libs/nvmultiobjecttracker/include/modules/utility/DsLowLevelTracker.hpp:503
DsLowLevelTracker::mp_MotCtx
NvMOTContext * mp_MotCtx
Low-level tracker context.
Definition: sources/libs/nvmultiobjecttracker/include/modules/utility/DsLowLevelTracker.hpp:506
DsLowLevelTracker::m_motConfigResponse
NvMOTConfigResponse m_motConfigResponse
Response to the tracker configuration request.
Definition: sources/libs/nvmultiobjecttracker/include/modules/utility/DsLowLevelTracker.hpp:507
_NvMOTRect::width
float width
Holds the width of the bounding box, in pixels.
Definition: includes/nvdstracker.h:217
_NvMOTObjToTrackList::detectionDone
bool detectionDone
Holds a Boolean which is true if detection was done on this frame even if the list of objects to trac...
Definition: includes/nvdstracker.h:263
DsLowLevelTracker::getMotInputParams
const std::map< NvMOTStreamId, NvMOTFrame * > getMotInputParams()
Return input frame metadata keyed by video stream ID.
Definition: sources/libs/nvmultiobjecttracker/include/modules/utility/DsLowLevelTracker.hpp:155
_NvMOTProcessParams::frameList
NvMOTFrame * frameList
Holds a pointer to an array of frame data.
Definition: includes/nvdstracker.h:411
FrameBatch
std::map< NvMOTStreamId, std::pair< uint32_t, cv::Mat > > FrameBatch
Maps each stream ID to a frame number and source image.
Definition: sources/libs/nvmultiobjecttracker/include/modules/utility/DsLowLevelTracker.hpp:30
_NvMOTRect::x
float x
Holds the left edge position of the object bounding box, in pixels.
Definition: includes/nvdstracker.h:213
_NvMOTRect::y
float y
Holds the top edge position of the object bounding box, in pixels.
Definition: includes/nvdstracker.h:215
Time
Formats and compares system-clock timestamps.
Definition: sources/libs/nvmultiobjecttracker/include/modules/utility/timeStamp.hpp:24
RoiBatch
std::map< NvMOTStreamId, std::vector< std::tuple< int, cv::Rect2f, uint, float > > > RoiBatch
Maps each stream ID to tuples of bounding-box index, bounding box, class ID, and detection confidence...
Definition: sources/libs/nvmultiobjecttracker/include/modules/utility/DsLowLevelTracker.hpp:27
_NvMOTPerTransformBatchConfig::bufferType
NvBufSurfaceMemType bufferType
Holds the type of buffer.
Definition: includes/nvdstracker.h:99
_NvMOTTimeMeta
Per-frame timing: stream PTS (when valid), host-local ns for deltas, and frame index.
Definition: includes/nvdstracker.h:66
_NvMOTFrame::sensorName
const char * sensorName
Holds the sensor name of the stream source (e.g.
Definition: includes/nvdstracker.h:312
_NvMOTTrackedObjList::numFilled
uint32_t numFilled
Holds the number of populated blocks in the list.
Definition: includes/nvdstracker.h:369
NvBufSurfaceParams::mappedAddr
NvBufSurfaceMappedAddr mappedAddr
Holds pointers to mapped buffers.
Definition: includes/nvbufsurface.h:590
_NvMOTObjToTrackList
Holds a list of objects.
Definition: includes/nvdstracker.h:259
NVBUF_COLOR_FORMAT_NV12
@ NVBUF_COLOR_FORMAT_NV12
Specifies BT.601 colorspace - Y/CbCr 4:2:0 multi-planar.
Definition: includes/nvbufsurface.h:125
DsLowLevelTracker::deAllocateMotOutputData
void deAllocateMotOutputData()
Release current-frame tracker output storage.
Definition: sources/libs/nvmultiobjecttracker/include/modules/utility/DsLowLevelTracker.hpp:266
_NvMOTFrame::doTracking
bool doTracking
Holds a Boolean which is true if objects in this frame are to be tracked.
Definition: includes/nvdstracker.h:299
_NvMOTConfig::perTransformBatchConfig
NvMOTPerTransformBatchConfig * perTransformBatchConfig
Holds a pointer to a list of numTransform batch configurations, one per transform,...
Definition: includes/nvdstracker.h:143
NvBufSurfaceParams::pitch
uint32_t pitch
Holds the pitch of the buffer.
Definition: includes/nvbufsurface.h:573
NVBUF_COLOR_FORMAT_RGBA
@ NVBUF_COLOR_FORMAT_RGBA
Specifies RGBA-8-8-8-8 single plane.
Definition: includes/nvbufsurface.h:151
_NvMOTTrackedObjList::streamID
NvMOTStreamId streamID
Holds the stream ID of the stream associated with objects in the list.
Definition: includes/nvdstracker.h:359
_NvMOTTimeMeta::frameTimeStamp
NvMOTTimeStamp frameTimeStamp
Stream/media time (e.g.
Definition: includes/nvdstracker.h:69
_NvMOTConfig
Holds a tracker configuration.
Definition: includes/nvdstracker.h:130
_NvMOTConfig::customConfigFilePath
char * customConfigFilePath
A pointer to the pathname of the tracker's custom configuration file.
Definition: includes/nvdstracker.h:150
NvMOT_Process
NvMOTStatus NvMOT_Process(NvMOTContextHandle contextHandle, NvMOTProcessParams *pParams, NvMOTTrackedObjBatch *pTrackedObjectsBatch)
Processes a batch.
NvBufSurfaceParams::colorFormat
NvBufSurfaceColorFormat colorFormat
Holds the color format of the buffer.
Definition: includes/nvbufsurface.h:575
NvBufSurfaceColorFormat
NvBufSurfaceColorFormat
Defines color formats for NvBufSurface.
Definition: includes/nvbufsurface.h:110
_NvMOTTrackedObjList::valid
bool valid
Holds a Boolean which is true if this entry in the batch is valid.
Definition: includes/nvdstracker.h:363
_NvMOTConfig::numTransforms
uint8_t numTransforms
Holds the number of NvMOTPerTransformBatchConfig entries in perTransformBatchConfig.
Definition: includes/nvdstracker.h:140
DsLowLevelTracker::m_debugVerboseLevel
int m_debugVerboseLevel
Debug verbosity level.
Definition: sources/libs/nvmultiobjecttracker/include/modules/utility/DsLowLevelTracker.hpp:510
_NvMOTTrackedObjBatch::list
NvMOTTrackedObjList * list
Holds a pointer to an array of object lists.
Definition: includes/nvdstracker.h:378
Time::getUnixTimestampNanoSeconds
TimeStamp getUnixTimestampNanoSeconds()
Return nanoseconds elapsed since the Unix epoch.
Definition: sources/libs/nvmultiobjecttracker/include/modules/utility/timeStamp.hpp:45
_NvMOTMiscConfig
Holds miscellaneous configurations.
Definition: includes/nvdstracker.h:114