Back to Adaptive Vision Library website

You are here: Start » Function Reference » Region Basics » CreateRectangleRegion

CreateRectangleRegion


Creates a region corresponding to a given rectangle.

Header:AVL.h

Syntax

C++
C#
 
void avl::CreateRectangleRegion
(
	const avl::Rectangle2D& inRectangle,
	atl::Optional<const avl::CoordinateSystem2D&> inRectangleAlignment,
	int inFrameWidth,
	int inFrameHeight,
	avl::Region& outRegion,
	atl::Optional<avl::Rectangle2D&> outAlignedRectangle = atl::NIL
)

Parameters

Name Type Range Default Description
inRectangle const Rectangle2D&
inRectangleAlignment Optional<const CoordinateSystem2D&> NIL Adjusts the rectangle to the position of the inspected object
inFrameWidth int 0 - Width of the created region's frame (not to be confused with the width of the rectangle!)
inFrameHeight int 0 - Height of the created region's frame (not to be confused with the height of the rectangle!)
outRegion Region& Output region
outAlignedRectangle Optional<Rectangle2D&> NIL The input rectangle transformed to the absolute coordinate system

Description

The operation creates a region containing pixels lying inside the specified rectangle.

The inFrameWidth and inFrameHeight parameters most often should be set equal to the dimensions of the image this region will be used with. If the input rectangle exceeds these dimensions, the output region will be cropped.

Hints

  • Remember to set inFrameWidth and inFrameHeight inputs to specify the region frame.

Examples

See Also