Back to Adaptive Vision Library website

You are here: Start » Function Reference » Shape Features » ShapeMassCenter

ShapeMassCenter


Header:AVL.h
Namespace:avl

Computes the mass center of a shape.

Syntax

C++
C#
 
void avl::ShapeMassCenter
(
	const avl::Path& inShape,
	avl::Point2D& outMassCenter
)

Parameters

Name Type Default Description
inShape const Path&
outMassCenter Point2D&

Description

The operation computes the mass center of a shape bounded by a closed path.

Note that if the input path is not a valid shape (i.e. it has at least one self-intersection), the computation may lead to results that are not intuitive.

Examples

The resulting outMassCenters drawn onto the sample shapes.

Errors

List of possible exceptions:

Error type Description
DomainError Degenerate shape on input in ShapeMassCenter.
DomainError Open path on input in ShapeMassCenter.

See Also

  • PathMassCenter – Computes the average of the path points (all, not only characteristic ones).
  • RegionMassCenter – Computes a point with coordinates equal to the average coordinates of the region's pixels.