You are here: Start » FIL.NET » FIL.ImageMoment
Computes the selected moment of an image in regular and normalized (divided by sum of pixel values) variant.
Namespace: | FilNet |
---|---|
Assembly: | FIL.NET.dll |
Syntax
public static void ImageMoment ( FilNet.Image inImage, NullableRef<FilNet.Region> inRoi, FilNet.ImageMomentType inMomentType, bool inCentral, out float outMoment, out float outNormMoment )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() | inImage | FilNet.Image | Input image. | ||
![]() | inRoi | FilNet.NullableRef<FilNet.Region> | Range of pixels to be processed. Default value: ftl::NIL. | ||
![]() | inMomentType | FilNet.ImageMomentType | |||
![]() | inCentral | bool | |||
![]() | outMoment | float | |||
![]() | outNormMoment | float |
Description
The operation computes the mathematical features of an image called moments. Those are sums computed as follows:
\[ \begin{aligned} Moment_{0,0}(Image,Roi) &= \sum_{p \in Roi} Image(p_x,p_y) \cdot 1 \\ Moment_{0,1}(Image,Roi) &= \sum_{p \in Roi} Image(p_x,p_y) \cdot p_y \\ Moment_{1,0}(Image,Roi) &= \sum_{p \in Roi} Image(p_x,p_y) \cdot p_x \\ Moment_{0,2}(Image,Roi) &= \sum_{p \in Roi} Image(p_x,p_y) \cdot p_y^2 \\ Moment_{1,1}(Image,Roi) &= \sum_{p \in Roi} Image(p_x,p_y) \cdot p_x p_y \\ Moment_{2,0}(Image,Roi) &= \sum_{p \in Roi} Image(p_x,p_y) \cdot p_x^2 \end{aligned} \]The summing is conducted over all pixels in inRoi region, while \( p_x \) and \( p_y \) denote, accordingly, x and y coordinate of a pixel.
When inCentral parameter is set, the image is shifted before computations, so that its mass center is at location (0,0).
Hardware Acceleration
This operation supports automatic parallelization for multicore and multiprocessor systems.
Hardware acceleration settings may be manipulated with Settings class.
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Black image on input in ImageMoment. |
DomainError | Empty region on input in ImageMoment. |
DomainError | Region exceeds an input image in ImageMoment. |
Function Overrides
- ImageMoment(Image, ImageMomentType, Boolean, Single)
- ImageMoment(Image, ImageMomentType, Boolean, Single, NullableValue<Single>)
- ImageMoment(Image, NullableRef<Region>, ImageMomentType, Boolean, Single)
- ImageMoment(Image, NullableRef<Region>, ImageMomentType, Boolean, Single, NullableValue<Single>)