NVIDIA DeepStream SDK API Reference

9.2 Release
CV_FUNCS Namespace Reference

Functions

Eigen::VectorXd convertBboxToZ (const NvMotDataTypes::Rect2f &bbox, const bool useAspc=false)
 Convert a bounding box to an estimator measurement vector. More...
 
void convexHull (const std::vector< Eigen::Vector2d > &points, std::vector< Eigen::Vector2d > &hull)
 Compute the convex hull of double-precision points. More...
 
void convexHull (const std::vector< Eigen::Vector2f > &points, std::vector< Eigen::Vector2f > &hull)
 Compute the convex hull of single-precision points. More...
 
NvMotDataTypes::Rect2f boundingRect (const std::vector< Eigen::Vector2d > &points)
 Compute the axis-aligned bounding rectangle of a point set. More...
 
NvMotDataTypes::Rect2f boundingRect (float *mask, const int width, const int height)
 Compute the bounding rectangle of nonzero mask values. More...
 
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. More...
 
NvMotDataTypes::Rect2f displaceBbox (const NvMotDataTypes::Rect2f &bbox, const float displacement_x, const float displacement_y)
 Translate a bounding box by horizontal and vertical displacements. More...
 
Eigen::Vector2f getBboxCenterPt (const NvMotDataTypes::Rect2f &bbox)
 Compute the center point of a bounding box. More...
 
const std::string getEigenRectString (const NvMotDataTypes::Rect2f &bbox)
 Format an Eigen bounding box as a readable string. More...
 
bool isBboxEqual (const NvMotDataTypes::Rect2f &bbox1, const NvMotDataTypes::Rect2f &bbox2)
 Compare two bounding boxes for exact equality. More...
 
int modul (int a, int b)
 Compute a nonnegative modulo result for positive divisors. More...
 
NvMotDataTypes::Rect2f getBoxWithAspectRatio (const NvMotDataTypes::Rect2f &bbox, const float aspectRatio)
 Adjust the width of the bbox according to the aspect ratio specified. More...
 
NvMotDataTypes::Rect2f convertXToBbox (const Eigen::VectorXd &x, const bool useAspc=false)
 Convert an estimator state vector to a bounding box. More...
 
NvMotDataTypes::RowMajorMatrixXf getHanningWindow (const int width, const int height, float offsetFactor_y=0.f)
 Generate a separable two-dimensional Hann window. More...
 
float computeSizeScore (const NvMotDataTypes::Rect2f &currBox, const NvMotDataTypes::Rect2f &prevBox)
 Compute a symmetric area-ratio score between two bounding boxes. More...
 
Eigen::MatrixXf circshift (const Eigen::MatrixXf &matrix, int dx, int dy)
 Circularly shift a matrix along both axes. More...
 
Eigen::MatrixXf get2dGaussianPdf (const float sigma, const int w, const int h, const bool wrap_kernel=true)
 Create a two-dimensional Gaussian response map. More...
 
const NvMotDataTypes::Rect2f unclipBbox (const NvMotDataTypes::Rect2f tBbox_new, const NvMotDataTypes::Rect2f srcImageBox, const NvMotDataTypes::Rect2f tBbox_prev)
 Recover bounding-box extent clipped by an image border using the previous box size. More...
 
const NvMotDataTypes::Rect2f computeSearchRegion (const NvMotDataTypes::Rect2f &bbox_new, const float paddingScale)
 Expand a bounding box into a square search region. More...
 
float computeIOU (const NvMotDataTypes::Rect2f currBox, const NvMotDataTypes::Rect2f prevBox)
 Compute intersection over union for two bounding boxes. More...
 
float computeVisibility (const NvMotDataTypes::Rect2f &objBbox, const NvMotDataTypes::Rect2f &imgBbox)
 Compute the fraction of an object bounding box visible inside an image box. More...
 
int orientation (const Eigen::Vector2d &p, const Eigen::Vector2d &q, const Eigen::Vector2d &r)
 Classify the orientation of three double-precision points. More...
 
int orientation (const Eigen::Vector2f &p, const Eigen::Vector2f &q, const Eigen::Vector2f &r)
 Classify the orientation of three single-precision points. More...
 

Function Documentation

◆ boundingRect() [1/2]

