NVIDIA DeepStream SDK API Reference

9.2 Release
ReIDCropScaler Class Reference

Detailed Description

Crops and rescales target regions with VPI for network input.

Definition at line 39 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReIDCropScaler.hpp.

Public Member Functions

 ReIDCropScaler ()
 Construct a ReIDCropScaler instance. More...
 
 ~ReIDCropScaler ()
 Release resources owned by the ReIDCropScaler instance. More...
 
void initialize (const int debugVerboseLevel, const int maxStreamNum, const int maxBufSurfAddrSize, const int maxTargetNum, const NvMotDataTypes::Size srcImgSize, const uint srcImgPitch, const NvBufSurfaceColorFormat colorFormatType, const NvMotDataTypes::Size dstImgSize, const NvBufSurfaceColorFormat dstColorFormatType, const int dimOrder)
 Initialize for image cropping and scaling. More...
 
bool frameTransformInBatch (const std::map< NvMOTStreamId, std::vector< std::pair< uint, NvMotDataTypes::Rect2f > > > &roisInBatch, const int lastBboxInd, const float outputScaleFactor, const std::vector< float > outputOffsets, const std::map< NvMOTStreamId, NvMOTFrame * > &inputMeta)
 Transform (crop, scale and color conversion) a set of bboxes for the given single frame, all the bboxes will be scaled to the same size. More...
 
float * getOutputImagePatchPtrs ()
 Get the pointer to the output image patches on device memory with metadata. More...
 
 ReIDCropScaler ()
 Construct a ReIDCropScaler instance. More...
 
 ~ReIDCropScaler ()
 Release resources owned by the ReIDCropScaler instance. More...
 
void initialize (const int debugVerboseLevel, const int maxStreamNum, const int maxBufSurfAddrSize, const int maxTargetNum, const NvMotDataTypes::Size srcImgSize, const uint srcImgPitch, const NvBufSurfaceColorFormat colorFormatType, const NvMotDataTypes::Size dstImgSize, const NvBufSurfaceColorFormat dstColorFormatType, const int dimOrder)
 Initialize for image cropping and scaling. More...
 
bool frameTransformInBatch (const std::map< NvMOTStreamId, std::vector< std::pair< uint, NvMotDataTypes::Rect2f > > > &roisInBatch, const int lastBboxInd, const float outputScaleFactor, const std::vector< float > outputOffsets, const std::map< NvMOTStreamId, NvMOTFrame * > &inputMeta)
 Transform (crop, scale and color conversion) a set of bboxes for the given single frame, all the bboxes will be scaled to the same size. More...
 
float * getOutputImagePatchPtrs ()
 Get the pointer to the output image patches on device memory with metadata. More...
 

Constructor & Destructor Documentation

◆ ReIDCropScaler() [1/2]

ReIDCropScaler::ReIDCropScaler ( )

Construct a ReIDCropScaler instance.

◆ ~ReIDCropScaler() [1/2]

ReIDCropScaler::~ReIDCropScaler ( )

Release resources owned by the ReIDCropScaler instance.

◆ ReIDCropScaler() [2/2]

ReIDCropScaler::ReIDCropScaler ( )

Construct a ReIDCropScaler instance.

◆ ~ReIDCropScaler() [2/2]

ReIDCropScaler::~ReIDCropScaler ( )

Release resources owned by the ReIDCropScaler instance.

Member Function Documentation

◆ frameTransformInBatch() [1/2]

bool ReIDCropScaler::frameTransformInBatch ( const std::map< NvMOTStreamId, std::vector< std::pair< uint, NvMotDataTypes::Rect2f > > > &  roisInBatch,
const int  lastBboxInd,
const float  outputScaleFactor,
const std::vector< float >  outputOffsets,
const std::map< NvMOTStreamId, NvMOTFrame * > &  inputMeta 
)

Transform (crop, scale and color conversion) a set of bboxes for the given single frame, all the bboxes will be scaled to the same size.

