NVIDIA DeepStream SDK API Reference

9.2 Release
TrackerVizOutput Class Reference

Detailed Description

Renders and writes visual tracker debugging output.

Definition at line 43 of file sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

Inheritance diagram for TrackerVizOutput:
Collaboration diagram for TrackerVizOutput:

Public Member Functions

 TrackerVizOutput (VisualTracker *visTracker, const std::shared_ptr< NvTrackedObjectManager > targets)
 Construct output rendering for a CUDA visual tracker. More...
 
 TrackerVizOutput (DCFTracker *dcfTracker, const std::shared_ptr< NvTrackedObjectManager > targets)
 Construct output rendering for a VPI DCF tracker. More...
 
 ~TrackerVizOutput ()
 Destroy the visualization output writer. More...
 
cv::Mat make_dist_colors (unsigned nb)
 Generate visually distinct BGR colors by distributing shuffled hues. More...
 
void writeBirdsEyeView (const uint outputDirectoryKey=0)
 Render and write a bird's-eye view for each available stream. More...
 
void writeAllTrajectoriesOnEveryFrame (const uint outputDirectoryKey=0)
 Draw all current trajectories on each available source frame and write the results. More...
 
void writeEachCompletedTrajectory (const uint outputDirectoryKey=0)
 Draw and write each trajectory after its track completes. More...
 
void writeSrcImagePatchesWithCorrResp (const uint outputDirectoryKey=0)
 Write source image patches alongside their correlation-response visualizations. More...
 
void writeSrcImagePatchesWithMaskFilter (const uint outputDirectoryKey=0)
 Write source image patches alongside their segmentation-filter masks. More...
 
 TrackerVizOutput (VisualTracker *visTracker, const std::shared_ptr< NvTrackedObjectManager > targets)
 Construct output rendering for a CUDA visual tracker. More...
 
 TrackerVizOutput (DCFTracker *dcfTracker, const std::shared_ptr< NvTrackedObjectManager > targets)
 Construct output rendering for a VPI DCF tracker. More...
 
 ~TrackerVizOutput ()
 Destroy the visualization output writer. More...
 
cv::Mat make_dist_colors (unsigned nb)
 Generate visually distinct BGR colors by distributing shuffled hues. More...
 
void writeBirdsEyeView (const uint outputDirectoryKey=0)
 Render and write a bird's-eye view for each available stream. More...
 
void writeAllTrajectoriesOnEveryFrame (const uint outputDirectoryKey=0)
 Draw all current trajectories on each available source frame and write the results. More...
 
void writeEachCompletedTrajectory (const uint outputDirectoryKey=0)
 Draw and write each trajectory after its track completes. More...
 
void writeSrcImagePatchesWithCorrResp (const uint outputDirectoryKey=0)
 Write source image patches alongside their correlation-response visualizations. More...
 
void writeSrcImagePatchesWithMaskFilter (const uint outputDirectoryKey=0)
 Write source image patches alongside their segmentation-filter masks. More...
 
bool isImageOutputEnabled (const uint outputDirectoryKey=0)
 Report whether image output is enabled for a directory key. More...
 
bool isImageOutputEnabled (const uint outputDirectoryKey=0)
 Report whether image output is enabled for a directory key. More...
 
bool isVideoOutputEnabled ()
 Report whether video output is enabled. More...
 
bool isVideoOutputEnabled ()
 Report whether video output is enabled. More...
 
bool enableVideoOutput (const std::string outputVideoDirectory, const std::string outputVideoName, cv::Size videoSize, const double fps=5.f)
 Create an AVI writer and enable video output. More...
 
bool enableVideoOutput (const std::string outputVideoDirectory, const std::string outputVideoName, cv::Size videoSize, const double fps=5.f)
 Create an AVI writer and enable video output. More...
 
void enableImageOutput (const std::string outputImageDirectory, const int compressionLevel=95, const uint outputDirectoryKey=0)
 Configure a keyed directory for JPEG image output. More...
 
void enableImageOutput (const std::string outputImageDirectory, const int compressionLevel=95, const uint outputDirectoryKey=0)
 Configure a keyed directory for JPEG image output. More...
 
void writeVideoOutput (const cv::Mat &img)
 Append an image to the output video. More...
 
void writeVideoOutput (const cv::Mat &img)
 Append an image to the output video. More...
 
void writeImageOutput (const cv::Mat &img, const std::string imgFilename, const uint outputDirectoryKey=0, const std::string subFolderName="")
 Write an image to a keyed output directory. More...
 
void writeImageOutput (const cv::Mat &img, const std::string imgFilename, const uint outputDirectoryKey=0, const std::string subFolderName="")
 Write an image to a keyed output directory. More...
 

Protected Member Functions

void writeSrcImagePatchesWithCorrResp_perTarget (const NvMOTStreamId streamId_, const int trackerInd, const uint outputDirectoryKey, cv::Mat srcImgPatch, cv::Mat corrRespMat)
 Buffer a source patch paired with its correlation-response image for one target. More...
 
void writeSrcImagePatchesWithMaskFilter_perTarget (const NvMOTStreamId streamId_, const int trackerInd, const uint outputDirectoryKey, cv::Mat srcImgPatch, cv::Mat maskMat)
 Buffer a source patch paired with its segmentation-filter mask for one target. More...
 
void addToWriteBuffer (const std::shared_ptr< NvTrackedObject > target, const cv::Mat &img, const uint frameNum, const uint outputDirectoryKey, const std::string subFolderName, const std::string fileNamePrefix="")
 Add an image to a target's pending output buffer. More...
 
void writeFromWriteBuffer (const std::shared_ptr< NvTrackedObject > target)
 Write and clear pending images after a target receives a persistent ID. More...
 
cv::Mat prepareCorrelationResponseImg (const NvMOTStreamId streamId_, const uint trackerInd, std::vector< cv::Mat > &corrRespMats, const cv::Size dstSize, const bool showPeakPoint=true, const bool showDetBboxes=true)
 Prepare a color-mapped correlation response with optional target and detection markers. More...
 
cv::Mat prepareMaskFilterImg (const NvMOTStreamId streamId_, const uint trackerInd, std::vector< cv::Mat > &maskMats, const cv::Size dstSize)
 Prepare an 8-bit BGR visualization of a target's segmentation-filter mask. More...
 
void drawFullTrajectory (const uint64_t targetID, const std::list< TargetInfo > &trajectory, cv::Mat &frame)
 Draw a target's complete trajectory on a frame. More...
 
void drawRecentTrajectory (const std::shared_ptr< NvTrackedObject > tracker, cv::Mat &frame, const bool showCurrentDetBbox=true, const bool showCurrentTargetBbox=true, const bool showPrediction=false, const bool showPredictionUncertainty=false, const bool showTrajectoryOnFeet=false)
 Draw a target's recent trajectory, current boxes, and optional predictions on a frame. More...
 
