OpenCV for Unity 2.6.4
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.10.0/index.html ) for the details of the argument of the method.
|
Abstract base class for matching keypoint descriptors. More...
Public Member Functions | |
void | add (List< Mat > descriptors) |
Adds descriptors to train a CPU(trainDescCollectionis) or GPU(utrainDescCollectionis) descriptor collection. | |
override void | clear () |
Clears the train descriptor collections. | |
DescriptorMatcher | clone () |
Clones the matcher. | |
DescriptorMatcher | clone (bool emptyTrainData) |
Clones the matcher. | |
override bool | empty () |
Returns true if there are no train descriptors in the both collections. | |
List< Mat > | getTrainDescriptors () |
Returns a constant link to the train descriptor collection trainDescCollection . | |
bool | isMaskSupported () |
Returns true if the descriptor matcher supports masking permissible matches. | |
void | knnMatch (Mat queryDescriptors, List< MatOfDMatch > matches, int k) |
void | knnMatch (Mat queryDescriptors, List< MatOfDMatch > matches, int k, List< Mat > masks) |
void | knnMatch (Mat queryDescriptors, List< MatOfDMatch > matches, int k, List< Mat > masks, bool compactResult) |
void | knnMatch (Mat queryDescriptors, Mat trainDescriptors, List< MatOfDMatch > matches, int k) |
Finds the k best matches for each descriptor from a query set. | |
void | knnMatch (Mat queryDescriptors, Mat trainDescriptors, List< MatOfDMatch > matches, int k, Mat mask) |
Finds the k best matches for each descriptor from a query set. | |
void | knnMatch (Mat queryDescriptors, Mat trainDescriptors, List< MatOfDMatch > matches, int k, Mat mask, bool compactResult) |
Finds the k best matches for each descriptor from a query set. | |
void | match (Mat queryDescriptors, Mat trainDescriptors, MatOfDMatch matches) |
Finds the best match for each descriptor from a query set. | |
void | match (Mat queryDescriptors, Mat trainDescriptors, MatOfDMatch matches, Mat mask) |
Finds the best match for each descriptor from a query set. | |
void | match (Mat queryDescriptors, MatOfDMatch matches) |
void | match (Mat queryDescriptors, MatOfDMatch matches, List< Mat > masks) |
void | radiusMatch (Mat queryDescriptors, List< MatOfDMatch > matches, float maxDistance) |
void | radiusMatch (Mat queryDescriptors, List< MatOfDMatch > matches, float maxDistance, List< Mat > masks) |
void | radiusMatch (Mat queryDescriptors, List< MatOfDMatch > matches, float maxDistance, List< Mat > masks, bool compactResult) |
void | radiusMatch (Mat queryDescriptors, Mat trainDescriptors, List< MatOfDMatch > matches, float maxDistance) |
For each query descriptor, finds the training descriptors not farther than the specified distance. | |
void | radiusMatch (Mat queryDescriptors, Mat trainDescriptors, List< MatOfDMatch > matches, float maxDistance, Mat mask) |
For each query descriptor, finds the training descriptors not farther than the specified distance. | |
void | radiusMatch (Mat queryDescriptors, Mat trainDescriptors, List< MatOfDMatch > matches, float maxDistance, Mat mask, bool compactResult) |
For each query descriptor, finds the training descriptors not farther than the specified distance. | |
void | read (string fileName) |
void | train () |
Trains a descriptor matcher. | |
void | write (string fileName) |
Public Member Functions inherited from OpenCVForUnity.CoreModule.Algorithm | |
virtual string | getDefaultName () |
IntPtr | getNativeObjAddr () |
void | save (string filename) |
Public Member Functions inherited from OpenCVForUnity.DisposableObject | |
void | Dispose () |
void | ThrowIfDisposed () |
Static Public Member Functions | |
static new DescriptorMatcher | __fromPtr__ (IntPtr addr) |
static DescriptorMatcher | create (int matcherType) |
static DescriptorMatcher | create (string descriptorMatcherType) |
Creates a descriptor matcher of a given type with the default parameters (using default constructor). | |
Static Public Member Functions inherited from OpenCVForUnity.CoreModule.Algorithm | |
static Algorithm | __fromPtr__ (IntPtr addr) |
Static Public Member Functions inherited from OpenCVForUnity.DisposableObject | |
static IntPtr | ThrowIfNullIntPtr (IntPtr ptr) |
Static Public Attributes | |
const int | BRUTEFORCE = 2 |
const int | BRUTEFORCE_HAMMING = 4 |
const int | BRUTEFORCE_HAMMINGLUT = 5 |
const int | BRUTEFORCE_L1 = 3 |
const int | BRUTEFORCE_SL2 = 6 |
const int | FLANNBASED = 1 |
Protected Member Functions | |
override void | Dispose (bool disposing) |
Protected Member Functions inherited from OpenCVForUnity.CoreModule.Algorithm | |
Protected Member Functions inherited from OpenCVForUnity.DisposableOpenCVObject | |
DisposableOpenCVObject () | |
DisposableOpenCVObject (bool isEnabledDispose) | |
DisposableOpenCVObject (IntPtr ptr) | |
DisposableOpenCVObject (IntPtr ptr, bool isEnabledDispose) | |
override void | Dispose (bool disposing) |
Protected Member Functions inherited from OpenCVForUnity.DisposableObject | |
DisposableObject () | |
DisposableObject (bool isEnabledDispose) | |
Additional Inherited Members | |
Package Functions inherited from OpenCVForUnity.CoreModule.Algorithm | |
Package Attributes inherited from OpenCVForUnity.DisposableOpenCVObject | |
Properties inherited from OpenCVForUnity.DisposableObject | |
bool | IsDisposed [get, protected set] |
bool | IsEnabledDispose [get, set] |
Abstract base class for matching keypoint descriptors.
It has two groups of match methods: for matching descriptors of an image with another image or with an image set.
|
static |
void OpenCVForUnity.Features2dModule.DescriptorMatcher.add | ( | List< Mat > | descriptors | ) |
Adds descriptors to train a CPU(trainDescCollectionis) or GPU(utrainDescCollectionis) descriptor collection.
If the collection is not empty, the new descriptors are added to existing train descriptors.
descriptors | Descriptors to add. Each descriptors[i] is a set of descriptors from the same train image. |
|
virtual |
Clears the train descriptor collections.
Reimplemented from OpenCVForUnity.CoreModule.Algorithm.
DescriptorMatcher OpenCVForUnity.Features2dModule.DescriptorMatcher.clone | ( | ) |
Clones the matcher.
emptyTrainData | If emptyTrainData is false, the method creates a deep copy of the object, that is, copies both parameters and train data. If emptyTrainData is true, the method creates an object copy with the current parameters but with empty train data. |
DescriptorMatcher OpenCVForUnity.Features2dModule.DescriptorMatcher.clone | ( | bool | emptyTrainData | ) |
Clones the matcher.
emptyTrainData | If emptyTrainData is false, the method creates a deep copy of the object, that is, copies both parameters and train data. If emptyTrainData is true, the method creates an object copy with the current parameters but with empty train data. |
|
static |
|
static |
Creates a descriptor matcher of a given type with the default parameters (using default constructor).
descriptorMatcherType | Descriptor matcher type. Now the following matcher types are supported:
|
|
protectedvirtual |
Reimplemented from OpenCVForUnity.CoreModule.Algorithm.
Reimplemented in OpenCVForUnity.Features2dModule.FlannBasedMatcher.
|
virtual |
Returns true if there are no train descriptors in the both collections.
Reimplemented from OpenCVForUnity.CoreModule.Algorithm.
List< Mat > OpenCVForUnity.Features2dModule.DescriptorMatcher.getTrainDescriptors | ( | ) |
Returns a constant link to the train descriptor collection trainDescCollection .
bool OpenCVForUnity.Features2dModule.DescriptorMatcher.isMaskSupported | ( | ) |
Returns true if the descriptor matcher supports masking permissible matches.
void OpenCVForUnity.Features2dModule.DescriptorMatcher.knnMatch | ( | Mat | queryDescriptors, |
List< MatOfDMatch > | matches, | ||
int | k ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
queryDescriptors | Query set of descriptors. |
matches | Matches. Each matches[i] is k or less matches for the same query descriptor. |
k | Count of best matches found per each query descriptor or less if a query descriptor has less than k possible matches in total. |
masks | Set of masks. Each masks[i] specifies permissible matches between the input query descriptors and stored train descriptors from the i-th image trainDescCollection[i]. |
compactResult | 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. |
void OpenCVForUnity.Features2dModule.DescriptorMatcher.knnMatch | ( | Mat | queryDescriptors, |
List< MatOfDMatch > | matches, | ||
int | k, | ||
List< Mat > | masks ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
queryDescriptors | Query set of descriptors. |
matches | Matches. Each matches[i] is k or less matches for the same query descriptor. |
k | Count of best matches found per each query descriptor or less if a query descriptor has less than k possible matches in total. |
masks | Set of masks. Each masks[i] specifies permissible matches between the input query descriptors and stored train descriptors from the i-th image trainDescCollection[i]. |
compactResult | 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. |
void OpenCVForUnity.Features2dModule.DescriptorMatcher.knnMatch | ( | Mat | queryDescriptors, |
List< MatOfDMatch > | matches, | ||
int | k, | ||
List< Mat > | masks, | ||
bool | compactResult ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
queryDescriptors | Query set of descriptors. |
matches | Matches. Each matches[i] is k or less matches for the same query descriptor. |
k | Count of best matches found per each query descriptor or less if a query descriptor has less than k possible matches in total. |
masks | Set of masks. Each masks[i] specifies permissible matches between the input query descriptors and stored train descriptors from the i-th image trainDescCollection[i]. |
compactResult | 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. |
void OpenCVForUnity.Features2dModule.DescriptorMatcher.knnMatch | ( | Mat | queryDescriptors, |
Mat | trainDescriptors, | ||
List< MatOfDMatch > | matches, | ||
int | k ) |
Finds the k best matches for each descriptor from a query set.
queryDescriptors | Query set of descriptors. |
trainDescriptors | Train set of descriptors. This set is not added to the train descriptors collection stored in the class object. |
mask | Mask specifying permissible matches between an input query and train matrices of descriptors. |
matches | Matches. Each matches[i] is k or less matches for the same query descriptor. |
k | Count of best matches found per each query descriptor or less if a query descriptor has less than k possible matches in total. |
compactResult | 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. |
These extended variants of DescriptorMatcher.match methods find several best matches for each query descriptor. The matches are returned in the distance increasing order. See DescriptorMatcher.match for the details about query and train descriptors.
void OpenCVForUnity.Features2dModule.DescriptorMatcher.knnMatch | ( | Mat | queryDescriptors, |
Mat | trainDescriptors, | ||
List< MatOfDMatch > | matches, | ||
int | k, | ||
Mat | mask ) |
Finds the k best matches for each descriptor from a query set.
queryDescriptors | Query set of descriptors. |
trainDescriptors | Train set of descriptors. This set is not added to the train descriptors collection stored in the class object. |
mask | Mask specifying permissible matches between an input query and train matrices of descriptors. |
matches | Matches. Each matches[i] is k or less matches for the same query descriptor. |
k | Count of best matches found per each query descriptor or less if a query descriptor has less than k possible matches in total. |
compactResult | 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. |
These extended variants of DescriptorMatcher.match methods find several best matches for each query descriptor. The matches are returned in the distance increasing order. See DescriptorMatcher.match for the details about query and train descriptors.
void OpenCVForUnity.Features2dModule.DescriptorMatcher.knnMatch | ( | Mat | queryDescriptors, |
Mat | trainDescriptors, | ||
List< MatOfDMatch > | matches, | ||
int | k, | ||
Mat | mask, | ||
bool | compactResult ) |
Finds the k best matches for each descriptor from a query set.
queryDescriptors | Query set of descriptors. |
trainDescriptors | Train set of descriptors. This set is not added to the train descriptors collection stored in the class object. |
mask | Mask specifying permissible matches between an input query and train matrices of descriptors. |
matches | Matches. Each matches[i] is k or less matches for the same query descriptor. |
k | Count of best matches found per each query descriptor or less if a query descriptor has less than k possible matches in total. |
compactResult | 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. |
These extended variants of DescriptorMatcher.match methods find several best matches for each query descriptor. The matches are returned in the distance increasing order. See DescriptorMatcher.match for the details about query and train descriptors.
void OpenCVForUnity.Features2dModule.DescriptorMatcher.match | ( | Mat | queryDescriptors, |
Mat | trainDescriptors, | ||
MatOfDMatch | matches ) |
Finds the best match for each descriptor from a query set.
queryDescriptors | Query set of descriptors. |
trainDescriptors | Train set of descriptors. This set is not added to the train descriptors collection stored in the class object. |
matches | 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 | Mask specifying permissible matches between an input query and train matrices of descriptors. |
In the first variant of this method, the train descriptors are passed as an input argument. In the second variant of the method, train descriptors collection that was set by DescriptorMatcher.add is used. Optional mask (or masks) can be passed to specify which query and training descriptors can be matched. Namely, queryDescriptors[i] can be matched with trainDescriptors[j] only if mask.at<uchar>(i,j) is non-zero.
void OpenCVForUnity.Features2dModule.DescriptorMatcher.match | ( | Mat | queryDescriptors, |
Mat | trainDescriptors, | ||
MatOfDMatch | matches, | ||
Mat | mask ) |
Finds the best match for each descriptor from a query set.
queryDescriptors | Query set of descriptors. |
trainDescriptors | Train set of descriptors. This set is not added to the train descriptors collection stored in the class object. |
matches | 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 | Mask specifying permissible matches between an input query and train matrices of descriptors. |
In the first variant of this method, the train descriptors are passed as an input argument. In the second variant of the method, train descriptors collection that was set by DescriptorMatcher.add is used. Optional mask (or masks) can be passed to specify which query and training descriptors can be matched. Namely, queryDescriptors[i] can be matched with trainDescriptors[j] only if mask.at<uchar>(i,j) is non-zero.
void OpenCVForUnity.Features2dModule.DescriptorMatcher.match | ( | Mat | queryDescriptors, |
MatOfDMatch | matches ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
queryDescriptors | Query set of descriptors. |
matches | 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. |
masks | Set of masks. Each masks[i] specifies permissible matches between the input query descriptors and stored train descriptors from the i-th image trainDescCollection[i]. |
void OpenCVForUnity.Features2dModule.DescriptorMatcher.match | ( | Mat | queryDescriptors, |
MatOfDMatch | matches, | ||
List< Mat > | masks ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
queryDescriptors | Query set of descriptors. |
matches | 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. |
masks | Set of masks. Each masks[i] specifies permissible matches between the input query descriptors and stored train descriptors from the i-th image trainDescCollection[i]. |
void OpenCVForUnity.Features2dModule.DescriptorMatcher.radiusMatch | ( | Mat | queryDescriptors, |
List< MatOfDMatch > | matches, | ||
float | maxDistance ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
queryDescriptors | Query set of descriptors. |
matches | Found matches. |
maxDistance | 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 | Set of masks. Each masks[i] specifies permissible matches between the input query descriptors and stored train descriptors from the i-th image trainDescCollection[i]. |
compactResult | 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. |
void OpenCVForUnity.Features2dModule.DescriptorMatcher.radiusMatch | ( | Mat | queryDescriptors, |
List< MatOfDMatch > | matches, | ||
float | maxDistance, | ||
List< Mat > | masks ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
queryDescriptors | Query set of descriptors. |
matches | Found matches. |
maxDistance | 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 | Set of masks. Each masks[i] specifies permissible matches between the input query descriptors and stored train descriptors from the i-th image trainDescCollection[i]. |
compactResult | 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. |
void OpenCVForUnity.Features2dModule.DescriptorMatcher.radiusMatch | ( | Mat | queryDescriptors, |
List< MatOfDMatch > | matches, | ||
float | maxDistance, | ||
List< Mat > | masks, | ||
bool | compactResult ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
queryDescriptors | Query set of descriptors. |
matches | Found matches. |
maxDistance | 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 | Set of masks. Each masks[i] specifies permissible matches between the input query descriptors and stored train descriptors from the i-th image trainDescCollection[i]. |
compactResult | 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. |
void OpenCVForUnity.Features2dModule.DescriptorMatcher.radiusMatch | ( | Mat | queryDescriptors, |
Mat | trainDescriptors, | ||
List< MatOfDMatch > | matches, | ||
float | maxDistance ) |
For each query descriptor, finds the training descriptors not farther than the specified distance.
queryDescriptors | Query set of descriptors. |
trainDescriptors | Train set of descriptors. This set is not added to the train descriptors collection stored in the class object. |
matches | Found matches. |
compactResult | 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. |
maxDistance | 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 | Mask specifying permissible matches between an input query and train matrices of descriptors. |
For each query descriptor, the methods find such training descriptors that the distance between the query descriptor and the training descriptor is equal or smaller than maxDistance. Found matches are returned in the distance increasing order.
void OpenCVForUnity.Features2dModule.DescriptorMatcher.radiusMatch | ( | Mat | queryDescriptors, |
Mat | trainDescriptors, | ||
List< MatOfDMatch > | matches, | ||
float | maxDistance, | ||
Mat | mask ) |
For each query descriptor, finds the training descriptors not farther than the specified distance.
queryDescriptors | Query set of descriptors. |
trainDescriptors | Train set of descriptors. This set is not added to the train descriptors collection stored in the class object. |
matches | Found matches. |
compactResult | 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. |
maxDistance | 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 | Mask specifying permissible matches between an input query and train matrices of descriptors. |
For each query descriptor, the methods find such training descriptors that the distance between the query descriptor and the training descriptor is equal or smaller than maxDistance. Found matches are returned in the distance increasing order.
void OpenCVForUnity.Features2dModule.DescriptorMatcher.radiusMatch | ( | Mat | queryDescriptors, |
Mat | trainDescriptors, | ||
List< MatOfDMatch > | matches, | ||
float | maxDistance, | ||
Mat | mask, | ||
bool | compactResult ) |
For each query descriptor, finds the training descriptors not farther than the specified distance.
queryDescriptors | Query set of descriptors. |
trainDescriptors | Train set of descriptors. This set is not added to the train descriptors collection stored in the class object. |
matches | Found matches. |
compactResult | 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. |
maxDistance | 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 | Mask specifying permissible matches between an input query and train matrices of descriptors. |
For each query descriptor, the methods find such training descriptors that the distance between the query descriptor and the training descriptor is equal or smaller than maxDistance. Found matches are returned in the distance increasing order.
void OpenCVForUnity.Features2dModule.DescriptorMatcher.read | ( | string | fileName | ) |
void OpenCVForUnity.Features2dModule.DescriptorMatcher.train | ( | ) |
Trains a descriptor matcher.
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 ).
void OpenCVForUnity.Features2dModule.DescriptorMatcher.write | ( | string | fileName | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |