NVIDIA DeepStream SDK API Reference

6.4 Release
cvcore::BBox Struct Reference

Detailed Description

A struct.

Structure used to store bounding box.

Definition at line 24 of file BBox.h.

Public Member Functions

BBox clamp (const BBox &clampBox) const
 Clamp a bounding box based on a restricting clamp box. More...
 
size_t getWidth () const
 
size_t getHeight () const
 
bool isValid () const
 Checks if the bounding box is valid. More...
 
std::pair< int, int > getCenter () const
 Returns the center of the bounding box. More...
 
BBox scale (float scaleW, float scaleH) const
 Scales bounding box based along the width and height retaining the same center. More...
 
BBox squarify (const BBox &clampBox) const
 Resizes bounding box to a square bounding box based on the longest edge and clamps the bounding box based on the limits provided. More...
 

Data Fields

int xmin {0}
 minimum x coordinate. More...
 
int ymin {0}
 minimum y coordinate. More...
 
int xmax {0}
 maximum x coordinate. More...
 
int ymax {0}
 maximum y coordinate. More...
 

Member Function Documentation

◆ clamp()

BBox cvcore::BBox::clamp ( const BBox clampBox) const
inline

Clamp a bounding box based on a restricting clamp box.

Parameters
Clampingbounding box (xmin, ymin, xmax, ymax)
Returns
Clamped bounding box

Definition at line 36 of file BBox.h.

References xmax, xmin, ymax, and ymin.

Referenced by squarify().

◆ getCenter()

std::pair<int, int> cvcore::BBox::getCenter ( ) const
inline

Returns the center of the bounding box.

Returns
X,Y coordinate tuple

Definition at line 74 of file BBox.h.

References getHeight(), getWidth(), xmin, and ymin.

Referenced by scale().

◆ getHeight()

size_t cvcore::BBox::getHeight ( ) const
inline
Returns
Height of the bounding box

Definition at line 57 of file BBox.h.

References ymax, and ymin.

Referenced by getCenter(), isValid(), scale(), and squarify().

◆ getWidth()

size_t cvcore::BBox::getWidth ( ) const
inline
Returns
Width of the bounding box

Definition at line 49 of file BBox.h.

References xmax, and xmin.

Referenced by getCenter(), isValid(), scale(), and squarify().

◆ isValid()

bool cvcore::BBox::isValid ( ) const
inline

Checks if the bounding box is valid.

Definition at line 65 of file BBox.h.

References getHeight(), getWidth(), xmax, xmin, ymax, and ymin.

Referenced by squarify().

◆ scale()

BBox cvcore::BBox::scale ( float  scaleW,
float  scaleH 
) const
inline

Scales bounding box based along the width and height retaining the same center.

Parameters
Scalein X direction along the width
Scalein Y direction along the height
Returns
Scaled bounding box

Definition at line 87 of file BBox.h.

References getCenter(), getHeight(), getWidth(), xmax, xmin, ymax, and ymin.

Referenced by squarify().

◆ squarify()

BBox cvcore::BBox::squarify ( const BBox clampBox) const
inline

Resizes bounding box to a square bounding box based on the longest edge and clamps the bounding box based on the limits provided.

Parameters
Clampingbounding box (xmin, ymin, xmax, ymax)
Returns
Sqaure bounding box

Definition at line 107 of file BBox.h.

References clamp(), getHeight(), getWidth(), isValid(), scale(), xmax, xmin, ymax, and ymin.

Field Documentation

◆ xmax

int cvcore::BBox::xmax {0}

maximum x coordinate.

Definition at line 28 of file BBox.h.

Referenced by clamp(), getWidth(), isValid(), scale(), and squarify().

◆ xmin

int cvcore::BBox::xmin {0}

minimum x coordinate.

Definition at line 26 of file BBox.h.

Referenced by clamp(), getCenter(), getWidth(), isValid(), scale(), and squarify().

◆ ymax

int cvcore::BBox::ymax {0}

maximum y coordinate.

Definition at line 29 of file BBox.h.

Referenced by clamp(), getHeight(), isValid(), scale(), and squarify().

◆ ymin

int cvcore::BBox::ymin {0}

minimum y coordinate.

Definition at line 27 of file BBox.h.

Referenced by clamp(), getCenter(), getHeight(), isValid(), scale(), and squarify().


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