Calculates spatial and central moments up to the third order and writes them to moments. The moments may be used then to calculate gravity center of the shape, its area, main axises and various shape characeteristics including 7 Hu invariants.

Namespace: Emgu.CV
Assembly: Emgu.CV (in Emgu.CV.dll) Version: (


public static void cvMoments(
	IntPtr arr,
	ref MCvMoments moments,
	int binary
Visual Basic
Public Shared Sub cvMoments ( _
	arr As IntPtr, _
	ByRef moments As MCvMoments, _
	binary As Integer _
Visual C++
static void cvMoments(
	IntPtr arr, 
	MCvMoments% moments, 
	int binary


Type: System..::..IntPtr
Image (1-channel or 3-channel with COI set) or polygon (CvSeq of points or a vector of points)
Type: Emgu.CV.Structure..::..MCvMoments%
Pointer to returned moment state structure
Type: System..::..Int32
(For images only) If the flag is non-zero, all the zero pixel values are treated as zeroes, all the others are treated as 1s

See Also