Back to Adaptive Vision Library website
You are here: Start » Function Reference » Region Features » RegionPerimeterLength
RegionPerimeterLength
Computes the length of the input region perimeter.
Header: | AVL.h |
---|
Syntax
C++
C#
void avl::RegionPerimeterLength ( const avl::Region& inRegion, float& outPerimeterLength )
Parameters
Name | Type | Default | Description | |
---|---|---|---|---|
inRegion | const 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:
To compute the actual contour of the region, one can use RegionContours filter.
Examples
See Also
- RegionContours – Computes an array of closed paths corresponding to the contours of the input region.
- RegionDiameter – Computes the longest segment connecting two pixels contained in region and its length.