You are here: Start » AVL.NET » AVL.RegionMoment(AvlNet.Region, AvlNet.RegionMomentType, bool, float, float)
AVL.RegionMoment(AvlNet.Region, AvlNet.RegionMomentType, bool, float, float)
| Namespace: | AvlNet |
|---|---|
| Assembly: | AVL.NET.dll |
Syntax
public static void RegionMoment( AvlNet.Region inRegion, AvlNet.RegionMomentType inMomentType, bool inCentral, out float outMoment, out float outNormMoment )
Parameters
- inRegion
- Type: AvlNet.Region
- inMomentType
- Type: AvlNet.RegionMomentType
- inCentral
- Type: System.Boolean
- outMoment
- Type: System.Single
- outNormMoment
- Type: System.Single
Description
The operation computes the mathematical features of a shape called moments. Those are sums computed as follows:
\[ \begin{aligned} Moment_{2,0}(R) &= \sum_{p \in R} p_x^2 \\ Moment_{1,1}(R) &= \sum_{p \in R} p_x p_y \\ Moment_{0,2}(R) &= \sum_{p \in R} p_y^2 \end{aligned} \]The summing is conducted over region pixels, while \( p_x \) and \( p_y \) denote, accordingly, x and y coordinate of a pixel.
When inCentral parameter is set, the region is shifted before computations, so that its mass center is at location (0,0).
Errors
| Error type | Description |
|---|---|
| DomainError | Not supported moment type in RegionMoment |
