Back to Adaptive Vision Library website

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


Header: AVL.h
Namespace: avl
Module: FoundationBasic

Computes the area of a region divided by area of its convex hull.


void avl::RegionConvexity
	const avl::Region& inRegion,
	float& outConvexity


Name Type Default Description
inRegion const Region& Input region
outConvexity float&


Convexity is a measure of how close a region is to being convex. Convex regions have convexity equal to 1.0, while the more concave the region is, the closer to 0.0 is its convexity.

Mathematically, the convexity is calculated as follows:


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


Area of the sample region (on the left) equals to 2345, while area of its convex hull (on the right) equals to 40357, so the RegionConvexity run on the sample region would produce the result 2345/40357 = 0.058 .


List of possible exceptions:

Error type Description
DomainError Empty region on input in RegionConvexity.

See Also

  • RegionConvexHull – Computes the smallest convex region containing the input region.
  • PolygonConvexity – Computes the area of a polygon divided by the area of its convex hull.