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 unsafe in a general case as it leads to having non-exclusive mutable access to the internal data,
but it can be useful for some performance sensitive operations. One example of an OpenCV function that allows such in-place
modification is imgproc::threshold
. Read more