Table of Contents

Class BOWImgDescriptorExtractor

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

Brute-force descriptor matcher. For each descriptor in the first set, this matcher finds the closest descriptor in the second set by trying each one.

public class BOWImgDescriptorExtractor : DisposableCvObject, IDisposable, ICvPtrHolder
Inheritance
BOWImgDescriptorExtractor
Implements
Inherited Members

Constructors

BOWImgDescriptorExtractor(DescriptorMatcher)

The constructor.

public BOWImgDescriptorExtractor(DescriptorMatcher dmatcher)

Parameters

dmatcher DescriptorMatcher

Descriptor matcher that is used to find the nearest word of the trained vocabulary for each keypoint descriptor of the image.

BOWImgDescriptorExtractor(Feature2D, DescriptorMatcher)

The constructor.

public BOWImgDescriptorExtractor(Feature2D dextractor, DescriptorMatcher dmatcher)

Parameters

dextractor Feature2D

Descriptor extractor that is used to compute descriptors for an input image and its keypoints.

dmatcher DescriptorMatcher

Descriptor matcher that is used to find the nearest word of the trained vocabulary for each keypoint descriptor of the image.

Methods

Compute(InputArray, ref KeyPoint[], OutputArray, out int[][], Mat?)

Computes an image descriptor using the set visual vocabulary.

public void Compute(InputArray image, ref KeyPoint[] keypoints, OutputArray imgDescriptor, out int[][] pointIdxsOfClusters, Mat? descriptors = null)

Parameters

image InputArray

Image, for which the descriptor is computed.

keypoints KeyPoint[]

Keypoints detected in the input image.

imgDescriptor OutputArray

Computed output image descriptor.

pointIdxsOfClusters int[][]

pointIdxsOfClusters Indices of keypoints that belong to the cluster. This means that pointIdxsOfClusters[i] are keypoint indices that belong to the i -th cluster(word of vocabulary) returned if it is non-zero.

descriptors Mat

Descriptors of the image keypoints that are returned if they are non-zero.

Compute(InputArray, OutputArray, out int[][])

Computes an image descriptor using the set visual vocabulary.

public void Compute(InputArray keypointDescriptors, OutputArray imgDescriptor, out int[][] pointIdxsOfClusters)

Parameters

keypointDescriptors InputArray

Computed descriptors to match with vocabulary.

imgDescriptor OutputArray

Computed output image descriptor.

pointIdxsOfClusters int[][]

Indices of keypoints that belong to the cluster. This means that pointIdxsOfClusters[i] are keypoint indices that belong to the i -th cluster(word of vocabulary) returned if it is non-zero.

Compute2(Mat, ref KeyPoint[], Mat)

Computes an image descriptor using the set visual vocabulary.

public void Compute2(Mat image, ref KeyPoint[] keypoints, Mat imgDescriptor)

Parameters

image Mat

Image, for which the descriptor is computed.

keypoints KeyPoint[]

Keypoints detected in the input image.

imgDescriptor Mat

Computed output image descriptor.

DescriptorSize()

Returns an image descriptor size if the vocabulary is set. Otherwise, it returns 0.

public int DescriptorSize()

Returns

int

DescriptorType()

Returns an image descriptor type.

public int DescriptorType()

Returns

int

DisposeUnmanaged()

Releases unmanaged resources

protected override void DisposeUnmanaged()

GetVocabulary()

Returns the set vocabulary.

public Mat GetVocabulary()

Returns

Mat

SetVocabulary(Mat)

Sets a visual vocabulary.

public void SetVocabulary(Mat vocabulary)

Parameters

vocabulary Mat

Vocabulary (can be trained using the inheritor of BOWTrainer ). Each row of the vocabulary is a visual word(cluster center).