Table of Contents

Class DescriptorMatcher

Namespace
Emgu.CV.Cuda
Assembly
Emgu.CV.dll

Descriptor matcher

public abstract class DescriptorMatcher : SharedPtrObject, IDisposable, IAlgorithm
Inheritance
DescriptorMatcher
Implements
Derived
Inherited Members
Extension Methods

Constructors

DescriptorMatcher()

protected DescriptorMatcher()

Fields

_algorithmPtr

Pointer to the native cv::Algorithm

protected nint _algorithmPtr

Field Value

nint

Properties

Empty

Return True if the matcher is empty

public bool Empty { get; }

Property Value

bool

IsMaskSupported

Return True if mask is supported

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

Clear the matcher

public void Clear()

DisposeObject()

Release all the unmanaged memory associated with this matcher

protected override void DisposeObject()

KnnMatch(IInputArray, IInputArray, VectorOfVectorOfDMatch, int, IInputArray, bool)

Find the k-nearest match

public void KnnMatch(IInputArray queryDescriptors, IInputArray trainDescriptors, VectorOfVectorOfDMatch matches, int k, IInputArray mask = null, bool compactResult = false)

Parameters

queryDescriptors IInputArray

An n x m matrix of descriptors to be query for nearest neighbors. n is the number of descriptor and m is the size of the descriptor

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

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.

KnnMatch(IInputArray, VectorOfVectorOfDMatch, int, VectorOfGpuMat, bool)

Find the k-nearest match

public void KnnMatch(IInputArray queryDescriptors, VectorOfVectorOfDMatch matches, int k, VectorOfGpuMat masks = null, bool compactResult = false)

Parameters

queryDescriptors IInputArray

An n x m matrix of descriptors to be query for nearest neighbors. 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

masks VectorOfGpuMat

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.

KnnMatchAsync(IInputArray, IInputArray, IOutputArray, int, IInputArray, Stream)

Finds the k best matches for each descriptor from a query set (asynchronous version).

public void KnnMatchAsync(IInputArray queryDescriptors, IInputArray trainDescriptors, IOutputArray matches, int k, IInputArray mask = null, Stream stream = 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 IOutputArray

Matches array stored in GPU memory. Internal representation is not defined. Use DescriptorMatcher::knnMatchConvert method to retrieve results in standard representation.

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.

stream Stream

CUDA stream.

KnnMatchAsync(IInputArray, IOutputArray, int, VectorOfGpuMat, Stream)

Finds the k best matches for each descriptor from a query set (asynchronous version).

public void KnnMatchAsync(IInputArray queryDescriptors, IOutputArray matches, int k, VectorOfGpuMat masks = null, Stream stream = null)

Parameters

queryDescriptors IInputArray

Query set of descriptors.

matches IOutputArray

Matches array stored in GPU memory. Internal representation is not defined. Use DescriptorMatcher::knnMatchConvert method to retrieve results in standard representation.

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.

masks VectorOfGpuMat

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

stream Stream

CUDA stream.

KnnMatchConvert(IInputArray, VectorOfVectorOfDMatch, bool)

Converts matches array from internal representation to standard matches vector.

public void KnnMatchConvert(IInputArray gpuMatches, VectorOfVectorOfDMatch matches, bool compactResult = false)

Parameters

gpuMatches IInputArray

Matches

matches VectorOfVectorOfDMatch

Vector of DMatch objects.

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 (blocking version).

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

Matches. 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, VectorOfGpuMat)

Finds the best match for each descriptor from a query set (blocking version).

public void Match(IInputArray queryDescriptors, VectorOfDMatch matches, VectorOfGpuMat mask = null)

Parameters

queryDescriptors IInputArray

Query set of descriptors.

matches VectorOfDMatch

Matches. 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 VectorOfGpuMat

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

MatchAsync(IInputArray, IInputArray, IOutputArray, IInputArray, Stream)

Finds the best match for each descriptor from a query set (asynchronous version).

public void MatchAsync(IInputArray queryDescriptors, IInputArray trainDescriptors, IOutputArray matches, IInputArray mask = null, Stream stream = 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 IOutputArray

Matches array stored in GPU memory. Internal representation is not defined. Use DescriptorMatcher::matchConvert method to retrieve results in standard representation.

mask IInputArray

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

stream Stream

CUDA stream.

MatchAsync(IInputArray, IOutputArray, VectorOfGpuMat, Stream)

Finds the best match for each descriptor from a query set (asynchronous version).

public void MatchAsync(IInputArray queryDescriptors, IOutputArray matches, VectorOfGpuMat masks = null, Stream stream = null)

Parameters

queryDescriptors IInputArray

Query set of descriptors.

matches IOutputArray

Matches array stored in GPU memory. Internal representation is not defined. Use DescriptorMatcher::matchConvert method to retrieve results in standard representation.

masks VectorOfGpuMat

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

stream Stream

CUDA stream.

MatchConvert(IInputArray, VectorOfDMatch)

Converts matches array from internal representation to standard matches vector.

public void MatchConvert(IInputArray gpuMatches, VectorOfDMatch matches)

Parameters

gpuMatches IInputArray

Matches, returned from MatchAsync.

matches VectorOfDMatch

Vector of DMatch objects.

RadiusMatch(IInputArray, IInputArray, VectorOfVectorOfDMatch, float, IInputArray, bool)

For each query descriptor, finds the training descriptors not farther than the specified distance (blocking version).

public void RadiusMatch(IInputArray queryDescriptors, IInputArray trainDescriptors, VectorOfVectorOfDMatch matches, float maxDistance, 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

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 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.

RadiusMatch(IInputArray, VectorOfVectorOfDMatch, float, VectorOfGpuMat, bool)

For each query descriptor, finds the training descriptors not farther than the specified distance (blocking version).

public void RadiusMatch(IInputArray queryDescriptors, VectorOfVectorOfDMatch matches, float maxDistance, VectorOfGpuMat 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 VectorOfGpuMat

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.

RadiusMatchAsync(IInputArray, IInputArray, IOutputArray, float, IInputArray, Stream)

For each query descriptor, finds the training descriptors not farther than the specified distance (asynchronous version).

public void RadiusMatchAsync(IInputArray queryDescriptors, IInputArray trainDescriptors, IOutputArray matches, float maxDistance, IInputArray mask = null, Stream stream = 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 IOutputArray

Matches array stored in GPU memory. Internal representation is not defined.

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 IInputArray

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

stream Stream

CUDA stream.

RadiusMatchAsync(IInputArray, IOutputArray, float, VectorOfGpuMat, Stream)

For each query descriptor, finds the training descriptors not farther than the specified distance (asynchronous version).

public void RadiusMatchAsync(IInputArray queryDescriptors, IOutputArray matches, float maxDistance, VectorOfGpuMat masks, Stream stream)

Parameters

queryDescriptors IInputArray

Query set of descriptors.

matches IOutputArray

Matches array stored in GPU memory. Internal representation is not defined.

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 VectorOfGpuMat

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

stream Stream

CUDA stream.

RadiusMatchConvert(IInputArray, VectorOfVectorOfDMatch, bool)

Converts matches array from internal representation to standard matches vector.

public void RadiusMatchConvert(IInputArray gpuMatches, VectorOfVectorOfDMatch matches, bool compactResult)

Parameters

gpuMatches IInputArray

Matches, returned from DescriptorMatcher.RadiusMatchAsync.

matches VectorOfVectorOfDMatch

Vector of DMatch objects.

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.

public void Train()