C# Class OpenCvSharp.DescriptorMatcher

Inheritance: Algorithm
Mostra file Open project: shimat/opencvsharp Class Usage Examples

Private Properties

Property Type Description
FromPtr DescriptorMatcher
FromRawPtr DescriptorMatcher

Public Methods

Method Description
Add ( IEnumerable descriptors ) : void

Add descriptors to train descriptor collection.

Clear ( ) : void

Clear train descriptors collection.

Create ( string descriptorMatcherType ) : DescriptorMatcher

Create descriptor matcher by type name.

Empty ( ) : bool

Return true if there are not train descriptors in collection.

GetTrainDescriptors ( ) : OpenCvSharp.Mat[]

Get train descriptors collection.

IsMaskSupported ( ) : bool

Return true if the matcher supports mask in match methods.

KnnMatch ( OpenCvSharp.Mat queryDescriptors, OpenCvSharp.Mat trainDescriptors, int k, OpenCvSharp.Mat mask = null, bool compactResult = false ) : OpenCvSharp.DMatch[][]

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.

KnnMatch ( OpenCvSharp.Mat queryDescriptors, int k, OpenCvSharp.Mat masks = null, bool compactResult = false ) : OpenCvSharp.DMatch[][]

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.

Match ( OpenCvSharp.Mat queryDescriptors, OpenCvSharp.Mat masks = null ) : OpenCvSharp.DMatch[]

Find one best match for each query descriptor (if mask is empty).

Match ( OpenCvSharp.Mat queryDescriptors, OpenCvSharp.Mat trainDescriptors, OpenCvSharp.Mat mask = null ) : OpenCvSharp.DMatch[]

Find one best match for each query descriptor (if mask is empty).

RadiusMatch ( OpenCvSharp.Mat queryDescriptors, OpenCvSharp.Mat trainDescriptors, float maxDistance, OpenCvSharp.Mat mask = null, bool compactResult = false ) : OpenCvSharp.DMatch[][]

Find best matches for each query descriptor which have distance less than maxDistance (in increasing order of distances).

RadiusMatch ( OpenCvSharp.Mat queryDescriptors, float maxDistance, OpenCvSharp.Mat masks = null, bool compactResult = false ) : OpenCvSharp.DMatch[][]

Find best matches for each query descriptor which have distance less than maxDistance (in increasing order of distances).

Train ( ) : void

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

Protected Methods

Method Description
DescriptorMatcher ( ) : System

Dispose ( bool disposing ) : void

Releases the resources

Private Methods

Method Description
FromPtr ( IntPtr ptr ) : DescriptorMatcher

Creates instance from cv::Ptr<T> . ptr is disposed when the wrapper disposes.

FromRawPtr ( IntPtr ptr ) : DescriptorMatcher

Creates instance from raw pointer T*

Method Details

Add() public method

Add descriptors to train descriptor collection.
public Add ( IEnumerable descriptors ) : void
descriptors IEnumerable Descriptors to add. Each descriptors[i] is a descriptors set from one image.
return void

Clear() public method

Clear train descriptors collection.
public Clear ( ) : void
return void

Create() public static method

Create descriptor matcher by type name.
public static Create ( string descriptorMatcherType ) : DescriptorMatcher
descriptorMatcherType string
return DescriptorMatcher

DescriptorMatcher() protected method

protected DescriptorMatcher ( ) : System
return System

Dispose() protected method

Releases the resources
protected Dispose ( bool disposing ) : void
disposing bool /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. ///
return void

Empty() public method

Return true if there are not train descriptors in collection.
public Empty ( ) : bool
return bool

GetTrainDescriptors() public method

Get train descriptors collection.
public GetTrainDescriptors ( ) : OpenCvSharp.Mat[]
return OpenCvSharp.Mat[]

IsMaskSupported() public method

Return true if the matcher supports mask in match methods.
public IsMaskSupported ( ) : bool
return bool

KnnMatch() public method

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 KnnMatch ( OpenCvSharp.Mat queryDescriptors, OpenCvSharp.Mat trainDescriptors, int k, OpenCvSharp.Mat mask = null, bool compactResult = false ) : OpenCvSharp.DMatch[][]
queryDescriptors OpenCvSharp.Mat
trainDescriptors OpenCvSharp.Mat
k int
mask OpenCvSharp.Mat
compactResult bool
return OpenCvSharp.DMatch[][]

KnnMatch() public method

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 KnnMatch ( OpenCvSharp.Mat queryDescriptors, int k, OpenCvSharp.Mat masks = null, bool compactResult = false ) : OpenCvSharp.DMatch[][]
queryDescriptors OpenCvSharp.Mat
k int
masks OpenCvSharp.Mat
compactResult bool
return OpenCvSharp.DMatch[][]

Match() public method

Find one best match for each query descriptor (if mask is empty).
public Match ( OpenCvSharp.Mat queryDescriptors, OpenCvSharp.Mat masks = null ) : OpenCvSharp.DMatch[]
queryDescriptors OpenCvSharp.Mat
masks OpenCvSharp.Mat
return OpenCvSharp.DMatch[]

Match() public method

Find one best match for each query descriptor (if mask is empty).
public Match ( OpenCvSharp.Mat queryDescriptors, OpenCvSharp.Mat trainDescriptors, OpenCvSharp.Mat mask = null ) : OpenCvSharp.DMatch[]
queryDescriptors OpenCvSharp.Mat
trainDescriptors OpenCvSharp.Mat
mask OpenCvSharp.Mat
return OpenCvSharp.DMatch[]

RadiusMatch() public method

Find best matches for each query descriptor which have distance less than maxDistance (in increasing order of distances).
public RadiusMatch ( OpenCvSharp.Mat queryDescriptors, OpenCvSharp.Mat trainDescriptors, float maxDistance, OpenCvSharp.Mat mask = null, bool compactResult = false ) : OpenCvSharp.DMatch[][]
queryDescriptors OpenCvSharp.Mat
trainDescriptors OpenCvSharp.Mat
maxDistance float
mask OpenCvSharp.Mat
compactResult bool
return OpenCvSharp.DMatch[][]

RadiusMatch() public method

Find best matches for each query descriptor which have distance less than maxDistance (in increasing order of distances).
public RadiusMatch ( OpenCvSharp.Mat queryDescriptors, float maxDistance, OpenCvSharp.Mat masks = null, bool compactResult = false ) : OpenCvSharp.DMatch[][]
queryDescriptors OpenCvSharp.Mat
maxDistance float
masks OpenCvSharp.Mat
compactResult bool
return OpenCvSharp.DMatch[][]

Train() public method

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 Train ( ) : void
return void