Back to Aurora Vision Library website

You are here: Start » Function Reference » Region » Region Features » RegionOrientation


Header: AVL.h
Namespace: avl
Module: FoundationBasic

Computes the orientation of a region as an angle of value in a proper range.


void avl::RegionOrientation
	const avl::Region& inRegion,
	avl::AngleRange::Type inAngleRange,
	float& outOrientationAngle


Name Type Default Description
Input value
inRegion const Region& Input region
Input value
inAngleRange AngleRange::Type _0_180 Switches between ranges <0; 90), <0; 180) and <0; 360)
Output value
outOrientationAngle float&


Region orientation can be thought of as the direction in which the region is oriented. Mathematically it is the angle between X-axis and the line passing through the region mass center, that rotation around this line produces the smallest torque.


  • If the input region is not guaranteed to be non-empty, precede this filter with SkipEmptyRegion.


Orientation of the sample region equals to 53.496, which is visualized on the second image by drawing the line of this orientation passing through the region mass center.


List of possible exceptions:

Error type Description
DomainError Empty region on input in RegionOrientation.

See Also

  • PolygonOrientation – Computes the polygon orientation as angle with value in range 0.0 - 180.0.