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
dmatcherDescriptorMatcherDescriptor 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
dextractorFeature2DDescriptor extractor that is used to compute descriptors for an input image and its keypoints.
dmatcherDescriptorMatcherDescriptor 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
imageInputArrayImage, for which the descriptor is computed.
keypointsKeyPoint[]Keypoints detected in the input image.
imgDescriptorOutputArrayComputed output image descriptor.
pointIdxsOfClustersint[][]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.
descriptorsMatDescriptors 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
keypointDescriptorsInputArrayComputed descriptors to match with vocabulary.
imgDescriptorOutputArrayComputed output image descriptor.
pointIdxsOfClustersint[][]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
imageMatImage, for which the descriptor is computed.
keypointsKeyPoint[]Keypoints detected in the input image.
imgDescriptorMatComputed output image descriptor.
DescriptorSize()
Returns an image descriptor size if the vocabulary is set. Otherwise, it returns 0.
public int DescriptorSize()
Returns
DescriptorType()
Returns an image descriptor type.
public int DescriptorType()
Returns
DisposeUnmanaged()
Releases unmanaged resources
protected override void DisposeUnmanaged()
GetVocabulary()
Returns the set vocabulary.
public Mat GetVocabulary()
Returns
SetVocabulary(Mat)
Sets a visual vocabulary.
public void SetVocabulary(Mat vocabulary)
Parameters
vocabularyMatVocabulary (can be trained using the inheritor of BOWTrainer ). Each row of the vocabulary is a visual word(cluster center).