NvMotDataTypes::Rect2f CV_FUNCS::boundingRect ( const std::vector< Eigen::Vector2d > &  points)

Compute the axis-aligned bounding rectangle of a point set.

Parameters
[in]pointsInput points.

◆ boundingRect() [2/2]

NvMotDataTypes::Rect2f CV_FUNCS::boundingRect ( float *  mask,
const int  width,
const int  height 
)

Compute the bounding rectangle of nonzero mask values.

Parameters
[in]maskRow-major mask values.
[in]widthMask width.
[in]heightMask height.

◆ circshift()

Eigen::MatrixXf CV_FUNCS::circshift ( const Eigen::MatrixXf &  matrix,
int  dx,
int  dy 
)
inline

Circularly shift a matrix along both axes.

Parameters
[in]matrixMatrix to shift.
[in]dxHorizontal shift.
[in]dyVertical shift.

Definition at line 293 of file sources/libs/nvmultiobjecttracker/include/modules/utility/cv_functions.hpp.

References modul().

Referenced by get2dGaussianPdf(), and TrackerVizOutput::prepareCorrelationResponseImg().

◆ computeIOU()

float CV_FUNCS::computeIOU ( const NvMotDataTypes::Rect2f  currBox,
const NvMotDataTypes::Rect2f  prevBox 
)
inline

Compute intersection over union for two bounding boxes.

Parameters
[in]currBoxCurrent bounding box.
[in]prevBoxPrevious bounding box.

Definition at line 425 of file sources/libs/nvmultiobjecttracker/include/modules/utility/cv_functions.hpp.

◆ computeSearchRegion()

const NvMotDataTypes::Rect2f CV_FUNCS::computeSearchRegion ( const NvMotDataTypes::Rect2f &  bbox_new,
const float  paddingScale 
)
inline

Expand a bounding box into a square search region.

Parameters
[in]bbox_newBounding box around which the search region is centered.
[in]paddingScalePadding scale applied to the geometric mean box size.

Define search region for the update.

Define search region for the update.

Define search region for the update.

Definition at line 394 of file sources/libs/nvmultiobjecttracker/include/modules/utility/cv_functions.hpp.

References constructRect2f(), floorf(), and half_float::detail::sqrt().

◆ computeSizeScore()

float CV_FUNCS::computeSizeScore ( const NvMotDataTypes::Rect2f &  currBox,
const NvMotDataTypes::Rect2f &  prevBox 
)
inline

Compute a symmetric area-ratio score between two bounding boxes.

Parameters
[in]currBoxCurrent bounding box.
[in]prevBoxPrevious bounding box.

Definition at line 270 of file sources/libs/nvmultiobjecttracker/include/modules/utility/cv_functions.hpp.

◆ computeVisibility()

float CV_FUNCS::computeVisibility ( const NvMotDataTypes::Rect2f &  objBbox,
const NvMotDataTypes::Rect2f &  imgBbox 
)
inline

Compute the fraction of an object bounding box visible inside an image box.

Parameters
[in]objBboxObject bounding box.
[in]imgBboxImage bounding box.

Definition at line 459 of file sources/libs/nvmultiobjecttracker/include/modules/utility/cv_functions.hpp.

◆ constructRect2f()

NvMotDataTypes::Rect2f CV_FUNCS::constructRect2f ( const float  minX = 0,
const float  minY = 0,
const float  width = 0,
const float  height = 0 
)
inline

Construct an axis-aligned rectangle from its origin and size.

Parameters
[in]minXLeft coordinate.
[in]minYTop coordinate.
[in]widthRectangle width.
[in]heightRectangle height.

Definition at line 93 of file sources/libs/nvmultiobjecttracker/include/modules/utility/cv_functions.hpp.

References max(), min(), and width.

Referenced by computeSearchRegion(), convertXToBbox(), DetectedObjInfo::DetectedObjInfo(), and TrackerVizOutput::drawRecentTrajectory().

◆ convertBboxToZ()

Eigen::VectorXd CV_FUNCS::convertBboxToZ ( const NvMotDataTypes::Rect2f &  bbox,
const bool  useAspc = false 
)

Convert a bounding box to an estimator measurement vector.

Parameters
[in]bboxBounding box to convert.
[in]useAspcSelects aspect ratio instead of width in the measurement vector.

◆ convertXToBbox()

NvMotDataTypes::Rect2f CV_FUNCS::convertXToBbox ( const Eigen::VectorXd &  x,
const bool  useAspc = false 
)
inline

Convert an estimator state vector to a bounding box.

Parameters
[in]xEstimator state vector.
[in]useAspcSelects aspect ratio instead of width in the state vector.

Derive the width from the aspect ratio when the state uses one.

Derive the width from the aspect ratio when the state uses one.

Derive the width from the aspect ratio when the state uses one.

Definition at line 217 of file sources/libs/nvmultiobjecttracker/include/modules/utility/cv_functions.hpp.

References constructRect2f().

Referenced by NvTrackedObject::getPredictedTargetBbox().

◆ convexHull() [1/2]

void CV_FUNCS::convexHull ( const std::vector< Eigen::Vector2d > &  points,
std::vector< Eigen::Vector2d > &  hull 
)

Compute the convex hull of double-precision points.

Parameters
[in]pointsInput points.
[out]hullConvex-hull vertices in traversal order.

Referenced by TrackerVizOutput::drawProjectedTargetModel().

◆ convexHull() [2/2]

void CV_FUNCS::convexHull ( const std::vector< Eigen::Vector2f > &  points,
std::vector< Eigen::Vector2f > &  hull 
)

Compute the convex hull of single-precision points.

Parameters
[in]pointsInput points.
[out]hullConvex-hull vertices in traversal order.

◆ displaceBbox()

NvMotDataTypes::Rect2f CV_FUNCS::displaceBbox ( const NvMotDataTypes::Rect2f &  bbox,
const float  displacement_x,
const float  displacement_y 
)
inline

Translate a bounding box by horizontal and vertical displacements.

Parameters
[in]bboxBounding box to translate.
[in]displacement_xHorizontal displacement.
[in]displacement_yVertical displacement.

Update the target center from the displacement in correlation response.

Update the target center from the displacement in correlation response.

Update the target center from the displacement in correlation response.

Definition at line 109 of file sources/libs/nvmultiobjecttracker/include/modules/utility/cv_functions.hpp.

References max(), and min().

◆ get2dGaussianPdf()

Eigen::MatrixXf CV_FUNCS::get2dGaussianPdf ( const float  sigma,
const int  w,
const int  h,
const bool  wrap_kernel = true 
)
inline

Create a two-dimensional Gaussian response map.

Parameters
[in]sigmaGaussian standard deviation.
[in]wResponse-map width.
[in]hResponse-map height.
[in]wrap_kernelCircularly shifts the peak to the origin when true.

Calculate for each pixel separately.

Wrap-around with the circular shifting.

Calculate for each pixel separately.

Wrap-around with the circular shifting.

Calculate for each pixel separately.

Wrap-around with the circular shifting.

Definition at line 317 of file sources/libs/nvmultiobjecttracker/include/modules/utility/cv_functions.hpp.

References circshift(), half_float::exp(), and half_float::pow().

◆ getBboxCenterPt()

Eigen::Vector2f CV_FUNCS::getBboxCenterPt ( const NvMotDataTypes::Rect2f &  bbox)
inline

Compute the center point of a bounding box.

Parameters
[in]bboxBounding box whose center is requested.

Definition at line 128 of file sources/libs/nvmultiobjecttracker/include/modules/utility/cv_functions.hpp.

References min(), and pydeepstreamdoc::tensor::TensorDoc::size.

Referenced by DetectedObjInfo::DetectedObjInfo().

◆ getBoxWithAspectRatio()

NvMotDataTypes::Rect2f CV_FUNCS::getBoxWithAspectRatio ( const NvMotDataTypes::Rect2f &  bbox,
const float  aspectRatio 
)
inline

Adjust the width of the bbox according to the aspect ratio specified.

Parameters
[in]bboxBounding box whose width is adjusted to the given aspect ratio.
[in]aspectRatioWidth divided by height used to resize the box.
Returns
Adjusted bounding box.

Definition at line 173 of file sources/libs/nvmultiobjecttracker/include/modules/utility/cv_functions.hpp.

◆ getEigenRectString()

const std::string CV_FUNCS::getEigenRectString ( const NvMotDataTypes::Rect2f &  bbox)
inline

