pub struct LDA { /* private fields */ }
Expand description
Linear Discriminant Analysis @todo document this class
Implementations§
source§impl LDA
impl LDA
sourcepub fn new(num_components: i32) -> Result<LDA>
pub fn new(num_components: i32) -> Result<LDA>
constructor Initializes a LDA with num_components (default 0).
C++ default parameters
- num_components: 0
sourcepub fn new_with_data(
src: &dyn ToInputArray,
labels: &dyn ToInputArray,
num_components: i32
) -> Result<LDA>
pub fn new_with_data(
src: &dyn ToInputArray,
labels: &dyn ToInputArray,
num_components: i32
) -> Result<LDA>
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 subspace_project(
w: &dyn ToInputArray,
mean: &dyn ToInputArray,
src: &dyn ToInputArray
) -> Result<Mat>
pub fn subspace_reconstruct(
w: &dyn ToInputArray,
mean: &dyn ToInputArray,
src: &dyn ToInputArray
) -> Result<Mat>
Trait Implementations§
source§impl Boxed for LDA
impl Boxed for LDA
source§impl LDATrait for LDA
impl LDATrait for LDA
fn as_raw_mut_LDA(&mut self) -> *mut c_void
source§fn load(&mut self, filename: &str) -> Result<()>
fn load(&mut self, filename: &str) -> Result<()>
Deserializes this object from a given filename.
source§fn load_1(&mut self, node: &FileStorage) -> Result<()>
fn load_1(&mut self, node: &FileStorage) -> Result<()>
Deserializes this object from a given cv::FileStorage.
source§fn compute(
&mut self,
src: &dyn ToInputArray,
labels: &dyn ToInputArray
) -> Result<()>
fn compute(
&mut self,
src: &dyn ToInputArray,
labels: &dyn ToInputArray
) -> Result<()>
Compute the discriminants for data in src (row aligned) and labels.
source§fn project(&mut self, src: &dyn ToInputArray) -> Result<Mat>
fn project(&mut self, src: &dyn ToInputArray) -> Result<Mat>
Projects samples into the LDA subspace.
src may be one or more row aligned samples.
source§fn reconstruct(&mut self, src: &dyn ToInputArray) -> Result<Mat>
fn reconstruct(&mut self, src: &dyn ToInputArray) -> Result<Mat>
Reconstructs projections from the LDA subspace.
src may be one or more row aligned projections.
source§impl LDATraitConst for LDA
impl LDATraitConst for LDA
fn as_raw_LDA(&self) -> *const c_void
source§fn save_1(&self, fs: &mut FileStorage) -> Result<()>
fn save_1(&self, fs: &mut FileStorage) -> Result<()>
Serializes this object to a given cv::FileStorage.
source§fn eigenvectors(&self) -> Result<Mat>
fn eigenvectors(&self) -> Result<Mat>
Returns the eigenvectors of this LDA.
source§fn eigenvalues(&self) -> Result<Mat>
fn eigenvalues(&self) -> Result<Mat>
Returns the eigenvalues of this LDA.