Table of Contents

Method Moments

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

Moments(InputArray, bool)

Calculates all of the moments up to the third order of a polygon or rasterized shape.

public static Moments Moments(InputArray array, bool binaryImage = false)

Parameters

array InputArray

A raster image (single-channel, 8-bit or floating-point 2D array) or an array ( 1xN or Nx1 ) of 2D points ( Point or Point2f )

binaryImage bool

If it is true, then all the non-zero image pixels are treated as 1’s

Returns

Moments

Moments(byte[,], bool)

Calculates all of the moments up to the third order of a polygon or rasterized shape.

public static Moments Moments(byte[,] array, bool binaryImage = false)

Parameters

array byte[,]

A raster image (8-bit) 2D array

binaryImage bool

If it is true, then all the non-zero image pixels are treated as 1’s

Returns

Moments

Moments(float[,], bool)

Calculates all of the moments up to the third order of a polygon or rasterized shape.

public static Moments Moments(float[,] array, bool binaryImage = false)

Parameters

array float[,]

A raster image (floating-point) 2D array

binaryImage bool

If it is true, then all the non-zero image pixels are treated as 1’s

Returns

Moments

Moments(IEnumerable<Point>, bool)

Calculates all of the moments up to the third order of a polygon or rasterized shape.

public static Moments Moments(IEnumerable<Point> array, bool binaryImage = false)

Parameters

array IEnumerable<Point>

Array of 2D points

binaryImage bool

If it is true, then all the non-zero image pixels are treated as 1’s

Returns

Moments

Moments(IEnumerable<Point2f>, bool)

Calculates all of the moments up to the third order of a polygon or rasterized shape.

public static Moments Moments(IEnumerable<Point2f> array, bool binaryImage = false)

Parameters

array IEnumerable<Point2f>

Array of 2D points

binaryImage bool

If it is true, then all the non-zero image pixels are treated as 1’s

Returns

Moments