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_def() -> Result<LDA>
pub fn new_def() -> Result<LDA>
constructor Initializes a LDA with num_components (default 0).
§Note
This alternative version of [new] function uses the following default values for its arguments:
- num_components: 0
sourcepub fn new_with_data(
src: &impl ToInputArray,
labels: &impl ToInputArray,
num_components: i32
) -> Result<LDA>
pub fn new_with_data( src: &impl ToInputArray, labels: &impl 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
sourcepub fn new_with_data_def(
src: &impl ToInputArray,
labels: &impl ToInputArray
) -> Result<LDA>
pub fn new_with_data_def( src: &impl ToInputArray, labels: &impl ToInputArray ) -> 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.
§Note
This alternative version of [new_with_data] function uses the following default values for its arguments:
- num_components: 0
pub fn subspace_project( w: &impl ToInputArray, mean: &impl ToInputArray, src: &impl ToInputArray ) -> Result<Mat>
pub fn subspace_reconstruct( w: &impl ToInputArray, mean: &impl ToInputArray, src: &impl ToInputArray ) -> Result<Mat>
Trait Implementations§
source§impl Boxed for LDA
impl Boxed for LDA
source§unsafe fn from_raw(ptr: <LDA as OpenCVFromExtern>::ExternReceive) -> Self
unsafe fn from_raw(ptr: <LDA as OpenCVFromExtern>::ExternReceive) -> Self
source§fn into_raw(self) -> <LDA as OpenCVTypeExternContainer>::ExternSendMut
fn into_raw(self) -> <LDA as OpenCVTypeExternContainer>::ExternSendMut
source§fn as_raw(&self) -> <LDA as OpenCVTypeExternContainer>::ExternSend
fn as_raw(&self) -> <LDA as OpenCVTypeExternContainer>::ExternSend
source§fn as_raw_mut(&mut self) -> <LDA as OpenCVTypeExternContainer>::ExternSendMut
fn as_raw_mut(&mut self) -> <LDA as OpenCVTypeExternContainer>::ExternSendMut
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<()>
source§fn load_1(&mut self, node: &impl FileStorageTraitConst) -> Result<()>
fn load_1(&mut self, node: &impl FileStorageTraitConst) -> Result<()>
source§fn compute(
&mut self,
src: &impl ToInputArray,
labels: &impl ToInputArray
) -> Result<()>
fn compute( &mut self, src: &impl ToInputArray, labels: &impl ToInputArray ) -> Result<()>
source§fn project(&mut self, src: &impl ToInputArray) -> Result<Mat>
fn project(&mut self, src: &impl ToInputArray) -> Result<Mat>
source§fn reconstruct(&mut self, src: &impl ToInputArray) -> Result<Mat>
fn reconstruct(&mut self, src: &impl ToInputArray) -> Result<Mat>
source§impl LDATraitConst for LDA
impl LDATraitConst for LDA
fn as_raw_LDA(&self) -> *const c_void
source§fn save_1(&self, fs: &mut impl FileStorageTrait) -> Result<()>
fn save_1(&self, fs: &mut impl FileStorageTrait) -> Result<()>
source§fn eigenvectors(&self) -> Result<Mat>
fn eigenvectors(&self) -> Result<Mat>
source§fn eigenvalues(&self) -> Result<Mat>
fn eigenvalues(&self) -> Result<Mat>
impl Send for LDA
Auto Trait Implementations§
impl Freeze for LDA
impl RefUnwindSafe for LDA
impl !Sync for LDA
impl Unpin for LDA
impl UnwindSafe for LDA
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
source§unsafe fn modify_inplace<Res>(
&mut self,
f: impl FnOnce(&Mat, &mut Mat) -> Res
) -> Res
unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res ) -> Res
Mat
or another similar object. By passing
a mutable reference to the Mat
to this function your closure will get called with the read reference and a write references
to the same Mat
. This is of course unsafe as it breaks the Rust aliasing rules, but it might be useful for some performance
sensitive operations. One example of an OpenCV function that allows such in-place modification is imgproc::threshold
. Read more