You are here: Start » AVL.NET » AVL.RegionCircularity(AvlNet.Region, AvlNet.CircularityMeasure, float, AvlNet.Circle2D)

AVL.RegionCircularity(AvlNet.Region, AvlNet.CircularityMeasure, float, AvlNet.Circle2D)

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax


public static void RegionCircularity(
	AvlNet.Region inRegion,
	AvlNet.CircularityMeasure inCircularityMeasure,
	out float outCircularity,
	out AvlNet.Circle2D diagCircle
)

Parameters

inRegion
Type: AvlNet.Region
inCircularityMeasure
Type: AvlNet.CircularityMeasure
outCircularity
Type: System.Single
diagCircle
Type: AvlNet.Circle2D

Description

Circularity is a measure of similarity of a region shape to the perfect circle. Circular regions have circularity close to 1.0, while the more elongated the region is (or contains more holes), the closer to 0.0 is its circularity.

Mathematically, the circularity is calculated as follows: Where c denotes a circular region having the same feature as input region r. The feature being considered depends on the inCircularityMeasure chosen and it is:

  • the minimal bounding circle in case of BoundingCirclePreserving
  • the perimeter in case of PerimeterPreserving
  • the radius (maximal distance from mass center to any of the region pixels) in case of RadiusPreserving

Examples

Circularity with RadiusPreserving of the sample region equals to 0.667.

Circularity with PerimeterPreserving of the sample region equals to 1.000.

Errors

Error type Description
DomainError Degenerate region on input in RegionCircularity.
DomainError Not supported circularity measure in RegionCircularity.

See also