[−][src]Struct opencv::core::Moments
struct returned by cv::moments
The spatial moments \texttt{Moments::m}_{ji} are computed as:
The central moments \texttt{Moments::mu}_{ji} are computed as:
where (\bar{x}, \bar{y}) is the mass center:
The normalized central moments \texttt{Moments::nu}_{ij} are computed as:
Note: \texttt{mu}{00}=\texttt{m}{00}, \texttt{nu}{00}=1 \texttt{nu}{10}=\texttt{mu}{10}=\texttt{mu}{01}=\texttt{mu}_{10}=0 , 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: f64m10: f64m01: f64m20: f64m11: f64m02: f64m30: f64m21: f64m12: f64m03: f64mu20: f64mu11: f64mu02: f64mu30: f64mu21: f64mu12: f64mu03: f64nu20: f64nu11: f64nu02: f64nu30: f64nu21: f64nu12: f64nu03: f64Methods
impl Moments[src]
pub fn default() -> Result<Moments>[src]
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>
Trait Implementations
impl Copy for Moments[src]
impl PartialEq<Moments> for Moments[src]
impl Clone for Moments[src]
fn clone(&self) -> Moments[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl Debug for Moments[src]
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &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, 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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,