Back to Aurora Vision Library Lite website
You are here: Start » Region » Region Features » RegionMassCenter
RegionMassCenter
Header: | AVL.h |
---|---|
Namespace: | avl |
Computes a point with coordinates equal to the average coordinates of the region's pixels.
Syntax
void avl::RegionMassCenter ( const avl::Region& inRegion, avl::Point2D& outMassCenter, atl::Optional<int&> outArea = atl::NIL )
Parameters
Name | Type | Default | Description | |
---|---|---|---|---|
inRegion | const Region& | Input region | ||
outMassCenter | Point2D& | |||
outArea | Optional<int&> | NIL |
Optional Outputs
The computation of following outputs can be switched off by passing value atl::NIL
to these parameters: outArea.
Read more about Optional Outputs.
Description
The operation computes the average of all pixel locations contained in a region. Note that the result is a Point2D, not a Location as its coordinates may be not-integer.
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 | Input region is empty in RegionMassCenter. |