[][src]Struct opencv::core::LDA

pub struct LDA { /* fields omitted */ }

Linear Discriminant Analysis @todo document this class

Methods

impl LDA[src]

pub fn new(num_components: i32) -> Result<LDA>[src]

constructor Initializes a LDA with num_components (default 0).

C++ default parameters

  • num_components: 0

pub fn new_with_data(
    src: &VectorOfMat,
    labels: &Mat,
    num_components: i32
) -> Result<LDA>
[src]

Initializes and performs a Discriminant Analysis with Fisher's Optimization Criterion on given data in src and corresponding labels in labels. If 0 (or less) number of components are given, they are automatically determined for given data in computation.

C++ default parameters

  • num_components: 0

pub fn save(&self, filename: &str) -> Result<()>[src]

Serializes this object to a given filename.

pub fn load(&mut self, filename: &str) -> Result<()>[src]

Deserializes this object from a given filename.

pub fn compute(&mut self, src: &VectorOfMat, labels: &Mat) -> Result<()>[src]

Compute the discriminants for data in src (row aligned) and labels.

pub fn project(&mut self, src: &Mat) -> Result<Mat>[src]

Projects samples into the LDA subspace. src may be one or more row aligned samples.

pub fn reconstruct(&mut self, src: &Mat) -> Result<Mat>[src]

Reconstructs projections from the LDA subspace. src may be one or more row aligned projections.

pub fn eigenvectors(&self) -> Result<Mat>[src]

Returns the eigenvectors of this LDA.

pub fn eigenvalues(&self) -> Result<Mat>[src]

Returns the eigenvalues of this LDA.

pub fn subspace_project(w: &Mat, mean: &Mat, src: &Mat) -> Result<Mat>[src]

pub fn subspace_reconstruct(w: &Mat, mean: &Mat, src: &Mat) -> Result<Mat>[src]

Trait Implementations

impl Drop for LDA[src]

Auto Trait Implementations

impl !Send for LDA

impl !Sync for LDA

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]