Format an Eigen bounding box as a readable string.

Parameters
[in]bboxBounding box to format.

Definition at line 140 of file sources/libs/nvmultiobjecttracker/include/modules/utility/cv_functions.hpp.

◆ getHanningWindow()

NvMotDataTypes::RowMajorMatrixXf CV_FUNCS::getHanningWindow ( const int  width,
const int  height,
float  offsetFactor_y = 0.f 
)
inline

Generate a separable two-dimensional Hann window.

Parameters
[in]widthWindow width.
[in]heightWindow height.
[in]offsetFactor_yVertical offset as a fraction of window height.

Definition at line 235 of file sources/libs/nvmultiobjecttracker/include/modules/utility/cv_functions.hpp.

References half_float::cos(), and width.

◆ isBboxEqual()

bool CV_FUNCS::isBboxEqual ( const NvMotDataTypes::Rect2f &  bbox1,
const NvMotDataTypes::Rect2f &  bbox2 
)
inline

Compare two bounding boxes for exact equality.

Parameters
[in]bbox1First bounding box.
[in]bbox2Second bounding box.

Definition at line 152 of file sources/libs/nvmultiobjecttracker/include/modules/utility/cv_functions.hpp.

◆ modul()

int CV_FUNCS::modul ( int  a,
int  b 
)
inline

Compute a nonnegative modulo result for positive divisors.

Parameters
[in]aDividend.
[in]bDivisor.

Definition at line 162 of file sources/libs/nvmultiobjecttracker/include/modules/utility/cv_functions.hpp.

Referenced by circshift().

◆ orientation() [1/2]

int CV_FUNCS::orientation ( const Eigen::Vector2d &  p,
const Eigen::Vector2d &  q,
const Eigen::Vector2d &  r 
)
inline

Classify the orientation of three double-precision points.

Parameters
[in]pFirst point.
[in]qSecond point.
[in]rThird point.
Returns
Zero for collinear points, one for clockwise order, or two for counterclockwise order.

Return the collinear classification.

Classify the turn as clockwise or counterclockwise.

Return the collinear classification.

Classify the turn as clockwise or counterclockwise.

Return the collinear classification.

Classify the turn as clockwise or counterclockwise.

Definition at line 493 of file sources/libs/nvmultiobjecttracker/include/modules/utility/cv_functions.hpp.

References val.

◆ orientation() [2/2]

int CV_FUNCS::orientation ( const Eigen::Vector2f &  p,
const Eigen::Vector2f &  q,
const Eigen::Vector2f &  r 
)
inline

Classify the orientation of three single-precision points.

Parameters
[in]pFirst point.
[in]qSecond point.
[in]rThird point.
Returns
Zero for collinear points, one for clockwise order, or two for counterclockwise order.

Return the collinear classification.

Classify the turn as clockwise or counterclockwise.

Return the collinear classification.

Classify the turn as clockwise or counterclockwise.

Return the collinear classification.

Classify the turn as clockwise or counterclockwise.

Definition at line 511 of file sources/libs/nvmultiobjecttracker/include/modules/utility/cv_functions.hpp.

References val.

◆ unclipBbox()

const NvMotDataTypes::Rect2f CV_FUNCS::unclipBbox ( const NvMotDataTypes::Rect2f  tBbox_new,
const NvMotDataTypes::Rect2f  srcImageBox,
const NvMotDataTypes::Rect2f  tBbox_prev 
)
inline

Recover bounding-box extent clipped by an image border using the previous box size.

Parameters
[in]tBbox_newBounding box that may be clipped by the image border.
[in]srcImageBoxSource image rectangle whose size defines the clipping border.
[in]tBbox_prevPrevious bounding box whose width or height is restored on a clipped side.
Returns
Unclipped bounding box.

Recover a left-clipped box.

Recover a right-clipped box.

Recover a top-clipped box.

Recover a bottom-clipped box.

Recover a left-clipped box.

Recover a right-clipped box.

Recover a top-clipped box.

Recover a bottom-clipped box.

Recover a left-clipped box.

Recover a right-clipped box.

Recover a top-clipped box.

Recover a bottom-clipped box.

Definition at line 346 of file sources/libs/nvmultiobjecttracker/include/modules/utility/cv_functions.hpp.