You are here: Start » AVL.NET » Function Reference » Region » Region Features » AVL.RegionPerimeterLength
Computes the length of the input region perimeter.
Namespace: | AvlNet |
---|---|
Assembly: | AVL.NET.dll |
Syntax
public static void RegionPerimeterLength ( AvlNet.Region inRegion, out float outPerimeterLength )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() | inRegion | AvlNet.Region | Input region. | ||
![]() | outPerimeterLength | float |
Description
The operation computes the perimeter length of a region shape. Because regions are pixel-precise, the literal computation of the length of the region contour would lead to the overestimation of the diagonal edges. Therefore, the filter employs the following equation to approximate the result:
Where
- sides denotes the number of pixel sides adjacent to the region background
- vertices is the number of turns to right during clockwise walk along the pixel sides of the region boundary
- a, b are constants defined as follows:
![](../img/filters/RegionPerimeter2.png)
To compute the actual contour of the region, one can use RegionContours filter.
Examples
![]() |
RegionPerimeterLength run on the sample region (circular region of radius 100) computes outPerimeterLength = 627.382, while the actual perimeter of the perfect circle of radius 100 is 628.318 .