Click or drag to resize
Accord.NET (logo)

CentralMoments Class

Central image moments.
Inheritance Hierarchy
SystemObject
  Accord.Imaging.MomentsMomentsBase
    Accord.Imaging.MomentsCentralMoments

Namespace:  Accord.Imaging.Moments
Assembly:  Accord.Imaging (in Accord.Imaging.dll) Version: 3.8.0
Syntax
public class CentralMoments : MomentsBase, 
	IMoments
Request Example View Source

The CentralMoments type exposes the following members.

Constructors
  NameDescription
Public methodCentralMoments(Int32)
Initializes a new instance of the CentralMoments class.
Public methodCentralMoments(RawMoments)
Initializes a new instance of the CentralMoments class.
Public methodCentralMoments(Bitmap, Int32)
Initializes a new instance of the CentralMoments class.
Public methodCentralMoments(Single, Int32)
Initializes a new instance of the CentralMoments class.
Public methodCentralMoments(Bitmap, Rectangle, Int32)
Initializes a new instance of the CentralMoments class.
Public methodCentralMoments(Single, Rectangle, Int32)
Initializes a new instance of the CentralMoments class.
Public methodCentralMoments(UnmanagedImage, Rectangle, Int32)
Initializes a new instance of the CentralMoments class.
Top
Properties
  NameDescription
Public propertyMu00
Central moment of order (0,0).
Public propertyMu01
Central moment of order (0,1).
Public propertyMu02
Central moment of order (0,2).
Public propertyMu03
Central moment of order (0,3).
Public propertyMu10
Central moment of order (1,0).
Public propertyMu11
Central moment of order (1,1).
Public propertyMu12
Central moment of order (1,2).
Public propertyMu20
Central moment of order (2,0).
Public propertyMu21
Central moment of order (2,1).
Public propertyMu30
Central moment of order (3,0).
Public propertyOrder
Gets or sets the maximum order of the moments.
(Inherited from MomentsBase.)
Top
Methods
  NameDescription
Public methodCompute(Bitmap)
Computes the moments for the specified image.
(Inherited from MomentsBase.)
Public methodCompute(BitmapData)
Computes the moments for the specified image.
(Inherited from MomentsBase.)
Public methodCompute(RawMoments)
Computes the center moments from the specified raw moments.
Public methodCompute(UnmanagedImage)
Computes the moments for the specified image.
(Inherited from MomentsBase.)
Public methodCompute(Single, Rectangle)
Computes the center moments for the specified image.
(Overrides MomentsBaseCompute(Single, Rectangle).)
Public methodCompute(Bitmap, Rectangle)
Computes the moments for the specified image.
(Inherited from MomentsBase.)
Public methodCompute(BitmapData, Rectangle)
Computes the moments for the specified image.
(Inherited from MomentsBase.)
Public methodCompute(UnmanagedImage, Rectangle)
Computes the center moments for the specified image.
(Overrides MomentsBaseCompute(UnmanagedImage, Rectangle).)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetOrientation
Gets the orientation of the ellipse containing the image.
Public methodGetSize
Gets the size of the ellipse containing the image.
Public methodGetSizeAndOrientation
Gets both size and orientation of the ellipse containing the image.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Fields
  NameDescription
Public fieldStatic memberDefaultOrder
Gets the default maximum moment order.
Top
Extension Methods
  NameDescription
Public Extension MethodHasMethod
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.)
Public Extension MethodIsEqual
Compares two objects for equality, performing an elementwise comparison if the elements are vectors or matrices.
(Defined by Matrix.)
Public Extension MethodTo(Type)Overloaded.
Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.)
Public Extension MethodToTOverloaded.
Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.)
Top
Remarks

In image processing, computer vision and related fields, an image moment is a certain particular weighted average (moment) of the image pixels' intensities, or a function of such moments, usually chosen to have some attractive property or interpretation.

Image moments are useful to describe objects after segmentation. Simple properties of the image which are found via image moments include area (or total intensity), its centroid, and information about its orientation.

The central moments can be used to find the location, center of mass and the dimensions of a given object within an image.

References:

  • Wikipedia contributors. "Image moment." Wikipedia, The Free Encyclopedia. Wikipedia, The Free Encyclopedia. Available at http://en.wikipedia.org/wiki/Image_moment

Examples
Bitmap image = ...;

// Compute the center moments of up to third order
CentralMoments cm = new CentralMoments(image, order: 3);

// Get size and orientation of the image
SizeF size = target.GetSize();
float angle = target.GetOrientation();
See Also