void drawUncertaintyEllipse (cv::Mat &frame, const cv::Mat P, const cv::Mat Pcov, cv::Scalar color, float scale=1.f)
 Draw a covariance-derived uncertainty ellipse around a predicted position. More...
 
void drawProjectedTargetModel (const std::shared_ptr< NvTrackedObject > target, cv::Mat &frame)
 Draw a target's projected human model on the camera frame. More...
 
void drawProjectedPeerTrajectory (const PeerTargetDB &peerTargetDB, cv::Mat &frame, const NvMOTStreamId &videoStreamID, const int &frameNum, const std::map< TargetId, cv::Scalar > &targetColorList)
 Draw peer-camera target boxes and trajectories projected into the current camera frame. More...
 
void writeSrcImagePatchesWithCorrResp_perTarget (const NvMOTStreamId streamId_, const int trackerInd, const uint outputDirectoryKey, cv::Mat srcImgPatch, cv::Mat corrRespMat)
 Buffer a source patch paired with its correlation-response image for one target. More...
 
void writeSrcImagePatchesWithMaskFilter_perTarget (const NvMOTStreamId streamId_, const int trackerInd, const uint outputDirectoryKey, cv::Mat srcImgPatch, cv::Mat maskMat)
 Buffer a source patch paired with its segmentation-filter mask for one target. More...
 
void addToWriteBuffer (const std::shared_ptr< NvTrackedObject > target, const cv::Mat &img, const uint frameNum, const uint outputDirectoryKey, const std::string subFolderName, const std::string fileNamePrefix="")
 Add an image to a target's pending output buffer. More...
 
void writeFromWriteBuffer (const std::shared_ptr< NvTrackedObject > target)
 Write and clear pending images after a target receives a persistent ID. More...
 
cv::Mat prepareCorrelationResponseImg (const NvMOTStreamId streamId_, const uint trackerInd, std::vector< cv::Mat > &corrRespMats, const cv::Size dstSize, const bool showPeakPoint=true, const bool showDetBboxes=true)
 Prepare a color-mapped correlation response with optional target and detection markers. More...
 
cv::Mat prepareMaskFilterImg (const NvMOTStreamId streamId_, const uint trackerInd, std::vector< cv::Mat > &maskMats, const cv::Size dstSize)
 Prepare an 8-bit BGR visualization of a target's segmentation-filter mask. More...
 
void drawFullTrajectory (const uint64_t targetID, const std::list< TargetInfo > &trajectory, cv::Mat &frame)
 Draw a target's complete trajectory on a frame. More...
 
void drawRecentTrajectory (const std::shared_ptr< NvTrackedObject > tracker, cv::Mat &frame, const bool showCurrentDetBbox=true, const bool showCurrentTargetBbox=true, const bool showPrediction=false, const bool showPredictionUncertainty=false, const bool showTrajectoryOnFeet=false)
 Draw a target's recent trajectory, current boxes, and optional predictions on a frame. More...
 
void drawUncertaintyEllipse (cv::Mat &frame, const cv::Mat P, const cv::Mat Pcov, cv::Scalar color, float scale=1.f)
 Draw a covariance-derived uncertainty ellipse around a predicted position. More...
 
void drawProjectedTargetModel (const std::shared_ptr< NvTrackedObject > target, cv::Mat &frame)
 Draw a target's projected human model on the camera frame. More...
 
void drawProjectedPeerTrajectory (const PeerTargetDB &peerTargetDB, cv::Mat &frame, const NvMOTStreamId &videoStreamID, const int &frameNum, const std::map< TargetId, cv::Scalar > &targetColorList)
 Draw peer-camera target boxes and trajectories projected into the current camera frame. More...
 

Protected Attributes

VisualTracker * m_visualTracker = NULL
 CUDA visual tracker that supplies visualization data. More...
 
DCFTracker * m_dcfTracker = NULL
 VPI DCF tracker that supplies visualization data. More...
 
const std::shared_ptr< NvTrackedObjectManager > m_targets
 Manager that supplies tracked objects. More...
 
const int m_displayWidth = 1920
 Display/screen width. More...
 
const int m_srcImgWH = 240
 Visualization width and height for source image patches. More...
 
const int m_featImgWH = 160
 Visualization width and height for feature images. More...
 
std::map< uint32_t, std::deque< WriteBuffer_t > > m_writeBuffer
 Buffered outputs grouped by target index. More...
 
std::map< NvMOTStreamId, uint64_t > m_lastFrameMatchedInTrajectoryArchive
 The target ID of the latest trajectory archived. More...
 
std::map< NvMOTStreamId, cv::Mat > m_lastFrames
 The last source frame kept. More...
 
cv::VideoWriter * mOutputVideo
 Video writer used when video output is enabled. More...
 
bool mIsVideoOutputEnabled
 Indicates whether video output is enabled. More...
 
std::vector< int > compression_params
 OpenCV image-encoding parameters. More...
 
std::unordered_map< uint, std::string > mOutputImageDirectory
 Image output directories keyed by caller-defined values. More...
 
std::unordered_map< uint, bool > mIsImageOutputEnabled
 Image-output enabled state for each directory key. More...
 

Constructor & Destructor Documentation

◆ TrackerVizOutput() [1/4]

TrackerVizOutput::TrackerVizOutput ( VisualTracker *  visTracker,
const std::shared_ptr< NvTrackedObjectManager >  targets 
)
inline

Construct output rendering for a CUDA visual tracker.

Parameters
[in]visTrackerThe CUDA visual tracker that supplies visualization data.
[in]targetsThe manager that supplies tracked objects.

Definition at line 111 of file sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

◆ TrackerVizOutput() [2/4]

TrackerVizOutput::TrackerVizOutput ( DCFTracker *  dcfTracker,
const std::shared_ptr< NvTrackedObjectManager >  targets 
)
inline

Construct output rendering for a VPI DCF tracker.

Parameters
[in]dcfTrackerThe VPI DCF tracker that supplies visualization data.
[in]targetsThe manager that supplies tracked objects.

Definition at line 121 of file sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

◆ ~TrackerVizOutput() [1/2]

TrackerVizOutput::~TrackerVizOutput ( )
inline

Destroy the visualization output writer.

Definition at line 127 of file sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

◆ TrackerVizOutput() [3/4]

TrackerVizOutput::TrackerVizOutput ( VisualTracker *  visTracker,
const std::shared_ptr< NvTrackedObjectManager >  targets 
)
inline

Construct output rendering for a CUDA visual tracker.

Parameters
[in]visTrackerThe CUDA visual tracker that supplies visualization data.
[in]targetsThe manager that supplies tracked objects.

Definition at line 111 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

◆ TrackerVizOutput() [4/4]

TrackerVizOutput::TrackerVizOutput ( DCFTracker *  dcfTracker,
const std::shared_ptr< NvTrackedObjectManager >  targets 
)
inline

