Class BOWImgDescriptorExtractor
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.
Implements
Inherited Members
Namespace: OpenCvSharp
Assembly: OpenCvSharp.dll
Syntax
public class BOWImgDescriptorExtractor : DisposableCvObject, ICvPtrHolder
Constructors
| Improve this Doc View SourceBOWImgDescriptorExtractor(DescriptorMatcher)
The constructor.
Declaration
public BOWImgDescriptorExtractor(DescriptorMatcher dmatcher)
Parameters
Type | Name | Description |
---|---|---|
DescriptorMatcher | dmatcher | 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.
Declaration
public BOWImgDescriptorExtractor(Feature2D dextractor, DescriptorMatcher dmatcher)
Parameters
Type | Name | Description |
---|---|---|
Feature2D | dextractor | Descriptor extractor that is used to compute descriptors for an input image and its keypoints. |
DescriptorMatcher | dmatcher | Descriptor matcher that is used to find the nearest word of the trained vocabulary for each keypoint descriptor of the image. |
Methods
| Improve this Doc View SourceCompute(InputArray, ref KeyPoint[], OutputArray, out Int32[][], Mat)
Computes an image descriptor using the set visual vocabulary.
Declaration
public void Compute(InputArray image, ref KeyPoint[] keypoints, OutputArray imgDescriptor, out int[][] pointIdxsOfClusters, Mat descriptors = null)
Parameters
Type | Name | Description |
---|---|---|
InputArray | image | Image, for which the descriptor is computed. |
OpenCvSharp.KeyPoint[] | keypoints | Keypoints detected in the input image. |
OutputArray | imgDescriptor | Computed output image descriptor. |
System.Int32[][] | pointIdxsOfClusters | 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. |
Mat | descriptors | Descriptors of the image keypoints that are returned if they are non-zero. |
Compute(InputArray, OutputArray, out Int32[][])
Computes an image descriptor using the set visual vocabulary.
Declaration
public void Compute(InputArray keypointDescriptors, OutputArray imgDescriptor, out int[][] pointIdxsOfClusters)
Parameters
Type | Name | Description |
---|---|---|
InputArray | keypointDescriptors | Computed descriptors to match with vocabulary. |
OutputArray | imgDescriptor | Computed output image descriptor. |
System.Int32[][] | 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. |
Compute2(Mat, ref KeyPoint[], Mat)
Computes an image descriptor using the set visual vocabulary.
Declaration
public void Compute2(Mat image, ref KeyPoint[] keypoints, Mat imgDescriptor)
Parameters
Type | Name | Description |
---|---|---|
Mat | image | Image, for which the descriptor is computed. |
OpenCvSharp.KeyPoint[] | keypoints | Keypoints detected in the input image. |
Mat | imgDescriptor | Computed output image descriptor. |
DescriptorSize()
Returns an image descriptor size if the vocabulary is set. Otherwise, it returns 0.
Declaration
public int DescriptorSize()
Returns
Type | Description |
---|---|
System.Int32 |
DescriptorType()
Returns an image descriptor type.
Declaration
public int DescriptorType()
Returns
Type | Description |
---|---|
System.Int32 |
DisposeUnmanaged()
Releases unmanaged resources
Declaration
protected override void DisposeUnmanaged()
Overrides
| Improve this Doc View SourceGetVocabulary()
Returns the set vocabulary.
Declaration
public Mat GetVocabulary()
Returns
Type | Description |
---|---|
Mat |
SetVocabulary(Mat)
Sets a visual vocabulary.
Declaration
public void SetVocabulary(Mat vocabulary)
Parameters
Type | Name | Description |
---|---|---|
Mat | vocabulary | Vocabulary (can be trained using the inheritor of BOWTrainer ). Each row of the vocabulary is a visual word(cluster center). |