Skip to content

xfeatures2d_BOWKMeansTrainer

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

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

ARGUMENTSConstructor or factory
CLASSxfeatures2d_BOWKMeansTrainer
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. Inherits xfeatures2d_BOWTrainer.

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

Constructors and members

static new

The constructor.

See: cv::kmeans
new(clusterCount: number, termcrit: TermCriteria, attempts: number, flags: number): xfeatures2d_BOWKMeansTrainer;
4 available overloads
new(clusterCount: number): xfeatures2d_BOWKMeansTrainer;
new(clusterCount: number, termcrit: TermCriteria): xfeatures2d_BOWKMeansTrainer;
new(clusterCount: number, termcrit: TermCriteria, attempts: number): xfeatures2d_BOWKMeansTrainer;
new(clusterCount: number, termcrit: TermCriteria, attempts: number, flags: number): xfeatures2d_BOWKMeansTrainer;
clusterCount

cluster count argument (number).

termcrit

termcrit argument (TermCriteria).

attempts

attempts argument (number).

flags

flags argument (number).

Returns

The xfeatures2d_BOWKMeansTrainer result.

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.

cluster

Returns trained vocabulary (i.e. cluster centers).

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.