Back to FabImage Library website
You are here: Start » Function Reference » Region Features » RegionMassCenter
Header: | FIL.h |
---|---|
Namespace: | fil |
Computes a point with coordinates equal to the average coordinates of the region's pixels.
Syntax
C++
C#
void fil::RegionMassCenter ( const fil::Region& inRegion, fil::Point2D& outMassCenter )
Parameters
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
![]() |
The resulting outMassCenter point drawn onto the sample region.
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Input region area above 2^30 in RegionMassCenter. |
DomainError | Input region is empty in RegionMassCenter. |
DomainError | Point-run length above 2^15 in RegionMassCenter. |
See Also
- ShapeMassCenter – Computes the mass center of a shape.