|
|
NVIDIA DeepStream SDK API Reference
|
9.2 Release
|
Go to the documentation of this file.
18 #ifndef NVMULTIOBJECTTRACKERLIB_NVMULTIOBJECTTRACKER_COMMON_HPP_
19 #define NVMULTIOBJECTTRACKERLIB_NVMULTIOBJECTTRACKER_COMMON_HPP_
22 #include "nvds_tracker_meta.h"
32 #include <condition_variable>
35 using uint =
unsigned int;
38 #include "modules/utility/cv_functions.hpp"
39 #include "modules/NvMultiObjectTracker/localizer.hpp"
186 const NvMOTFrameNum frameNum_ = 0,
const uint16_t classId_ = 0,
203 if(detObjIn_ !=
nullptr)
339 typedef std::pair<const std::map<NvMOTStreamId, NvMOTFrame *> *, \
371 void initialize(
const uint numThreads, std::function<
void(T)> funcPerThread);
389 #endif // NVMULTIOBJECTTRACKERLIB_NVMULTIOBJECTTRACKER_COMMON_HPP_
uint32_t maxStreams
Max # of video streams to be supported.
TargetInfo(TargetInfo &&) noexcept=default
Move-construct target information.
float confidence
Detector confidence.
TargetInfo & operator=(TargetInfo &&) noexcept=default
Move-assign target information.
std::queue< T > m_inputQueue
Queue for input.
uint m_submittedJobCnt
Keep track of how many tasks are submitted.
size_t srcImagePitch
Row pitch of the source-frame memory.
std::vector< std::thread > m_threadList
Persistent threads over batches.
std::condition_variable m_cond4Out
Condition variable associated with the output.
float confidence
Holds the detection confidence of the object.
void waitToFinish()
Wait all worker threads to finish in main thread.
Eigen::Matrix2f pt_world_feet_cov
Covariance of the foot location.
std::list< TargetInfo > tracklet
Target trajectory.
float visibility
Visible fraction of the object after occlusion and image-border cropping.
bool m_persistThreadRunning
Whether associate persistent threads should keep running; set false if receive deinit signal.
std::map< TrackerIndex, std::shared_ptr< NvTrackedObject > > NvTrackedObjectList
TargetInfo(const DetectedObjInfo *detObjIn_=nullptr, const NvMOTStreamId videoStreamId_=0, const NvMOTFrameNum frameNum_=0, const uint16_t classId_=0, const NvMotDataTypes::Rect2f bbox_=NvMotDataTypes::Rect2f(), const NvMOTFrameNum age_=0, const NvMOTFrameNum shadowAge_=0, const TRACKER_STATE state=TRACKER_STATE::EMPTY)
Initialize a target state from optional detector information.
~NvTrackerMultiThreadWorker()
Stop and join all persistent worker threads.
NvMotDataTypes::Size srcImageSize
Size of the source image.
Eigen::Vector2f loc
Bounding-box centroid in image coordinates.
DetectedObjInfo(const NvMOTObjToTrack *objIn_, const uint16_t bboxInd_, NvMOTClassId classId_, float confidence_, NvMotDataTypes::Rect2f bbox_, Eigen::Vector2f loc_)
Initialize detected-object information from explicit metadata and geometry.
float confidence
Tracker confidence.
std::string CamId
Camera IDs are represented as strings to maintain consistency across different communicator types.
std::vector< float > pose3d
Per-object 3D pose keypoints.
float distFromCam
Distance from the camera center to the model waist in world coordinates.
Stores and updates the state of one tracked target.
std::function< void(T)> m_funcPerThread
Data processing function in each worker thread.
void initialize(const uint numThreads, std::function< void(T)> funcPerThread)
Launch all worker threads and worker function.
SourceFrameInfo()
Initialize per-batch source-frame state.
DetectedObjInfo & operator=(DetectedObjInfo &&) noexcept=default
Move-assign detected-object information.
NvMOTClassId classId
Object class ID.
NvMOTStreamId videoStreamId
Video stream ID set during initialization.
TRACKER_STATE trackerState
Current tracker state such as ACTIVE or INACTIVE.
uint64_t frameBatchNo
Frame batch count from the beginning.
Stores a terminated target trajectory for archival output.
NvMotDataTypes::Size originalSrcImageSize
Size of the original video source image.
void update(const NvMOTFrameNum frameNum_, const NvMotDataTypes::Rect2f bbox_, const float imgBorderCroppingVisibility_)
Update target state without a matched detection.
NvMOTClassId classId
Holds the class of the object.
Eigen::Vector2f pt_world_feet
Person foot location on the floor in world coordinates.
std::map< NvMOTStreamId, std::pair< uint32_t, bool > > isDetectionDonePerStream
Indicates whether inference is complete for each stream.
bool m_isInit
Indicates whether the worker has been initialized.
float imgBorderCroppingVisibility
Bounding-box visibility with respect to the image border.
uint32_t shadowTrackingAge
Number of frames since the tracker entered INACTIVE state.
int max(int a, int b)
Compute the component-wise maximum.
float visibility
Visible fraction of the object after occlusion and image-border cropping.
std::mutex m_outputLock
Lock associated with output.
void update(const NvMOTFrameNum frameNum_, const DetectedObjInfo *detObjIn_, const NvMotDataTypes::Rect2f bbox_, const float imgBorderCroppingVisibility_)
Update target state from a matched detection.
uint32_t lastFrameMatched
Last frame number on which the target matched a detector bounding box.
DetectedObjInfo * matchedDetObjInfo
Holds a pointer to the associated input object used in low level tracker.
DetectedObjInfo()
Initialize detected-object information with default values.
NvMOTFrameNum frameNum
Frame number.
NvMOTRect bbox
Holds the bounding box of the object.
Eigen::Vector2f pt_img_feet
Person foot location in image coordinates.
std::vector< Eigen::Vector2f > convexHull
Convex hull of the projected 3D object model centered on the bounding box.
Eigen::Vector2f getBboxCenterPt(const NvMotDataTypes::Rect2f &bbox)
Compute the center point of a bounding box.
bool isInitialized()
Report whether the worker queue is initialized.
Holds information about an object to be tracked.
void threadLoopFunc()
Process queued jobs until the worker receives a deinitialization signal.
Eigen::Vector2f pt_img_feet
Person foot location in image coordinates.
float height
Holds the height of the bounding box, in pixels.
Eigen::Vector2f loc
Bounding-box centroid.
NvMotDataTypes::Rect2f tBbox
Object bbox.
NvMOTClassId classId
Object class ID.
bool isReported
Indicates whether the tracklet has been reported externally.
float width
Holds the width of the bounding box, in pixels.
uint16_t bboxInd
Object bbox ind in the metadata.
float x
Holds the left edge position of the object bounding box, in pixels.
NvBufSurfaceColorFormat colorFormat
Color format of the input surfaces.
float y
Holds the top edge position of the object bounding box, in pixels.
NvMotDataTypes::Rect2f origBbox
Original bounding box from the detector.
DetectedObjInfo(const NvMOTObjToTrack *objIn_, const uint16_t bboxInd_)
Initialize detected-object information from input object metadata.
uint m_finishedJobCnt
Keep track of how many tasks are finished.
NvMotDataTypes::Rect2f bbox
Object bbox.
uint32_t maxBufSurfAddrSize
Max size of surface buffer pool.
float height
OMP-estimated person height in world coordinates (m).
std::condition_variable m_cond4In
Condition variable associated with the input queue.
NvMotDataTypes::Rect2f constructRect2f(const float minX=0, const float minY=0, const float width=0, const float height=0)
Construct an axis-aligned rectangle from its origin and size.
float distFromCam
Distance from the camera.
Represents a two-dimensional integer size.
Information about the input source frames for the input frame batch.
Detected object info obtained from input metadata.
void setLocation(const NvMotDataTypes::Rect2f bbox_)
Update the target bounding box and centroid.
const NvMOTObjToTrack * objIn
Holds a pointer to the associated input object in the metadata.
std::pair< const std::map< NvMOTStreamId, NvMOTFrame * > *, std::map< NvMOTStreamId, std::deque< DetectedObjInfo > > * > DisMahalanobisIn
Input data structure to compute Mahalanobis distance.
std::vector< float > reidEmbedding
Archived L2-normalized ReID embedding captured at termination.
uint32_t frameNumTerminated
Frame number at which the target was terminated.
std::vector< Eigen::Vector2f > convexHull
Convex hull of the projected 3D object model centered on the bounding box.
NvMOTObjToTrack * getMatchedDetObjIn() const
Return the input object metadata matched to the target.
Eigen::Vector2f pt_world_feet
Person foot location on the floor in world coordinates.
NvTrackerMultiThreadWorker()
Initialize an empty worker queue.
Multi-threaded producer-consumer queue to perform some task.
std::vector< float > pose25d
Per-object 2.5D pose keypoints.
NvMOTFrameNum age
Number of frames for which the target has been tracked.
void submitInput(T inData)
Submit association input data to queue in main thread.
NvBufSurfaceColorFormat
Defines color formats for NvBufSurface.
std::mutex m_inputLock
Lock associated with input queue.
NvMotDataTypes::Rect2f origBbox
Original bounding box from the detector.