Table of Contents

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

nint

Properties

Empty

Returns true if there are no train descriptors in the both collections.

public bool Empty { get; }

Property Value

bool

IsMaskSupported

Returns true if the descriptor matcher supports masking permissible matches.

public bool IsMaskSupported { get; }

Property Value

bool

Methods

Add(IInputArray)

Add the model descriptors

public void Add(IInputArray modelDescriptors)

Parameters

modelDescriptors IInputArray

The 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 IInputArray

Query set of descriptors.

trainDescriptors IInputArray

Train set of descriptors. This set is not added to the train descriptors collection stored in the class object.

matches VectorOfVectorOfDMatch

Matches. Each matches[i] is k or less matches for the same query descriptor.

k int

Count of best matches found per each query descriptor or less if a query descriptor has less than k possible matches in total.

mask IInputArray

Mask specifying permissible matches between an input query and train matrices of descriptors.

compactResult bool

Parameter 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 IInputArray

An 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 VectorOfVectorOfDMatch

Matches. Each matches[i] is k or less matches for the same query descriptor.

k int

Number of nearest neighbors to search for

mask IInputArray

Can be null if not needed. An n x 1 matrix. If 0, the query descriptor in the corresponding row will be ignored.

compactResult bool

Parameter 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 IInputArray

Query set of descriptors.

trainDescriptors IInputArray

Train set of descriptors. This set is not added to the train descriptors collection stored in the class object.

matches VectorOfDMatch

If 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 IInputArray

Mask 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 IInputArray

Query set of descriptors.

matches VectorOfDMatch

If 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 IInputArrayOfArrays

Mask 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 IInputArray

Query set of descriptors.

trainDescriptors IInputArray

Train set of descriptors. This set is not added to the train descriptors collection stored in the class object.

matches VectorOfVectorOfDMatch

Found matches.

maxDistance float

Threshold 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 IInputArrayOfArrays

Mask specifying permissible matches between an input query and train matrices of descriptors.

compactResult bool

Parameter 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 IInputArray

Query set of descriptors.

matches VectorOfVectorOfDMatch

Found matches.

maxDistance float

Threshold 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 IInputArray

Mask specifying permissible matches between an input query and train matrices of descriptors.

compactResult bool

Parameter 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()