Back to Adaptive Vision Library website

You are here: Start » Function Reference » Geometry 2D Features » PointsBoundingRectangle

PointsBoundingRectangle


Computes the smallest rectangle containing an array of points.

Syntax

C++
C#
 
void avl::PointsBoundingRectangle
(
	const atl::Array<avl::Point2D>& inPoints,
	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
inPoints const Array<Point2D>& 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& Smallest bounding rectangle of the input points
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

Examples

The resulting outBoundingRectangle drawn with the input points and with inRectangleOrientation set on Auto

Errors

Error type Description
DomainError No points on input in PointsBoundingRectangle.
DomainError Incorrect BoundingRectangleFeature in PointsBoundingRectangle.