Class DescriptorMatcher
- Namespace
- Emgu.CV.Features2D
- Assembly
- Emgu.CV.dll
Descriptor matcher
public abstract class DescriptorMatcher : UnmanagedObject, IDisposable, IAlgorithm
- Inheritance
-
DescriptorMatcher
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
DescriptorMatcher()
protected DescriptorMatcher()
Fields
_descriptorMatcherPtr
The pointer to the Descriptor matcher
protected nint _descriptorMatcherPtr
Field Value
Properties
Empty
Returns true if there are no train descriptors in the both collections.
public bool Empty { get; }
Property Value
IsMaskSupported
Returns true if the descriptor matcher supports masking permissible matches.
public bool IsMaskSupported { get; }
Property Value
Methods
Add(IInputArray)
Add the model descriptors
public void Add(IInputArray modelDescriptors)
Parameters
modelDescriptors
IInputArrayThe model descriptors
Clear()
Clears the train descriptor collections.
public void Clear()
DisposeObject()
Reset the native pointer upon object disposal
protected override void DisposeObject()
KnnMatch(IInputArray, IInputArray, VectorOfVectorOfDMatch, int, IInputArray, bool)
Finds the k best matches for each descriptor from a query set.
public void KnnMatch(IInputArray queryDescriptors, IInputArray trainDescriptors, VectorOfVectorOfDMatch matches, int k, IInputArray mask = null, bool compactResult = false)
Parameters
queryDescriptors
IInputArrayQuery set of descriptors.
trainDescriptors
IInputArrayTrain set of descriptors. This set is not added to the train descriptors collection stored in the class object.
matches
VectorOfVectorOfDMatchMatches. Each matches[i] is k or less matches for the same query descriptor.
k
intCount of best matches found per each query descriptor or less if a query descriptor has less than k possible matches in total.
mask
IInputArrayMask specifying permissible matches between an input query and train matrices of descriptors.
compactResult
boolParameter used when the mask (or masks) is not empty. If compactResult is false, the matches vector has the same size as queryDescriptors rows. If compactResult is true, the matches vector does not contain matches for fully masked-out query descriptors.
KnnMatch(IInputArray, VectorOfVectorOfDMatch, int, IInputArray, bool)
Find the k-nearest match
public void KnnMatch(IInputArray queryDescriptor, VectorOfVectorOfDMatch matches, int k, IInputArray mask = null, bool compactResult = false)
Parameters
queryDescriptor
IInputArrayAn n x m matrix of descriptors to be query for nearest neighbours. n is the number of descriptor and m is the size of the descriptor
matches
VectorOfVectorOfDMatchMatches. Each matches[i] is k or less matches for the same query descriptor.
k
intNumber of nearest neighbors to search for
mask
IInputArrayCan be null if not needed. An n x 1 matrix. If 0, the query descriptor in the corresponding row will be ignored.
compactResult
boolParameter used when the mask (or masks) is not empty. If compactResult is false, the matches vector has the same size as queryDescriptors rows.If compactResult is true, the matches vector does not contain matches for fully masked-out query descriptors.
Match(IInputArray, IInputArray, VectorOfDMatch, IInputArray)
Finds the best match for each descriptor from a query set.
public void Match(IInputArray queryDescriptors, IInputArray trainDescriptors, VectorOfDMatch matches, IInputArray mask = null)
Parameters
queryDescriptors
IInputArrayQuery set of descriptors.
trainDescriptors
IInputArrayTrain set of descriptors. This set is not added to the train descriptors collection stored in the class object.
matches
VectorOfDMatchIf a query descriptor is masked out in mask , no match is added for this descriptor. So, matches size may be smaller than the query descriptors count.
mask
IInputArrayMask specifying permissible matches between an input query and train matrices of descriptors.
Match(IInputArray, VectorOfDMatch, IInputArrayOfArrays)
Finds the best match for each descriptor from a query set. Train descriptors collection that was set by the Add function is used.
public void Match(IInputArray queryDescriptors, VectorOfDMatch matches, IInputArrayOfArrays masks = null)
Parameters
queryDescriptors
IInputArrayQuery set of descriptors.
matches
VectorOfDMatchIf a query descriptor is masked out in mask , no match is added for this descriptor. So, matches size may be smaller than the query descriptors count.
masks
IInputArrayOfArraysMask specifying permissible matches between an input query and train matrices of descriptors.
RadiusMatch(IInputArray, IInputArray, VectorOfVectorOfDMatch, float, IInputArrayOfArrays, bool)
For each query descriptor, finds the training descriptors not farther than the specified distance.
public void RadiusMatch(IInputArray queryDescriptors, IInputArray trainDescriptors, VectorOfVectorOfDMatch matches, float maxDistance, IInputArrayOfArrays mask = null, bool compactResult = false)
Parameters
queryDescriptors
IInputArrayQuery set of descriptors.
trainDescriptors
IInputArrayTrain set of descriptors. This set is not added to the train descriptors collection stored in the class object.
matches
VectorOfVectorOfDMatchFound matches.
maxDistance
floatThreshold for the distance between matched descriptors. Distance means here metric distance (e.g. Hamming distance), not the distance between coordinates (which is measured in Pixels)!
mask
IInputArrayOfArraysMask specifying permissible matches between an input query and train matrices of descriptors.
compactResult
boolParameter used when the mask (or masks) is not empty. If compactResult is false, the matches vector has the same size as queryDescriptors rows. If compactResult is true, the matches vector does not contain matches for fully masked-out query descriptors.
RadiusMatch(IInputArray, VectorOfVectorOfDMatch, float, IInputArray, bool)
For each query descriptor, finds the training descriptors not farther than the specified distance.
public void RadiusMatch(IInputArray queryDescriptors, VectorOfVectorOfDMatch matches, float maxDistance, IInputArray masks = null, bool compactResult = false)
Parameters
queryDescriptors
IInputArrayQuery set of descriptors.
matches
VectorOfVectorOfDMatchFound matches.
maxDistance
floatThreshold for the distance between matched descriptors. Distance means here metric distance (e.g. Hamming distance), not the distance between coordinates (which is measured in Pixels)!
masks
IInputArrayMask specifying permissible matches between an input query and train matrices of descriptors.
compactResult
boolParameter used when the mask (or masks) is not empty. If compactResult is false, the matches vector has the same size as queryDescriptors rows. If compactResult is true, the matches vector does not contain matches for fully masked-out query descriptors.
Train()
Trains a descriptor matcher (for example, the flann index). In all methods to match, the method train() is run every time before matching.Some descriptor matchers(for example, BruteForceMatcher) have an empty implementation of this method.Other matchers really train their inner structures (for example, FlannBasedMatcher trains flann::Index ).
public void Train()