[−][src]Struct opencv::core::Moments
struct returned by cv::moments
The spatial moments are computed as:
The central moments are computed as:
where is the mass center:
The normalized central moments are computed as:
Note: , , 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
impl Moments
[src]
pub fn default() -> Result<Moments>
[src]
the default constructor
pub fn new(
m00: f64,
m10: f64,
m01: f64,
m20: f64,
m11: f64,
m02: f64,
m30: f64,
m21: f64,
m12: f64,
m03: f64
) -> Result<Moments>
[src]
m00: f64,
m10: f64,
m01: f64,
m20: f64,
m11: f64,
m02: f64,
m30: f64,
m21: f64,
m12: f64,
m03: f64
) -> Result<Moments>
the full constructor
Trait Implementations
impl Clone for Moments
[src]
impl Copy for Moments
[src]
impl Debug for Moments
[src]
impl PartialEq<Moments> for Moments
[src]
impl StructuralPartialEq for Moments
[src]
Auto Trait Implementations
impl RefUnwindSafe for Moments
impl Send for Moments
impl Sync for Moments
impl Unpin for Moments
impl UnwindSafe for Moments
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,