xfeatures2d_BOWTrainer
import { xfeatures2d_BOWTrainer } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Native object: release it with using or delete(). Factories can return null; check before calling methods.
Bag of visual words *
***************************************************************************************
Abstract base class for training the bag of visual words vocabulary from a set of descriptors.
For details, see, for example, Visual Categorization with Bags of Keypoints by Gabriella Csurka, Christopher R. Dance, Lixin Fan, Jutta Willamowski, Cedric Bray, 2004. :
Constructors and members
clone
Create another handle to the same native object. This retains the object without copying its pixels or algorithm state; dispose both handles separately.
clone(): this;The this result.
add
Adds descriptors to a training set.
add(descriptors: Mat): void;descriptorsDescriptors to add to a training set. Each row of the descriptors matrix is a descriptor.
The training set is clustered using clustermethod to construct the vocabulary.
getDescriptors
Returns a training set of descriptors.
getDescriptors(): MatVector;The MatVector result. Release returned native handles with using or delete(), including handles nested in results.
descriptorsCount
Returns the count of all descriptors stored in the training set.
descriptorsCount(): number;The number result.
clear
xfeatures2d_BOWTrainer.clear native operation from cv::xfeatures2d::BOWTrainer::clear.
clear(): void;cluster
Clusters train descriptors.
cluster(): Mat;The Mat result. Release returned native handles with using or delete(), including handles nested in results.
cluster1
Clusters train descriptors.
cluster1(descriptors: Mat): Mat;descriptorsDescriptors to cluster. Each row of the descriptors matrix is a descriptor. Descriptors are not added to the inner train descriptor set.
The vocabulary consists of cluster centers. So, this method returns the vocabulary. In the first variant of the method, train descriptors stored in the object are clustered. In the second variant, input descriptors are clustered.
The Mat result. Release returned native handles with using or delete(), including handles nested in results.
These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.