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.CVAssembly: Emgu.CV (in Emgu.CV.dll) Version: 2.2.1.1150 (2.2.1.1150)
Syntax
C# | Visual Basic | Visual C++ |
public static void cvMoments( IntPtr arr, ref MCvMoments moments, int binary )
Public Shared Sub cvMoments ( _ arr As IntPtr, _ ByRef moments As MCvMoments, _ binary As Integer _ )
public: static void cvMoments( IntPtr arr, MCvMoments% moments, int binary )
Parameters
- arr
- IntPtr
Image (1-channel or 3-channel with COI set) or polygon (CvSeq of points or a vector of points)
- moments
- MCvMoments%
Pointer to returned moment state structure
- binary
- 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