Construct output rendering for a VPI DCF tracker.

Parameters
[in]dcfTrackerThe VPI DCF tracker that supplies visualization data.
[in]targetsThe manager that supplies tracked objects.

Definition at line 121 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

◆ ~TrackerVizOutput() [2/2]

TrackerVizOutput::~TrackerVizOutput ( )
inline

Destroy the visualization output writer.

Definition at line 127 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

Member Function Documentation

◆ addToWriteBuffer() [1/2]

void TrackerVizOutput::addToWriteBuffer ( const std::shared_ptr< NvTrackedObject >  target,
const cv::Mat &  img,
const uint  frameNum,
const uint  outputDirectoryKey,
const std::string  subFolderName,
const std::string  fileNamePrefix = "" 
)
inlineprotected

Add an image to a target's pending output buffer.

Parameters
[in]targetThe tracked object that owns the output.
[in]imgThe image to buffer.
[in]frameNumThe associated frame number.
[in]outputDirectoryKeyThe output directory selector.
[in]subFolderNameThe output subfolder name.
[in]fileNamePrefixThe output filename prefix.

Clear any existing ones.

Definition at line 751 of file sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

References m_writeBuffer, and absl::move().

Referenced by writeSrcImagePatchesWithCorrResp_perTarget(), and writeSrcImagePatchesWithMaskFilter_perTarget().

◆ addToWriteBuffer() [2/2]

void TrackerVizOutput::addToWriteBuffer ( const std::shared_ptr< NvTrackedObject >  target,
const cv::Mat &  img,
const uint  frameNum,
const uint  outputDirectoryKey,
const std::string  subFolderName,
const std::string  fileNamePrefix = "" 
)
inlineprotected

Add an image to a target's pending output buffer.

Parameters
[in]targetThe tracked object that owns the output.
[in]imgThe image to buffer.
[in]frameNumThe associated frame number.
[in]outputDirectoryKeyThe output directory selector.
[in]subFolderNameThe output subfolder name.
[in]fileNamePrefixThe output filename prefix.

Clear any existing ones.

Definition at line 751 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

References m_writeBuffer, and absl::move().

◆ drawFullTrajectory() [1/2]

void TrackerVizOutput::drawFullTrajectory ( const uint64_t  targetID,
const std::list< TargetInfo > &  trajectory,
cv::Mat &  frame 
)
inlineprotected

Draw a target's complete trajectory on a frame.

Parameters
[in]targetIDThe persistent target identifier.
[in]trajectoryThe complete target trajectory.
[in,out]frameThe frame updated with the rendered trajectory.

Param to be configured.

Show target ID.

Definition at line 971 of file sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

References ACTIVE, max(), and PROJECTED.

Referenced by writeEachCompletedTrajectory().

◆ drawFullTrajectory() [2/2]

void TrackerVizOutput::drawFullTrajectory ( const uint64_t  targetID,
const std::list< TargetInfo > &  trajectory,
cv::Mat &  frame 
)
inlineprotected

Draw a target's complete trajectory on a frame.

Parameters
[in]targetIDThe persistent target identifier.
[in]trajectoryThe complete target trajectory.
[in,out]frameThe frame updated with the rendered trajectory.

Param to be configured.

Show target ID.

Definition at line 971 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

References ACTIVE, max(), and PROJECTED.

◆ drawProjectedPeerTrajectory() [1/2]

void TrackerVizOutput::drawProjectedPeerTrajectory ( const PeerTargetDB &  peerTargetDB,
cv::Mat &  frame,
const NvMOTStreamId &  videoStreamID,
const int &  frameNum,
const std::map< TargetId, cv::Scalar > &  targetColorList 
)
inlineprotected

Draw peer-camera target boxes and trajectories projected into the current camera frame.

Parameters
[in]peerTargetDBThe peer-camera target database.
[in,out]frameThe camera frame updated with peer trajectories.
[in]videoStreamIDThe current video stream identifier.
[in]frameNumThe current frame number.
[in]targetColorListColors already assigned to local target identifiers.

Skip peers whose last frame is more than two frames behind.

Set target trajectory color.

Not the first point.

Definition at line 1354 of file sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

References PeerTarget::frameNum, m_targets, make_dist_colors(), PeerTarget::nextState, and PeerTarget::tracklet.

Referenced by writeAllTrajectoriesOnEveryFrame().

◆ drawProjectedPeerTrajectory() [2/2]

void TrackerVizOutput::drawProjectedPeerTrajectory ( const PeerTargetDB &  peerTargetDB,
cv::Mat &  frame,
const NvMOTStreamId &  videoStreamID,
const int &  frameNum,
const std::map< TargetId, cv::Scalar > &  targetColorList 
)
inlineprotected

Draw peer-camera target boxes and trajectories projected into the current camera frame.

Parameters
[in]peerTargetDBThe peer-camera target database.
[in,out]frameThe camera frame updated with peer trajectories.
[in]videoStreamIDThe current video stream identifier.
[in]frameNumThe current frame number.
[in]targetColorListColors already assigned to local target identifiers.

Skip peers whose last frame is more than two frames behind.

Set target trajectory color.

Not the first point.

Definition at line 1354 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

References PeerTarget::frameNum, m_targets, make_dist_colors(), PeerTarget::nextState, and PeerTarget::tracklet.

◆ drawProjectedTargetModel() [1/2]

void TrackerVizOutput::drawProjectedTargetModel ( const std::shared_ptr< NvTrackedObject >  target,
cv::Mat &  frame 
)
inlineprotected

Draw a target's projected human model on the camera frame.

Parameters
[in]targetThe tracked object whose model is drawn.
[in,out]frameThe camera frame updated with the projected model.

If the last target state is not Active, then don't draw.

Draw the cylinderic human model.

Draw the feet location.

Definition at line 1292 of file sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

References ACTIVE, CV_FUNCS::convexHull(), TargetInfo::convexHull, TargetInfo::loc, TargetInfo::pt_img_feet, and TENTATIVE.

Referenced by writeAllTrajectoriesOnEveryFrame().

◆ drawProjectedTargetModel() [2/2]

void TrackerVizOutput::drawProjectedTargetModel ( const std::shared_ptr< NvTrackedObject >  target,
cv::Mat &  frame 
)
inlineprotected

Draw a target's projected human model on the camera frame.

Parameters
[in]targetThe tracked object whose model is drawn.
[in,out]frameThe camera frame updated with the projected model.

If the last target state is not Active, then don't draw.

Draw the cylinderic human model.

Draw the feet location.

Definition at line 1292 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

References ACTIVE, CV_FUNCS::convexHull(), TargetInfo::convexHull, TargetInfo::loc, TargetInfo::pt_img_feet, and TENTATIVE.

◆ drawRecentTrajectory() [1/2]

