xfeatures2d_BOWKMeansTrainer
import { xfeatures2d_BOWKMeansTrainer } 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. 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;clusterCountcluster count argument (number).
termcrittermcrit argument (TermCriteria).
attemptsattempts argument (number).
flagsflags argument (number).
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;The this result.
cluster
Returns trained vocabulary (i.e. cluster centers).
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.