Back to Adaptive Vision Library website
You are here: Start » Function Reference » Region Features » RegionBoundingRectangle
RegionBoundingRectangle
Computes the smallest rectangle containing a region.
Syntax
C++
C#
void avl::RegionBoundingRectangle ( const avl::Region& inRegion, atl::Optional<atl::real> inRectangleOrientation, avl::BoundingRectangleFeature::Type inBoundingRectangleFeature, avl::Rectangle2D& outBoundingRectangle, atl::Optional<avl::Point2D&> outCenter = atl::NIL, atl::Optional<atl::real&> outLongSide = atl::NIL, atl::Optional<atl::real&> outShortSide = atl::NIL )
Parameters
| Name | Type | Default | Description | |
|---|---|---|---|---|
![]() |
inRegion | const Region& | Input array of points | |
![]() |
inRectangleOrientation | Optional<real> | NIL | Expected orientation of the resulting rectangle |
![]() |
inBoundingRectangleFeature | BoundingRectangleFeature::Type | MinimalArea | Determines what kind of bounding rectangle will be computed |
![]() |
outBoundingRectangle | Rectangle2D& | The smallest bounding rectangle of the input region | |
![]() |
outCenter | Optional<Point2D&> | NIL | Center of the bounding rectangle |
![]() |
outLongSide | Optional<real&> | NIL | Length of the bounding rectangle long side |
![]() |
outShortSide | Optional<real&> | NIL | Length of the bounding rectangle short side |
Hints
- If the input region is not guaranteed to be non-empty, precede this filter with SkipEmptyRegion.
Examples
RegionBoundingRectangle performed on a sample region.
Remarks
Orientation of the resulting rectangle will be in range of 0..90 degrees. Consider using NormalizeRectangleOrientation if another orientation is more appropriate.
Errors
| Error type | Description |
|---|---|
| DomainError | Empty region on input in RegionBoundingRectangle. |