void TrackerVizOutput::drawRecentTrajectory ( const std::shared_ptr< NvTrackedObject >  tracker,
cv::Mat &  frame,
const bool  showCurrentDetBbox = true,
const bool  showCurrentTargetBbox = true,
const bool  showPrediction = false,
const bool  showPredictionUncertainty = false,
const bool  showTrajectoryOnFeet = false 
)
inlineprotected

Draw a target's recent trajectory, current boxes, and optional predictions on a frame.

Parameters
[in]trackerThe tracked object whose trajectory is drawn.
[in,out]frameThe frame updated with the rendered trajectory.
[in]showCurrentDetBboxWhether to draw the current detector bounding box.
[in]showCurrentTargetBboxWhether to draw the current target bounding box.
[in]showPredictionWhether to draw predicted target positions.
[in]showPredictionUncertaintyWhether to draw prediction uncertainty.
[in]showTrajectoryOnFeetWhether to anchor trajectory points at projected feet locations.

Param to be configured.

If the last target state is not Active, then don't draw.

Show target ID.

Consider only the latest N points.

Feet location.

Bbox center.

Bbox center.

Draw original detection bbox if there is.

Draw current bbox.

Draw the bbox center.

Time intervals for prediction.

The drawn radius is a fixed stand-in for uncertainty.

Two ellipses to show the prediction and uncertainty.

Draw the projected circle.

Time intervals for prediction.

Two ellipses to show the prediction and uncertainty.

Definition at line 1038 of file sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

References ACTIVE, _NvMOTObjToTrack::bbox, CV_FUNCS::constructRect2f(), drawUncertaintyEllipse(), _NvMOTRect::height, max(), TENTATIVE, _NvMOTRect::width, _NvMOTRect::x, and _NvMOTRect::y.

Referenced by writeAllTrajectoriesOnEveryFrame().

◆ drawRecentTrajectory() [2/2]

void TrackerVizOutput::drawRecentTrajectory ( const std::shared_ptr< NvTrackedObject >  tracker,
cv::Mat &  frame,
const bool  showCurrentDetBbox = true,
const bool  showCurrentTargetBbox = true,
const bool  showPrediction = false,
const bool  showPredictionUncertainty = false,
const bool  showTrajectoryOnFeet = false 
)
inlineprotected

Draw a target's recent trajectory, current boxes, and optional predictions on a frame.

Parameters
[in]trackerThe tracked object whose trajectory is drawn.
[in,out]frameThe frame updated with the rendered trajectory.
[in]showCurrentDetBboxWhether to draw the current detector bounding box.
[in]showCurrentTargetBboxWhether to draw the current target bounding box.
[in]showPredictionWhether to draw predicted target positions.
[in]showPredictionUncertaintyWhether to draw prediction uncertainty.
[in]showTrajectoryOnFeetWhether to anchor trajectory points at projected feet locations.

Param to be configured.

If the last target state is not Active, then don't draw.

Show target ID.

Consider only the latest N points.

Feet location.

Bbox center.

Bbox center.

Draw original detection bbox if there is.

Draw current bbox.

Draw the bbox center.

Time intervals for prediction.

The drawn radius is a fixed stand-in for uncertainty.

Two ellipses to show the prediction and uncertainty.

Draw the projected circle.

Time intervals for prediction.

Two ellipses to show the prediction and uncertainty.

Definition at line 1038 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

References ACTIVE, _NvMOTObjToTrack::bbox, CV_FUNCS::constructRect2f(), drawUncertaintyEllipse(), _NvMOTRect::height, max(), TENTATIVE, _NvMOTRect::width, _NvMOTRect::x, and _NvMOTRect::y.

◆ drawUncertaintyEllipse() [1/2]

void TrackerVizOutput::drawUncertaintyEllipse ( cv::Mat &  frame,
const cv::Mat  P,
const cv::Mat  Pcov,
cv::Scalar  color,
float  scale = 1.f 
)
inlineprotected

Draw a covariance-derived uncertainty ellipse around a predicted position.

Parameters
[in,out]frameThe frame updated with the rendered ellipse.
[in]PThe predicted position vector.
[in]PcovThe predicted position covariance matrix.
[in]colorThe ellipse color.
[in]scaleThe ellipse-size scale factor.

Compute the vanishing correlation coefficient.

Compute the principal semi-diameters of the ellipse.

Compute the angle between the x1 axis and the semi-diameter of length p1.

Convert from Radian to Degree.

Drawing the ellipse.

Definition at line 1247 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

References half_float::atan(), half_float::cos(), half_float::pow(), half_float::sin(), half_float::detail::sqrt(), and width.

◆ drawUncertaintyEllipse() [2/2]

void TrackerVizOutput::drawUncertaintyEllipse ( cv::Mat &  frame,
const cv::Mat  P,
const cv::Mat  Pcov,
cv::Scalar  color,
float  scale = 1.f 
)
inlineprotected

Draw a covariance-derived uncertainty ellipse around a predicted position.

Parameters
[in,out]frameThe frame updated with the rendered ellipse.
[in]PThe predicted position vector.
[in]PcovThe predicted position covariance matrix.
[in]colorThe ellipse color.
[in]scaleThe ellipse-size scale factor.

Compute the vanishing correlation coefficient.

Compute the principal semi-diameters of the ellipse.

Compute the angle between the x1 axis and the semi-diameter of length p1.

Convert from Radian to Degree.

Drawing the ellipse.

Definition at line 1247 of file sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

References half_float::atan(), half_float::cos(), half_float::pow(), half_float::sin(), half_float::detail::sqrt(), and width.

Referenced by drawRecentTrajectory().

◆ enableImageOutput() [1/2]

void FrameOutput::enableImageOutput ( const std::string  outputImageDirectory,
const int  compressionLevel = 95,
const uint  outputDirectoryKey = 0 
)
inlineinherited

Configure a keyed directory for JPEG image output.

Parameters
[in]outputImageDirectoryDirectory in which images are written.
[in]compressionLevelJPEG quality level.
[in]outputDirectoryKeyKey used to select the output directory.

Set the JPEG image quality.

Definition at line 116 of file sources/libs/nvmultiobjecttracker/include/modules/utility/FrameOutput.hpp.

References FrameOutput::compression_params, FrameOutput::mIsImageOutputEnabled, and FrameOutput::mOutputImageDirectory.

◆ enableImageOutput() [2/2]

void FrameOutput::enableImageOutput ( const std::string  outputImageDirectory,
const int  compressionLevel = 95,
const uint  outputDirectoryKey = 0 
)
inlineinherited

Configure a keyed directory for JPEG image output.

Parameters
[in]outputImageDirectoryDirectory in which images are written.
[in]compressionLevelJPEG quality level.
[in]outputDirectoryKeyKey used to select the output directory.

Set the JPEG image quality.

Definition at line 116 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/utility/FrameOutput.hpp.

References FrameOutput::compression_params, FrameOutput::mIsImageOutputEnabled, and FrameOutput::mOutputImageDirectory.

