Back to Adaptive Vision Library website

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

# RegionCircularity

Header: | AVL.h |
---|---|

Namespace: | avl |

Computes the area of a region divided by the area of a circular region having the same feature.

### Syntax

C++

C#

void avl::RegionCircularity ( const avl::Region& inRegion, const avl::CircularityMeasure::Type inCircularityMeasure, float& outCircularity, avl::Circle2D& diagCircle )

### Parameters

Name | Type | Default | Description | |
---|---|---|---|---|

inRegion | const Region& | Input region | ||

inCircularityMeasure | const CircularityMeasure::Type | RadiusPreserving | Which algorithm should be used to compute a circle | |

outCircularity | float& | |||

diagCircle | Circle2D& | Computed circle which area was compared. |

### 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**

### Hints

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

### Examples

### Errors

List of possible exceptions:

Error type | Description |
---|---|

DomainError |
Empty region on input in RegionCircularity. |

DomainError |
Not supported circularity measure in RegionCircularity. |

### See Also

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

- RegionElongation – Computes the elongation factor of a region ( perfect circle has minimal elongation equal 1.0 ).

- ShapeCircularity – Computes the area of a shape divided by the area of a circle having the same feature.