Back to Adaptive Vision Studio website

You are here: Start » Filter Reference » Region Features » RegionMassCenter

RegionMassCenter


Computes a point with coordinates equal to the average coordinates of the region's pixels.

Name Type Description
inRegion Region Input region
outMassCenter Point2D

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

Description of usage of this filter can be found in examples and tutorial: Capsules, Inset Distances, Molybdenum Foil, Mounts (Contour Analysis), Washers, Mounts (Segmentation).

The resulting outMassCenter point drawn onto the sample region.

Errors

This filter can throw an exception to report error. Read how to deal with errors in Error Handling.

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.

Complexity Level

This filter is available on Basic Complexity Level.

Filter Group

This filter is member of RegionMassCenter filter group.

See Also