BOWKMeansTrainer

Struct BOWKMeansTrainer 

Source
pub struct BOWKMeansTrainer { /* private fields */ }
Expand description

kmeans -based class to train visual vocabulary using the bag of visual words approach. :

Implementations§

Source§

impl BOWKMeansTrainer

Source

pub fn new( cluster_count: i32, termcrit: TermCriteria, attempts: i32, flags: i32, ) -> Result<BOWKMeansTrainer>

The constructor.

§See also

cv::kmeans

§C++ default parameters
  • termcrit: TermCriteria()
  • attempts: 3
  • flags: KMEANS_PP_CENTERS
Source

pub fn new_def(cluster_count: i32) -> Result<BOWKMeansTrainer>

The constructor.

§See also

cv::kmeans

§Note

This alternative version of [new] function uses the following default values for its arguments:

  • termcrit: TermCriteria()
  • attempts: 3
  • flags: KMEANS_PP_CENTERS

Trait Implementations§

Source§

impl BOWKMeansTrainerTrait for BOWKMeansTrainer

Source§

impl BOWKMeansTrainerTraitConst for BOWKMeansTrainer

Source§

impl BOWTrainerTrait for BOWKMeansTrainer

Source§

fn as_raw_mut_BOWTrainer(&mut self) -> *mut c_void

Source§

fn add(&mut self, descriptors: &impl MatTraitConst) -> Result<()>

Adds descriptors to a training set. Read more
Source§

fn clear(&mut self) -> Result<()>

Source§

impl BOWTrainerTraitConst for BOWKMeansTrainer

Source§

fn as_raw_BOWTrainer(&self) -> *const c_void

Source§

fn get_descriptors(&self) -> Result<Vector<Mat>>

Returns a training set of descriptors.
Source§

fn descriptors_count(&self) -> Result<i32>

Returns the count of all descriptors stored in the training set.
Source§

fn cluster(&self) -> Result<Mat>

Clusters train descriptors. Read more
Source§

fn cluster_with_descriptors( &self, descriptors: &impl MatTraitConst, ) -> Result<Mat>

Clusters train descriptors. Read more
Source§

impl Boxed for BOWKMeansTrainer

Source§

unsafe fn from_raw( ptr: <BOWKMeansTrainer as OpenCVFromExtern>::ExternReceive, ) -> Self

Wrap the specified raw pointer Read more
Source§

fn into_raw( self, ) -> <BOWKMeansTrainer as OpenCVTypeExternContainer>::ExternSendMut

Return the underlying raw pointer while consuming this wrapper. Read more
Source§

fn as_raw(&self) -> <BOWKMeansTrainer as OpenCVTypeExternContainer>::ExternSend

Return the underlying raw pointer. Read more
Source§

fn as_raw_mut( &mut self, ) -> <BOWKMeansTrainer as OpenCVTypeExternContainer>::ExternSendMut

Return the underlying mutable raw pointer Read more
Source§

impl Debug for BOWKMeansTrainer

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for BOWKMeansTrainer

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl From<BOWKMeansTrainer> for BOWTrainer

Source§

fn from(s: BOWKMeansTrainer) -> Self

Converts to this type from the input type.
Source§

impl TryFrom<BOWTrainer> for BOWKMeansTrainer

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(s: BOWTrainer) -> Result<Self>

Performs the conversion.
Source§

impl Send for BOWKMeansTrainer

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<Mat> ModifyInplace for Mat
where Mat: Boxed,

Source§

unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res, ) -> Res

Helper function to call OpenCV functions that allow in-place modification of a 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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.