Parameters
[in]roisInBatchThe set of ROIs of interest {videoStreamID, a vector of {bboxInd, bbox} }.
[in]lastBboxIndLast bbox index.
[in]outputScaleFactorScale applied to output pixel values.
[in]outputOffsetsParameter of each channel's offset.
[in]inputMetaInput frames keyed by stream ID.
Returns
Status.

◆ frameTransformInBatch() [2/2]

bool ReIDCropScaler::frameTransformInBatch ( const std::map< NvMOTStreamId, std::vector< std::pair< uint, NvMotDataTypes::Rect2f > > > &  roisInBatch,
const int  lastBboxInd,
const float  outputScaleFactor,
const std::vector< float >  outputOffsets,
const std::map< NvMOTStreamId, NvMOTFrame * > &  inputMeta 
)

Transform (crop, scale and color conversion) a set of bboxes for the given single frame, all the bboxes will be scaled to the same size.

Parameters
[in]roisInBatchThe set of ROIs of interest {videoStreamID, a vector of {bboxInd, bbox} }.
[in]lastBboxIndLast bbox index.
[in]outputScaleFactorScale applied to output pixel values.
[in]outputOffsetsParameter of each channel's offset.
[in]inputMetaInput frames keyed by stream ID.
Returns
Status.

◆ getOutputImagePatchPtrs() [1/2]

float* ReIDCropScaler::getOutputImagePatchPtrs ( )
inline

Get the pointer to the output image patches on device memory with metadata.

Definition at line 83 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/ReID/ReIDCropScaler.hpp.

◆ getOutputImagePatchPtrs() [2/2]

float* ReIDCropScaler::getOutputImagePatchPtrs ( )
inline

Get the pointer to the output image patches on device memory with metadata.

Definition at line 83 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReIDCropScaler.hpp.

◆ initialize() [1/2]

void ReIDCropScaler::initialize ( const int  debugVerboseLevel,
const int  maxStreamNum,
const int  maxBufSurfAddrSize,
const int  maxTargetNum,
const NvMotDataTypes::Size  srcImgSize,
const uint  srcImgPitch,
const NvBufSurfaceColorFormat  colorFormatType,
const NvMotDataTypes::Size  dstImgSize,
const NvBufSurfaceColorFormat  dstColorFormatType,
const int  dimOrder 
)

Initialize for image cropping and scaling.

Parameters
[in]debugVerboseLevelDebug verbosity level.
[in]maxStreamNumMaximum number of input streams.
[in]maxBufSurfAddrSizeMaximum number of cached surface-buffer addresses.
[in]maxTargetNumMaximum number of targets in a batch.
[in]srcImgSizeInput image dimensions.
[in]srcImgPitchInput image pitch in bytes.
[in]colorFormatTypeInput surface color format.
[in]dstImgSizeSize of image after resizing.
[in]dstColorFormatTypeOutput color format RGB or BGR.
[in]dimOrderOutput tensor dimension order.

◆ initialize() [2/2]

void ReIDCropScaler::initialize ( const int  debugVerboseLevel,
const int  maxStreamNum,
const int  maxBufSurfAddrSize,
const int  maxTargetNum,
const NvMotDataTypes::Size  srcImgSize,
const uint  srcImgPitch,
const NvBufSurfaceColorFormat  colorFormatType,
const NvMotDataTypes::Size  dstImgSize,
const NvBufSurfaceColorFormat  dstColorFormatType,
const int  dimOrder 
)

Initialize for image cropping and scaling.

Parameters
[in]debugVerboseLevelDebug verbosity level.
[in]maxStreamNumMaximum number of input streams.
[in]maxBufSurfAddrSizeMaximum number of cached surface-buffer addresses.
[in]maxTargetNumMaximum number of targets in a batch.
[in]srcImgSizeInput image dimensions.
[in]srcImgPitchInput image pitch in bytes.
[in]colorFormatTypeInput surface color format.
[in]dstImgSizeSize of image after resizing.
[in]dstColorFormatTypeOutput color format RGB or BGR.
[in]dimOrderOutput tensor dimension order.

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