Struct opencv::core::Moments[][src]

#[repr(C)]
pub struct Moments {
Show 24 fields pub m00: f64, pub m10: f64, pub m01: f64, pub m20: f64, pub m11: f64, pub m02: f64, pub m30: f64, pub m21: f64, pub m12: f64, pub m03: f64, pub mu20: f64, pub mu11: f64, pub mu02: f64, pub mu30: f64, pub mu21: f64, pub mu12: f64, pub mu03: f64, pub nu20: f64, pub nu11: f64, pub nu02: f64, pub nu30: f64, pub nu21: f64, pub nu12: f64, pub nu03: f64,
}
Expand description

struct returned by cv::moments

The spatial moments inline formula are computed as:

block formula

The central moments inline formula are computed as:

block formula

where inline formula is the mass center:

block formula

The normalized central moments inline formula are computed as:

block formula

Note: inline formula, inline formula inline formula , hence the values are not stored.

The moments of a contour are defined in the same way but computed using the Green’s formula (see http://en.wikipedia.org/wiki/Green_theorem). So, due to a limited raster resolution, the moments computed for a contour are slightly different from the moments computed for the same rasterized contour.

Note: Since the contour moments are computed using Green formula, you may get seemingly odd results for contours with self-intersections, e.g. a zero area (m00) for butterfly-shaped contours.

Fields

m00: f64

@name spatial moments

m10: f64

@name spatial moments

m01: f64

@name spatial moments

m20: f64

@name spatial moments

m11: f64

@name spatial moments

m02: f64

@name spatial moments

m30: f64

@name spatial moments

m21: f64

@name spatial moments

m12: f64

@name spatial moments

m03: f64

@name spatial moments

mu20: f64

@name central moments

mu11: f64

@name central moments

mu02: f64

@name central moments

mu30: f64

@name central moments

mu21: f64

@name central moments

mu12: f64

@name central moments

mu03: f64

@name central moments

nu20: f64

@name central normalized moments

nu11: f64

@name central normalized moments

nu02: f64

@name central normalized moments

nu30: f64

@name central normalized moments

nu21: f64

@name central normalized moments

nu12: f64

@name central normalized moments

nu03: f64

@name central normalized moments

Implementations

the default constructor

the full constructor

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.