◆ enableVideoOutput() [1/2]

bool FrameOutput::enableVideoOutput ( const std::string  outputVideoDirectory,
const std::string  outputVideoName,
cv::Size  videoSize,
const double  fps = 5.f 
)
inlineinherited

Create an AVI writer and enable video output.

Parameters
[in]outputVideoDirectoryDirectory in which the video is written.
[in]outputVideoNameBase name of the output video file.
[in]videoSizeOutput video frame size.
[in]fpsOutput video frame rate.
Returns
True when the output video is opened successfully.

Definition at line 78 of file sources/libs/nvmultiobjecttracker/include/modules/utility/FrameOutput.hpp.

References FrameOutput::mIsVideoOutputEnabled, and FrameOutput::mOutputVideo.

◆ enableVideoOutput() [2/2]

bool FrameOutput::enableVideoOutput ( const std::string  outputVideoDirectory,
const std::string  outputVideoName,
cv::Size  videoSize,
const double  fps = 5.f 
)
inlineinherited

Create an AVI writer and enable video output.

Parameters
[in]outputVideoDirectoryDirectory in which the video is written.
[in]outputVideoNameBase name of the output video file.
[in]videoSizeOutput video frame size.
[in]fpsOutput video frame rate.
Returns
True when the output video is opened successfully.

Definition at line 78 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/utility/FrameOutput.hpp.

References FrameOutput::mIsVideoOutputEnabled, and FrameOutput::mOutputVideo.

◆ isImageOutputEnabled() [1/2]

bool FrameOutput::isImageOutputEnabled ( const uint  outputDirectoryKey = 0)
inlineinherited

Report whether image output is enabled for a directory key.

Parameters
[in]outputDirectoryKeyOutput directory key to query.

Definition at line 55 of file sources/libs/nvmultiobjecttracker/include/modules/utility/FrameOutput.hpp.

References FrameOutput::mIsImageOutputEnabled.

Referenced by FrameOutput::writeImageOutput().

◆ isImageOutputEnabled() [2/2]

bool FrameOutput::isImageOutputEnabled ( const uint  outputDirectoryKey = 0)
inlineinherited

Report whether image output is enabled for a directory key.

Parameters
[in]outputDirectoryKeyOutput directory key to query.

Definition at line 55 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/utility/FrameOutput.hpp.

References FrameOutput::mIsImageOutputEnabled.

◆ isVideoOutputEnabled() [1/2]

bool FrameOutput::isVideoOutputEnabled ( )
inlineinherited

Report whether video output is enabled.

Definition at line 68 of file sources/libs/nvmultiobjecttracker/include/modules/utility/FrameOutput.hpp.

References FrameOutput::mIsVideoOutputEnabled.

◆ isVideoOutputEnabled() [2/2]

bool FrameOutput::isVideoOutputEnabled ( )
inlineinherited

Report whether video output is enabled.

Definition at line 68 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/utility/FrameOutput.hpp.

References FrameOutput::mIsVideoOutputEnabled.

◆ make_dist_colors() [1/2]

cv::Mat TrackerVizOutput::make_dist_colors ( unsigned  nb)
inline

Generate visually distinct BGR colors by distributing shuffled hues.

Parameters
[in]nbThe number of colors to generate.
Returns
A single-row BGR matrix containing the generated colors.

Compute step to cover the whole hue range in OpenCV.

Generate hue values.

Shuffle the hue values randomly.

Build the HSV matrix with shuffled hues. High saturation and value for vivid colors.

Definition at line 134 of file sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

Referenced by drawProjectedPeerTrajectory().

◆ make_dist_colors() [2/2]

cv::Mat TrackerVizOutput::make_dist_colors ( unsigned  nb)
inline

Generate visually distinct BGR colors by distributing shuffled hues.

Parameters
[in]nbThe number of colors to generate.
Returns
A single-row BGR matrix containing the generated colors.

Compute step to cover the whole hue range in OpenCV.

Generate hue values.

Shuffle the hue values randomly.

Build the HSV matrix with shuffled hues. High saturation and value for vivid colors.

Definition at line 134 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

◆ prepareCorrelationResponseImg() [1/2]

cv::Mat TrackerVizOutput::prepareCorrelationResponseImg ( const NvMOTStreamId  streamId_,
const uint  trackerInd,
std::vector< cv::Mat > &  corrRespMats,
const cv::Size  dstSize,
const bool  showPeakPoint = true,
const bool  showDetBboxes = true 
)
inlineprotected

Prepare a color-mapped correlation response with optional target and detection markers.

Parameters
[in]streamId_The video stream identifier.
[in]trackerIndThe target's tracker index.
[in]corrRespMatsThe correlation-response matrices for the tracker batch.
[in]dstSizeThe requested output image size.
[in]showPeakPointWhether to draw the localized peak.
[in]showDetBboxesWhether to draw nearby detector bounding-box centers.
Returns
The prepared BGR correlation-response image.

Normalize to a high-enough magnitude for better visualization.

Wrap around with the circular shifting.

Draw the peak point.

Draw the detector bbox points within the search region.

Convert the center point of the detector bbox into the tracker corr resp's coordinate system.

Convert the center point of the detector bbox into the tracker corr resp's coordinate system.

Definition at line 809 of file sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

References CV_FUNCS::circshift(), EMPTY, m_dcfTracker, DCFTracker::m_detectorBboxes_h, VisualTracker::m_detectorBboxes_h, DCFTracker::m_detectorBboxes_size_h, VisualTracker::m_detectorBboxes_size_h, VisualTracker::m_targetDisplacement2D_h, m_targets, m_visualTracker, normalize(), pydeepstreamdoc::tensor::TensorDoc::size, width, detectorBbox_t::x, and detectorBbox_t::y.

Referenced by writeSrcImagePatchesWithCorrResp().

◆ prepareCorrelationResponseImg() [2/2]

cv::Mat TrackerVizOutput::prepareCorrelationResponseImg ( const NvMOTStreamId  streamId_,
const uint  trackerInd,
std::vector< cv::Mat > &  corrRespMats,
const cv::Size  dstSize,
const bool  showPeakPoint = true,
const bool  showDetBboxes = true 
)
inlineprotected

Prepare a color-mapped correlation response with optional target and detection markers.

Parameters
[in]streamId_The video stream identifier.
[in]trackerIndThe target's tracker index.
[in]corrRespMatsThe correlation-response matrices for the tracker batch.
[in]dstSizeThe requested output image size.
[in]showPeakPointWhether to draw the localized peak.
[in]showDetBboxesWhether to draw nearby detector bounding-box centers.
Returns
The prepared BGR correlation-response image.

Normalize to a high-enough magnitude for better visualization.

Wrap around with the circular shifting.

Draw the peak point.

Draw the detector bbox points within the search region.

Convert the center point of the detector bbox into the tracker corr resp's coordinate system.

Convert the center point of the detector bbox into the tracker corr resp's coordinate system.

