Table of Contents

Class Moments

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

Raster image moments

public class Moments
Inheritance
Moments
Inherited Members

Constructors

Moments()

Default constructor. All moment values are set to 0.

public Moments()

Moments(InputArray, bool)

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

public 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

Moments(byte[,], bool)

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

public 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

Moments(IEnumerable<Point2f>, bool)

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

public 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

Moments(IEnumerable<Point>, bool)

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

public 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

Moments(double, double, double, double, double, double, double, double, double, double)

public Moments(double m00, double m10, double m01, double m20, double m11, double m02, double m30, double m21, double m12, double m03)

Parameters

m00 double
m10 double
m01 double
m20 double
m11 double
m02 double
m30 double
m21 double
m12 double
m03 double

Moments(float[,], bool)

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

public 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

Fields

M00

spatial moments

public double M00

Field Value

double

M01

spatial moments

public double M01

Field Value

double

M02

spatial moments

public double M02

Field Value

double

M03

spatial moments

public double M03

Field Value

double

M10

spatial moments

public double M10

Field Value

double

M11

spatial moments

public double M11

Field Value

double

M12

spatial moments

public double M12

Field Value

double

M20

spatial moments

public double M20

Field Value

double

M21

spatial moments

public double M21

Field Value

double

M30

spatial moments

public double M30

Field Value

double

Mu02

central moments

public double Mu02

Field Value

double

Mu03

central moments

public double Mu03

Field Value

double

Mu11

central moments

public double Mu11

Field Value

double

Mu12

central moments

public double Mu12

Field Value

double

Mu20

central moments

public double Mu20

Field Value

double

Mu21

central moments

public double Mu21

Field Value

double

Mu30

central moments

public double Mu30

Field Value

double

Nu02

central normalized moments

public double Nu02

Field Value

double

Nu03

central normalized moments

public double Nu03

Field Value

double

Nu11

central normalized moments

public double Nu11

Field Value

double

Nu12

central normalized moments

public double Nu12

Field Value

double

Nu20

central normalized moments

public double Nu20

Field Value

double

Nu21

central normalized moments

public double Nu21

Field Value

double

Nu30

central normalized moments

public double Nu30

Field Value

double

Methods

HuMoments()

computes 7 Hu invariants from the moments

public double[] HuMoments()

Returns

double[]