CVB.Net 14.0
ImageMoments Class Reference

State object for calculating various image moments. More...

Inherits INativeHandle.

Public Member Functions

void Dispose ()
 Dispose method that releases the classifier
 
double CalculateSpatialMoment (MomentsOrder xOrder, MomentsOrder yOrder, Point2D offset, MomentsNormalization normalization)
 Get one of the spatial image moments. More...
 
double CalculateGetSpatialMoment (MomentsOrder xOrder, MomentsOrder yOrder, MomentsNormalization normalization)
 Get one of the spatial image moments. More...
 
double CalculateCentralMoment (MomentsOrder xOrder, MomentsOrder yOrder, MomentsNormalization normalization)
 Get one of the central image moments. More...
 
HuMoments CaltulateHuMoments ()
 Get the seven Hu moments of the image. More...
 

Static Public Member Functions

static ImageMoments Calculate (ImagePlane imgPlane, Rect aoi, MomentsCalculation preference)
 Calculate the moments on the input imgPlane and aoi (area of interest). More...
 
static ImageMoments Calculate (ImagePlane imgPlane, Rect aoi)
 Calculate the moments on the input imgPlane and aoi favoring neither speed nor accuracy. More...
 
static ImageMoments Calculate (ImagePlane imgPlane, MomentsCalculation preference)
 Calculate the moments on the input imgPlane . More...
 
static ImageMoments Calculate (ImagePlane imgPlane)
 Calculate the moments on the input imgPlane favoring neither speed nor accuracy. More...
 

Protected Member Functions

virtual void Dispose (bool disposing)
 IDispose helper function. More...
 

Properties

IntPtr Handle [get]
 Native non linear transformation handle. More...
 
bool IsDisposed [get]
 Tests if the native handle has already been disposed.
 
MomentsCalculation CalculationPreference [get]
 The preference of speed versus accuracy chosen when this object was created.
 
- Properties inherited from INativeHandle
IntPtr Handle [get]
 The native handle of the object.
 
bool IsDisposed [get]
 Possibility to check whether the object has already been disposed of.
 

Events

NativeHandleEventDelegate ObjectDisposing
 Raised when this object is about to be disposed via the IDisposable.Dispose method. More...
 
- Events inherited from INativeHandle
NativeHandleEventDelegate ObjectDisposing
 Raised when this object is about to be disposed via the IDisposable.Dispose method.
More...
 

Detailed Description

State object for calculating various image moments.

Member Function Documentation

◆ Calculate() [1/4]

static ImageMoments Calculate ( ImagePlane  imgPlane)
static

Calculate the moments on the input imgPlane favoring neither speed nor accuracy.

Parameters
imgPlanePlane to calculate the moments on
Returns
Moments object.

◆ Calculate() [2/4]

static ImageMoments Calculate ( ImagePlane  imgPlane,
MomentsCalculation  preference 
)
static

Calculate the moments on the input imgPlane .

Parameters
imgPlanePlane to calculate the moments on
preferenceSpeed or accuracy.
Returns
Moments object.

◆ Calculate() [3/4]

static ImageMoments Calculate ( ImagePlane  imgPlane,
Rect  aoi 
)
static

Calculate the moments on the input imgPlane and aoi favoring neither speed nor accuracy.

Parameters
imgPlanePlane to calculate the moments on.
aoiArea of interest to calculate the moments in.
Returns
Moments object.

◆ Calculate() [4/4]

static ImageMoments Calculate ( ImagePlane  imgPlane,
Rect  aoi,
MomentsCalculation  preference 
)
static

Calculate the moments on the input imgPlane and aoi (area of interest).

Parameters
imgPlanePlane to calculate the moments.
aoiArea of interest to calculate the moments in.
preferenceSpeed or accuracy.
Returns
Moments object.

◆ CalculateCentralMoment()

double CalculateCentralMoment ( MomentsOrder  xOrder,
MomentsOrder  yOrder,
MomentsNormalization  normalization 
)

Get one of the central image moments.

Parameters
xOrderX order of the moment to retrieve
yOrderY order of the moment to retrieve
normalizationWhether or not to normalize.
Returns
The central moment.

◆ CalculateGetSpatialMoment()

double CalculateGetSpatialMoment ( MomentsOrder  xOrder,
MomentsOrder  yOrder,
MomentsNormalization  normalization 
)

Get one of the spatial image moments.

This overload automatically uses the offset used in creating this object.

Parameters
xOrderX order of the moment to retrieve
yOrderY order of the moment to retrieve
normalizationWhether or not to normalize.
Returns
The spatial moment.

◆ CalculateSpatialMoment()

double CalculateSpatialMoment ( MomentsOrder  xOrder,
MomentsOrder  yOrder,
Point2D  offset,
MomentsNormalization  normalization 
)

Get one of the spatial image moments.

Parameters
xOrderX order of the moment to retrieve
yOrderY order of the moment to retrieve
offsetOffset of the moments.
normalizationWhether or not to normalize.
Returns
The spatial moment.

◆ CaltulateHuMoments()

HuMoments CaltulateHuMoments ( )

Get the seven Hu moments of the image.

Returns
Hu moments.

◆ Dispose()

virtual void Dispose ( bool  disposing)
protectedvirtual

IDispose helper function.

Parameters
disposingtrue when called via IDisposable.Dispose, false when called by the finalizer.

Property Documentation

◆ Handle

IntPtr Handle
get

Native non linear transformation handle.

It is normally not necessary to work with this handle in CVB.Net. Note that using this handle in connection with the legacy CVB managed wrappers may actually be disruptive to your application.

Implements INativeHandle.

Event Documentation

◆ ObjectDisposing

NativeHandleEventDelegate ObjectDisposing

Raised when this object is about to be disposed via the IDisposable.Dispose method.

This event is raised right before this object is disposed. The dispose itself cannot be canceled.