Definition at line 809 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

References CV_FUNCS::circshift(), EMPTY, m_dcfTracker, DCFTracker::m_detectorBboxes_h, VisualTracker::m_detectorBboxes_h, DCFTracker::m_detectorBboxes_size_h, VisualTracker::m_detectorBboxes_size_h, VisualTracker::m_targetDisplacement2D_h, m_targets, m_visualTracker, normalize(), pydeepstreamdoc::tensor::TensorDoc::size, width, detectorBbox_t::x, and detectorBbox_t::y.

◆ prepareMaskFilterImg() [1/2]

cv::Mat TrackerVizOutput::prepareMaskFilterImg ( const NvMOTStreamId  streamId_,
const uint  trackerInd,
std::vector< cv::Mat > &  maskMats,
const cv::Size  dstSize 
)
inlineprotected

Prepare an 8-bit BGR visualization of a target's segmentation-filter mask.

Parameters
[in]streamId_The video stream identifier.
[in]trackerIndThe target's tracker index.
[in]maskMatsThe segmentation-filter masks for the tracker batch.
[in]dstSizeThe requested output image size.
Returns
The prepared BGR mask image.

Scale the mask from [0.0, 1.0] into 8-bit values.

Definition at line 931 of file sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

References EMPTY, m_targets, pydeepstreamdoc::tensor::TensorDoc::size, and width.

Referenced by writeSrcImagePatchesWithMaskFilter().

◆ prepareMaskFilterImg() [2/2]

cv::Mat TrackerVizOutput::prepareMaskFilterImg ( const NvMOTStreamId  streamId_,
const uint  trackerInd,
std::vector< cv::Mat > &  maskMats,
const cv::Size  dstSize 
)
inlineprotected

Prepare an 8-bit BGR visualization of a target's segmentation-filter mask.

Parameters
[in]streamId_The video stream identifier.
[in]trackerIndThe target's tracker index.
[in]maskMatsThe segmentation-filter masks for the tracker batch.
[in]dstSizeThe requested output image size.
Returns
The prepared BGR mask image.

Scale the mask from [0.0, 1.0] into 8-bit values.

Definition at line 931 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

References EMPTY, m_targets, pydeepstreamdoc::tensor::TensorDoc::size, and width.

◆ writeAllTrajectoriesOnEveryFrame() [1/2]

void TrackerVizOutput::writeAllTrajectoriesOnEveryFrame ( const uint  outputDirectoryKey = 0)
inline

Draw all current trajectories on each available source frame and write the results.

Parameters
[in]outputDirectoryKeyThe output directory selector.

Get source image frames available at Host (made available only when m_params.m_doTrajectoryAnalysis is enabled). {videoStreamID, src image frame}.

Get source image patches to Host.

Write all the recent trajectories on the source frame.

Show frame number.

Draw recent trajectories.

Draw projected human models on the camera frame.

Definition at line 405 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

References CLOG, drawProjectedPeerTrajectory(), drawProjectedTargetModel(), drawRecentTrajectory(), m_dcfTracker, m_targets, m_visualTracker, and FrameOutput::writeImageOutput().

◆ writeAllTrajectoriesOnEveryFrame() [2/2]

void TrackerVizOutput::writeAllTrajectoriesOnEveryFrame ( const uint  outputDirectoryKey = 0)
inline

Draw all current trajectories on each available source frame and write the results.

Parameters
[in]outputDirectoryKeyThe output directory selector.

Get source image frames available at Host (made available only when m_params.m_doTrajectoryAnalysis is enabled). {videoStreamID, src image frame}.

Get source image patches to Host.

Write all the recent trajectories on the source frame.

Show frame number.

Draw recent trajectories.

Draw projected human models on the camera frame.

Definition at line 405 of file sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

References CLOG, drawProjectedPeerTrajectory(), drawProjectedTargetModel(), drawRecentTrajectory(), m_dcfTracker, m_targets, m_visualTracker, and FrameOutput::writeImageOutput().

◆ writeBirdsEyeView() [1/2]

void TrackerVizOutput::writeBirdsEyeView ( const uint  outputDirectoryKey = 0)
inline

Render and write a bird's-eye view for each available stream.

Parameters
[in]outputDirectoryKeyThe output directory selector.

{videoStreamID, src image frame}.

{videoStreamID, world map coordinates}.

{videoStreamID, world-to-frame scale}.

Both frame dimensions use the source height.

Both frame dimensions use the source height.

Define the world map size.

If the last target state is not Active, then don't draw.

Check if a point in world coordinate is within the world map size. If not, adjust world map size to include the new point.

Param to be configured.

Draw the trajectories of each stream on its bird's-eye view frame.

Show frame number.

If the last target state is not Active, then don't draw.

Make the image coordinate axis align with the world coordinate axis in terms of orientations. The origin of the image coordinate is at the top-left, while the world coordinate origin is at the bottom-right.

Make the image coordinate axis align with the world coordinate axis in terms of orientations. The origin of the image coordinate is at the top-left, while the world coordinate origin is at the bottom-right.

Draw the bbox center.

Show target label (ID & Age).

Definition at line 163 of file sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

References ACTIVE, NvMotDataTypes::Size::height, m_dcfTracker, VisualTracker::m_paramsRt, DCFTracker::m_paramsRt, m_targets, m_visualTracker, max(), VisualTrackerRunTimeParams::srcImageSize, DCFTrackerRunTimeParams::srcImageSize, TENTATIVE, and FrameOutput::writeImageOutput().

◆ writeBirdsEyeView() [2/2]

void TrackerVizOutput::writeBirdsEyeView ( const uint  outputDirectoryKey = 0)
inline

Render and write a bird's-eye view for each available stream.

Parameters
[in]outputDirectoryKeyThe output directory selector.

{videoStreamID, src image frame}.

{videoStreamID, world map coordinates}.

{videoStreamID, world-to-frame scale}.

Both frame dimensions use the source height.

Both frame dimensions use the source height.

Define the world map size.

If the last target state is not Active, then don't draw.

Check if a point in world coordinate is within the world map size. If not, adjust world map size to include the new point.

Param to be configured.

Draw the trajectories of each stream on its bird's-eye view frame.

Show frame number.

If the last target state is not Active, then don't draw.

Make the image coordinate axis align with the world coordinate axis in terms of orientations. The origin of the image coordinate is at the top-left, while the world coordinate origin is at the bottom-right.

Make the image coordinate axis align with the world coordinate axis in terms of orientations. The origin of the image coordinate is at the top-left, while the world coordinate origin is at the bottom-right.

Draw the bbox center.

Show target label (ID & Age).

Definition at line 163 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

References ACTIVE, NvMotDataTypes::Size::height, m_dcfTracker, VisualTracker::m_paramsRt, DCFTracker::m_paramsRt, m_targets, m_visualTracker, max(), VisualTrackerRunTimeParams::srcImageSize, DCFTrackerRunTimeParams::srcImageSize, TENTATIVE, and FrameOutput::writeImageOutput().

