Show / Hide Table of Contents

Class Moments

Raster image moments

Inheritance
System.Object
Moments
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: OpenCvSharp
Assembly: OpenCvSharp.dll
Syntax
public class Moments

Constructors

| Improve this Doc View Source

Moments()

Default constructor. All moment values are set to 0.

Declaration
public Moments()
| Improve this Doc View Source

Moments(IEnumerable<Point>, Boolean)

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

Declaration
public Moments(IEnumerable<Point> array, bool binaryImage = false)
Parameters
Type Name Description
IEnumerable<OpenCvSharp.Point> array

Array of 2D points

System.Boolean binaryImage

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

| Improve this Doc View Source

Moments(IEnumerable<Point2f>, Boolean)

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

Declaration
public Moments(IEnumerable<Point2f> array, bool binaryImage = false)
Parameters
Type Name Description
IEnumerable<OpenCvSharp.Point2f> array

Array of 2D points

System.Boolean binaryImage

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

| Improve this Doc View Source

Moments(InputArray, Boolean)

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

Declaration
public Moments(InputArray array, bool binaryImage = false)
Parameters
Type Name Description
InputArray array

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

System.Boolean binaryImage

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

| Improve this Doc View Source

Moments(Byte[,], Boolean)

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

Declaration
public Moments(byte[, ] array, bool binaryImage = false)
Parameters
Type Name Description
System.Byte[,] array

A raster image (8-bit) 2D array

System.Boolean binaryImage

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

| Improve this Doc View Source

Moments(Double, Double, Double, Double, Double, Double, Double, Double, Double, Double)

Declaration
public Moments(double m00, double m10, double m01, double m20, double m11, double m02, double m30, double m21, double m12, double m03)
Parameters
Type Name Description
System.Double m00
System.Double m10
System.Double m01
System.Double m20
System.Double m11
System.Double m02
System.Double m30
System.Double m21
System.Double m12
System.Double m03
| Improve this Doc View Source

Moments(Single[,], Boolean)

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

Declaration
public Moments(float[, ] array, bool binaryImage = false)
Parameters
Type Name Description
System.Single[,] array

A raster image (floating-point) 2D array

System.Boolean binaryImage

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

Fields

| Improve this Doc View Source

M00

spatial moments

Declaration
public double M00
Field Value
Type Description
System.Double
| Improve this Doc View Source

M01

spatial moments

Declaration
public double M01
Field Value
Type Description
System.Double
| Improve this Doc View Source

M02

spatial moments

Declaration
public double M02
Field Value
Type Description
System.Double
| Improve this Doc View Source

M03

spatial moments

Declaration
public double M03
Field Value
Type Description
System.Double
| Improve this Doc View Source

M10

spatial moments

Declaration
public double M10
Field Value
Type Description
System.Double
| Improve this Doc View Source

M11

spatial moments

Declaration
public double M11
Field Value
Type Description
System.Double
| Improve this Doc View Source

M12

spatial moments

Declaration
public double M12
Field Value
Type Description
System.Double
| Improve this Doc View Source

M20

spatial moments

Declaration
public double M20
Field Value
Type Description
System.Double
| Improve this Doc View Source

M21

spatial moments

Declaration
public double M21
Field Value
Type Description
System.Double
| Improve this Doc View Source

M30

spatial moments

Declaration
public double M30
Field Value
Type Description
System.Double
| Improve this Doc View Source

Mu02

central moments

Declaration
public double Mu02
Field Value
Type Description
System.Double
| Improve this Doc View Source

Mu03

central moments

Declaration
public double Mu03
Field Value
Type Description
System.Double
| Improve this Doc View Source

Mu11

central moments

Declaration
public double Mu11
Field Value
Type Description
System.Double
| Improve this Doc View Source

Mu12

central moments

Declaration
public double Mu12
Field Value
Type Description
System.Double
| Improve this Doc View Source

Mu20

central moments

Declaration
public double Mu20
Field Value
Type Description
System.Double
| Improve this Doc View Source

Mu21

central moments

Declaration
public double Mu21
Field Value
Type Description
System.Double
| Improve this Doc View Source

Mu30

central moments

Declaration
public double Mu30
Field Value
Type Description
System.Double
| Improve this Doc View Source

Nu02

central normalized moments

Declaration
public double Nu02
Field Value
Type Description
System.Double
| Improve this Doc View Source

Nu03

central normalized moments

Declaration
public double Nu03
Field Value
Type Description
System.Double
| Improve this Doc View Source

Nu11

central normalized moments

Declaration
public double Nu11
Field Value
Type Description
System.Double
| Improve this Doc View Source

Nu12

central normalized moments

Declaration
public double Nu12
Field Value
Type Description
System.Double
| Improve this Doc View Source

Nu20

central normalized moments

Declaration
public double Nu20
Field Value
Type Description
System.Double
| Improve this Doc View Source

Nu21

central normalized moments

Declaration
public double Nu21
Field Value
Type Description
System.Double
| Improve this Doc View Source

Nu30

central normalized moments

Declaration
public double Nu30
Field Value
Type Description
System.Double

Methods

| Improve this Doc View Source

HuMoments()

computes 7 Hu invariants from the moments

Declaration
public double[] HuMoments()
Returns
Type Description
System.Double[]
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX