Skip to content

xfeatures2d_BOWTrainer

xfeatures2dclassOpenCV 5.0.0
import { xfeatures2d_BOWTrainer } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSConstructor or factory
CLASSxfeatures2d_BOWTrainer
RETURN TYPEOwned native handle
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

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;
Returns

The this result.

add

Adds descriptors to a training set.

add(descriptors: Mat): void;
descriptors

Descriptors 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;
Returns

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;
Returns

The number result.

clear

xfeatures2d_BOWTrainer.clear native operation from cv::xfeatures2d::BOWTrainer::clear.

clear(): void;

cluster

Clusters train descriptors.

cluster(): Mat;
Returns

The Mat result. Release returned native handles with using or delete(), including handles nested in results.

cluster1

Clusters train descriptors.

cluster1(descriptors: Mat): Mat;
descriptors

Descriptors 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.

Returns

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.