◆ writeEachCompletedTrajectory() [1/2]

void TrackerVizOutput::writeEachCompletedTrajectory ( const uint  outputDirectoryKey = 0)
inline

Draw and write each trajectory after its track completes.

Parameters
[in]outputDirectoryKeyThe output directory selector.

Get source image frames available at Host (made available only when m_params.m_doTrajectoryAnalysis is enabled). {videoStreamID, src image frame}.

Get source image patches to Host.

Keep the latest copy of the source frame.

Write a complete trajectory of a target when terminated.

{targetId, Trajectory4Archive}.

Write the processed tracklet for visualization.

Definition at line 500 of file sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

References CLOG, drawFullTrajectory(), m_dcfTracker, m_lastFrames, m_targets, m_visualTracker, and FrameOutput::writeImageOutput().

◆ writeEachCompletedTrajectory() [2/2]

void TrackerVizOutput::writeEachCompletedTrajectory ( const uint  outputDirectoryKey = 0)
inline

Draw and write each trajectory after its track completes.

Parameters
[in]outputDirectoryKeyThe output directory selector.

Get source image frames available at Host (made available only when m_params.m_doTrajectoryAnalysis is enabled). {videoStreamID, src image frame}.

Get source image patches to Host.

Keep the latest copy of the source frame.

Write a complete trajectory of a target when terminated.

{targetId, Trajectory4Archive}.

Write the processed tracklet for visualization.

Definition at line 500 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

References CLOG, drawFullTrajectory(), m_dcfTracker, m_lastFrames, m_targets, m_visualTracker, and FrameOutput::writeImageOutput().

◆ writeFromWriteBuffer() [1/2]

void TrackerVizOutput::writeFromWriteBuffer ( const std::shared_ptr< NvTrackedObject >  target)
inlineprotected

Write and clear pending images after a target receives a persistent ID.

Parameters
[in]targetThe tracked object whose pending images are written.

FileName: Target_{targetID}_Frame_{FrameNum}.

Out folder name: Stream_{StreamID}.

Definition at line 772 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

References ACTIVE, INACTIVE, m_writeBuffer, pydeepstreamdoc::tensor::TensorDoc::size, and FrameOutput::writeImageOutput().

◆ writeFromWriteBuffer() [2/2]

void TrackerVizOutput::writeFromWriteBuffer ( const std::shared_ptr< NvTrackedObject >  target)
inlineprotected

Write and clear pending images after a target receives a persistent ID.

Parameters
[in]targetThe tracked object whose pending images are written.

FileName: Target_{targetID}_Frame_{FrameNum}.

Out folder name: Stream_{StreamID}.

Definition at line 772 of file sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

References ACTIVE, INACTIVE, m_writeBuffer, pydeepstreamdoc::tensor::TensorDoc::size, and FrameOutput::writeImageOutput().

Referenced by writeSrcImagePatchesWithCorrResp_perTarget(), and writeSrcImagePatchesWithMaskFilter_perTarget().

◆ writeImageOutput() [1/2]

void FrameOutput::writeImageOutput ( const cv::Mat &  img,
const std::string  imgFilename,
const uint  outputDirectoryKey = 0,
const std::string  subFolderName = "" 
)
inlineinherited

Write an image to a keyed output directory.

Parameters
[in]imgImage to write.
[in]imgFilenameBase name of the output image file.
[in]outputDirectoryKeyKey used to select the output directory.
[in]subFolderNameOptional subdirectory below the keyed output directory.

Create the output directory if it does not exist.

Definition at line 157 of file sources/libs/nvmultiobjecttracker/include/modules/utility/FrameOutput.hpp.

References FrameOutput::compression_params, FrameOutput::isImageOutputEnabled(), FrameOutput::mOutputImageDirectory, and pydeepstreamdoc::tensor::TensorDoc::size.

Referenced by writeAllTrajectoriesOnEveryFrame(), writeBirdsEyeView(), writeEachCompletedTrajectory(), and writeFromWriteBuffer().

◆ writeImageOutput() [2/2]

void FrameOutput::writeImageOutput ( const cv::Mat &  img,
const std::string  imgFilename,
const uint  outputDirectoryKey = 0,
const std::string  subFolderName = "" 
)
inlineinherited

Write an image to a keyed output directory.

Parameters
[in]imgImage to write.
[in]imgFilenameBase name of the output image file.
[in]outputDirectoryKeyKey used to select the output directory.
[in]subFolderNameOptional subdirectory below the keyed output directory.

Create the output directory if it does not exist.

Definition at line 157 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/utility/FrameOutput.hpp.

References FrameOutput::compression_params, FrameOutput::isImageOutputEnabled(), FrameOutput::mOutputImageDirectory, and pydeepstreamdoc::tensor::TensorDoc::size.

◆ writeSrcImagePatchesWithCorrResp() [1/2]

void TrackerVizOutput::writeSrcImagePatchesWithCorrResp ( const uint  outputDirectoryKey = 0)
inline

◆ writeSrcImagePatchesWithCorrResp() [2/2]

void TrackerVizOutput::writeSrcImagePatchesWithCorrResp ( const uint  outputDirectoryKey = 0)
inline

◆ writeSrcImagePatchesWithCorrResp_perTarget() [1/2]

void TrackerVizOutput::writeSrcImagePatchesWithCorrResp_perTarget ( const NvMOTStreamId  streamId_,
const int  trackerInd,
const uint  outputDirectoryKey,
cv::Mat  srcImgPatch,
cv::Mat  corrRespMat 
)
inlineprotected

Buffer a source patch paired with its correlation-response image for one target.

Parameters
[in]streamId_The video stream identifier.
[in]trackerIndThe target's tracker index.
[in]outputDirectoryKeyThe output directory selector.
[in]srcImgPatchThe source image patch.
[in]corrRespMatThe correlation-response visualization.

Stack the two.

Put it into a buffer first because if target state is TENTATIVE, there is no ID assigned yet.

Write into file if ID is assigned.

Definition at line 658 of file sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

References addToWriteBuffer(), VisualTrackerRunTimeParams::colorFormat, EMPTY, VisualTracker::m_paramsRt, m_srcImgWH, m_targets, m_visualTracker, NVBUF_COLOR_FORMAT_RGBA, and writeFromWriteBuffer().

Referenced by writeSrcImagePatchesWithCorrResp().

◆ writeSrcImagePatchesWithCorrResp_perTarget() [2/2]

void TrackerVizOutput::writeSrcImagePatchesWithCorrResp_perTarget ( const NvMOTStreamId  streamId_,
const int  trackerInd,
const uint  outputDirectoryKey,
cv::Mat  srcImgPatch,
cv::Mat  corrRespMat 
)
inlineprotected

Buffer a source patch paired with its correlation-response image for one target.

