Class DescriptorMatcher
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
public class DescriptorMatcher : Algorithm, IDisposable, ICvPtrHolder
- Inheritance
-
DescriptorMatcher
- Implements
- Derived
- Inherited Members
Constructors
DescriptorMatcher()
protected DescriptorMatcher()
Methods
Add(IEnumerable<Mat>)
Add descriptors to train descriptor collection.
public virtual void Add(IEnumerable<Mat> descriptors)
Parameters
descriptorsIEnumerable<Mat>Descriptors to add. Each descriptors[i] is a descriptors set from one image.
Clear()
Clear train descriptors collection.
public virtual void Clear()
Create(string)
Create descriptor matcher by type name.
public static DescriptorMatcher Create(string descriptorMatcherType)
Parameters
descriptorMatcherTypestring
Returns
DisposeManaged()
Releases managed resources
protected override void DisposeManaged()
Empty()
Return true if there are not train descriptors in collection.
public virtual bool Empty()
Returns
GetTrainDescriptors()
Get train descriptors collection.
public Mat[] GetTrainDescriptors()
Returns
- Mat[]
IsMaskSupported()
Return true if the matcher supports mask in match methods.
public virtual bool IsMaskSupported()
Returns
KnnMatch(Mat, Mat, int, Mat?, bool)
Find k best matches for each query descriptor (in increasing order of distances). compactResult is used when mask is not empty. If compactResult is false matches vector will have the same size as queryDescriptors rows. If compactResult is true matches vector will not contain matches for fully masked out query descriptors.
public DMatch[][] KnnMatch(Mat queryDescriptors, Mat trainDescriptors, int k, Mat? mask = null, bool compactResult = false)
Parameters
Returns
- DMatch[][]
KnnMatch(Mat, int, Mat[]?, bool)
Find k best matches for each query descriptor (in increasing order of distances). compactResult is used when mask is not empty. If compactResult is false matches vector will have the same size as queryDescriptors rows. If compactResult is true matches vector will not contain matches for fully masked out query descriptors.
public DMatch[][] KnnMatch(Mat queryDescriptors, int k, Mat[]? masks = null, bool compactResult = false)
Parameters
Returns
- DMatch[][]
Match(Mat, Mat, Mat?)
Find one best match for each query descriptor (if mask is empty).
public DMatch[] Match(Mat queryDescriptors, Mat trainDescriptors, Mat? mask = null)
Parameters
Returns
- DMatch[]
Match(Mat, Mat[]?)
Find one best match for each query descriptor (if mask is empty).
public DMatch[] Match(Mat queryDescriptors, Mat[]? masks = null)
Parameters
Returns
- DMatch[]
RadiusMatch(Mat, Mat, float, Mat?, bool)
Find best matches for each query descriptor which have distance less than maxDistance (in increasing order of distances).
public DMatch[][] RadiusMatch(Mat queryDescriptors, Mat trainDescriptors, float maxDistance, Mat? mask = null, bool compactResult = false)
Parameters
Returns
- DMatch[][]
RadiusMatch(Mat, float, Mat[]?, bool)
Find best matches for each query descriptor which have distance less than maxDistance (in increasing order of distances).
public DMatch[][] RadiusMatch(Mat queryDescriptors, float maxDistance, Mat[]? masks = null, bool compactResult = false)
Parameters
Returns
- DMatch[][]
Train()
Train matcher (e.g. train flann index). In all methods to match the method train() is run every time before matching. Some descriptor matchers (e.g. BruteForceMatcher) have empty implementation of this method, other matchers really train their inner structures (e.g. FlannBasedMatcher trains flann::Index). So nonempty implementation of train() should check the class object state and do traing/retraining only if the state requires that (e.g. FlannBasedMatcher trains flann::Index if it has not trained yet or if new descriptors have been added to the train collection).
public virtual void Train()