xfeatures2d_BOWImgDescriptorExtractor
import { xfeatures2d_BOWImgDescriptorExtractor } 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.
Class to compute an image descriptor using the bag of visual words.
Such a computation consists of the following steps:
- Compute descriptors for a given image and its keypoints set.
- Find the nearest visual words from the vocabulary for each keypoint descriptor.
- Compute the bag-of-words image descriptor as is a normalized histogram of vocabulary words encountered in the image. The i-th bin of the histogram is a frequency of i-th word of the vocabulary in the given image.
Constructors and members
static new
The constructor.
new(dextractor: Feature2D | null, dmatcher: DescriptorMatcher | null): xfeatures2d_BOWImgDescriptorExtractor;dextractorDescriptor extractor that is used to compute descriptors for an input image and its keypoints.
dmatcherDescriptor matcher that is used to find the nearest word of the trained vocabulary for each keypoint descriptor of the image.
The xfeatures2d_BOWImgDescriptorExtractor 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.
setVocabulary
Sets a visual vocabulary.
setVocabulary(vocabulary: Mat): void;vocabularyVocabulary (can be trained using the inheritor of BOWTrainer ). Each row of the vocabulary is a visual word (cluster center).
getVocabulary
Returns the set vocabulary.
getVocabulary(): Mat;The Mat result. Release returned native handles with using or delete(), including handles nested in results.
compute
compute() is not constant because DescriptorMatcher::match is not constant
compute(image: Mat, keypoints: KeyPointVector, imgDescriptor: Mat): void;imageimage argument (Mat).
keypointskeypoints argument (KeyPointVector).
imgDescriptorOutput destination, filled by the native operation. img descriptor argument (Mat).
descriptorSize
Returns an image descriptor size if the vocabulary is set. Otherwise, it returns 0.
descriptorSize(): number;The number result.
descriptorType
Returns an image descriptor type.
descriptorType(): number;The number result.
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.