Parameters
[in]streamId_The video stream identifier.
[in]trackerIndThe target's tracker index.
[in]outputDirectoryKeyThe output directory selector.
[in]srcImgPatchThe source image patch.
[in]corrRespMatThe correlation-response visualization.

Stack the two.

Put it into a buffer first because if target state is TENTATIVE, there is no ID assigned yet.

Write into file if ID is assigned.

Definition at line 658 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

References addToWriteBuffer(), VisualTrackerRunTimeParams::colorFormat, EMPTY, VisualTracker::m_paramsRt, m_srcImgWH, m_targets, m_visualTracker, NVBUF_COLOR_FORMAT_RGBA, and writeFromWriteBuffer().

◆ writeSrcImagePatchesWithMaskFilter() [1/2]

void TrackerVizOutput::writeSrcImagePatchesWithMaskFilter ( const uint  outputDirectoryKey = 0)
inline

◆ writeSrcImagePatchesWithMaskFilter() [2/2]

void TrackerVizOutput::writeSrcImagePatchesWithMaskFilter ( const uint  outputDirectoryKey = 0)
inline

◆ writeSrcImagePatchesWithMaskFilter_perTarget() [1/2]

void TrackerVizOutput::writeSrcImagePatchesWithMaskFilter_perTarget ( const NvMOTStreamId  streamId_,
const int  trackerInd,
const uint  outputDirectoryKey,
cv::Mat  srcImgPatch,
cv::Mat  maskMat 
)
inlineprotected

Buffer a source patch paired with its segmentation-filter mask for one target.

Parameters
[in]streamId_The video stream identifier.
[in]trackerIndThe target's tracker index.
[in]outputDirectoryKeyThe output directory selector.
[in]srcImgPatchThe source image patch.
[in]maskMatThe segmentation-filter mask visualization.

Stack the two.

Put it into a buffer first because if target state is TENTATIVE, there is no ID assigned yet.

Write into file if ID is assigned.

Definition at line 704 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

References addToWriteBuffer(), VisualTrackerRunTimeParams::colorFormat, EMPTY, VisualTracker::m_paramsRt, m_srcImgWH, m_targets, m_visualTracker, NVBUF_COLOR_FORMAT_RGBA, and writeFromWriteBuffer().

◆ writeSrcImagePatchesWithMaskFilter_perTarget() [2/2]

void TrackerVizOutput::writeSrcImagePatchesWithMaskFilter_perTarget ( const NvMOTStreamId  streamId_,
const int  trackerInd,
const uint  outputDirectoryKey,
cv::Mat  srcImgPatch,
cv::Mat  maskMat 
)
inlineprotected

Buffer a source patch paired with its segmentation-filter mask for one target.

Parameters
[in]streamId_The video stream identifier.
[in]trackerIndThe target's tracker index.
[in]outputDirectoryKeyThe output directory selector.
[in]srcImgPatchThe source image patch.
[in]maskMatThe segmentation-filter mask visualization.

Stack the two.

Put it into a buffer first because if target state is TENTATIVE, there is no ID assigned yet.

Write into file if ID is assigned.

Definition at line 704 of file sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

References addToWriteBuffer(), VisualTrackerRunTimeParams::colorFormat, EMPTY, VisualTracker::m_paramsRt, m_srcImgWH, m_targets, m_visualTracker, NVBUF_COLOR_FORMAT_RGBA, and writeFromWriteBuffer().

Referenced by writeSrcImagePatchesWithMaskFilter().

◆ writeVideoOutput() [1/2]

void FrameOutput::writeVideoOutput ( const cv::Mat &  img)
inlineinherited

Append an image to the output video.

Parameters
[in]imgImage to write as the next video frame.

Definition at line 142 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/utility/FrameOutput.hpp.

References FrameOutput::mIsVideoOutputEnabled, and FrameOutput::mOutputVideo.

◆ writeVideoOutput() [2/2]

void FrameOutput::writeVideoOutput ( const cv::Mat &  img)
inlineinherited

Append an image to the output video.

Parameters
[in]imgImage to write as the next video frame.

Definition at line 142 of file sources/libs/nvmultiobjecttracker/include/modules/utility/FrameOutput.hpp.

References FrameOutput::mIsVideoOutputEnabled, and FrameOutput::mOutputVideo.

Field Documentation

◆ compression_params

std::vector< int > FrameOutput::compression_params
protectedinherited

◆ m_dcfTracker

DCFTracker * TrackerVizOutput::m_dcfTracker = NULL
protected

◆ m_displayWidth

const int TrackerVizOutput::m_displayWidth = 1920
protected

Display/screen width.

Definition at line 98 of file sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

◆ m_featImgWH

const int TrackerVizOutput::m_featImgWH = 160
protected

Visualization width and height for feature images.

Definition at line 100 of file sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

◆ m_lastFrameMatchedInTrajectoryArchive

std::map< NvMOTStreamId, uint64_t > TrackerVizOutput::m_lastFrameMatchedInTrajectoryArchive
protected

The target ID of the latest trajectory archived.

Definition at line 102 of file sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

◆ m_lastFrames

std::map< NvMOTStreamId, cv::Mat > TrackerVizOutput::m_lastFrames
protected

The last source frame kept.

Definition at line 103 of file sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

Referenced by writeEachCompletedTrajectory().

◆ m_srcImgWH

const int TrackerVizOutput::m_srcImgWH = 240
protected

◆ m_targets

◆ m_visualTracker

◆ m_writeBuffer

std::map< uint32_t, std::deque< WriteBuffer_t > > TrackerVizOutput::m_writeBuffer
protected

Buffered outputs grouped by target index.

Definition at line 101 of file sources/libs/nvmultiobjecttracker/include/modules/VisualTracker/vizOutput.hpp.

Referenced by addToWriteBuffer(), and writeFromWriteBuffer().

◆ mIsImageOutputEnabled

std::unordered_map< uint, bool > FrameOutput::mIsImageOutputEnabled
protectedinherited

Image-output enabled state for each directory key.

Definition at line 197 of file sources/libs/nvmultiobjecttracker/include/modules/utility/FrameOutput.hpp.

Referenced by FrameOutput::enableImageOutput(), and FrameOutput::isImageOutputEnabled().

◆ mIsVideoOutputEnabled

bool FrameOutput::mIsVideoOutputEnabled
protectedinherited

◆ mOutputImageDirectory

std::unordered_map< uint, std::string > FrameOutput::mOutputImageDirectory
protectedinherited

Image output directories keyed by caller-defined values.

Definition at line 196 of file sources/libs/nvmultiobjecttracker/include/modules/utility/FrameOutput.hpp.

Referenced by FrameOutput::enableImageOutput(), and FrameOutput::writeImageOutput().

◆ mOutputVideo

cv::VideoWriter * FrameOutput::mOutputVideo
protectedinherited

The documentation for this class was generated from the following file: