@Namespace(value="cv") @NoOffset public static class opencv_features2d.DescriptorMatcher extends opencv_core.Algorithm
/** \brief 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.
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator| Constructor and Description |
|---|
opencv_features2d.DescriptorMatcher(Pointer p)
Pointer cast constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(opencv_core.MatVector descriptors)
\brief Adds descriptors to train a CPU(trainDescCollectionis) or GPU(utrainDescCollectionis) descriptor
collection.
|
void |
clear()
\brief Clears the train descriptor collections.
|
opencv_features2d.DescriptorMatcher |
clone() |
opencv_features2d.DescriptorMatcher |
clone(boolean emptyTrainData)
\brief Clones the matcher.
|
static opencv_features2d.DescriptorMatcher |
create(BytePointer descriptorMatcherType)
\brief Creates a descriptor matcher of a given type with the default parameters (using default
constructor).
|
static opencv_features2d.DescriptorMatcher |
create(String descriptorMatcherType) |
boolean |
empty()
\brief Returns true if there are no train descriptors in the both collections.
|
opencv_core.MatVector |
getTrainDescriptors()
\brief Returns a constant link to the train descriptor collection trainDescCollection .
|
boolean |
isMaskSupported()
\brief Returns true if the descriptor matcher supports masking permissible matches.
|
void |
knnMatch(opencv_core.Mat queryDescriptors,
opencv_core.DMatchVectorVector matches,
int k) |
void |
knnMatch(opencv_core.Mat queryDescriptors,
opencv_core.DMatchVectorVector matches,
int k,
opencv_core.MatVector masks,
boolean compactResult)
\overload
|
void |
knnMatch(opencv_core.Mat queryDescriptors,
opencv_core.Mat trainDescriptors,
opencv_core.DMatchVectorVector matches,
int k) |
void |
knnMatch(opencv_core.Mat queryDescriptors,
opencv_core.Mat trainDescriptors,
opencv_core.DMatchVectorVector matches,
int k,
opencv_core.Mat mask,
boolean compactResult)
\brief Finds the k best matches for each descriptor from a query set.
|
void |
match(opencv_core.Mat queryDescriptors,
opencv_core.DMatchVector matches) |
void |
match(opencv_core.Mat queryDescriptors,
opencv_core.DMatchVector matches,
opencv_core.MatVector masks)
\overload
|
void |
match(opencv_core.Mat queryDescriptors,
opencv_core.Mat trainDescriptors,
opencv_core.DMatchVector matches) |
void |
match(opencv_core.Mat queryDescriptors,
opencv_core.Mat trainDescriptors,
opencv_core.DMatchVector matches,
opencv_core.Mat mask)
\brief Finds the best match for each descriptor from a query set.
|
void |
radiusMatch(opencv_core.Mat queryDescriptors,
opencv_core.DMatchVectorVector matches,
float maxDistance) |
void |
radiusMatch(opencv_core.Mat queryDescriptors,
opencv_core.DMatchVectorVector matches,
float maxDistance,
opencv_core.MatVector masks,
boolean compactResult)
\overload
|
void |
radiusMatch(opencv_core.Mat queryDescriptors,
opencv_core.Mat trainDescriptors,
opencv_core.DMatchVectorVector matches,
float maxDistance) |
void |
radiusMatch(opencv_core.Mat queryDescriptors,
opencv_core.Mat trainDescriptors,
opencv_core.DMatchVectorVector matches,
float maxDistance,
opencv_core.Mat mask,
boolean compactResult)
\brief For each query descriptor, finds the training descriptors not farther than the specified distance.
|
void |
read(opencv_core.FileNode arg0)
\brief Reads algorithm parameters from a file storage
|
void |
train()
\brief Trains a descriptor matcher
|
void |
write(opencv_core.FileStorage arg0)
\brief Stores algorithm parameters in a file storage
|
getDefaultName, position, save, saveaddress, asBuffer, asByteBuffer, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, hashCode, isNull, limit, limit, maxBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, position, put, setNull, sizeof, toString, totalBytes, withDeallocator, zeropublic opencv_features2d.DescriptorMatcher(Pointer p)
Pointer.Pointer(Pointer).public void add(@ByVal opencv_core.MatVector descriptors)
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.@Const @ByRef public opencv_core.MatVector getTrainDescriptors()
public void clear()
clear in class opencv_core.Algorithm@Cast(value="bool") public boolean empty()
empty in class opencv_core.Algorithm@Cast(value="bool") public boolean isMaskSupported()
public void 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 match(@ByVal opencv_core.Mat queryDescriptors, @ByVal opencv_core.Mat trainDescriptors, @ByRef opencv_core.DMatchVector matches, @ByVal(nullValue="cv::noArray()") opencv_core.Mat mask)
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\
public void match(@ByVal opencv_core.Mat queryDescriptors, @ByVal opencv_core.Mat trainDescriptors, @ByRef opencv_core.DMatchVector matches)
public void knnMatch(@ByVal opencv_core.Mat queryDescriptors, @ByVal opencv_core.Mat trainDescriptors, @ByRef opencv_core.DMatchVectorVector matches, int k, @ByVal(nullValue="cv::noArray()") opencv_core.Mat mask, @Cast(value="bool") boolean compactResult)
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.
public void knnMatch(@ByVal opencv_core.Mat queryDescriptors, @ByVal opencv_core.Mat trainDescriptors, @ByRef opencv_core.DMatchVectorVector matches, int k)
public void radiusMatch(@ByVal opencv_core.Mat queryDescriptors, @ByVal opencv_core.Mat trainDescriptors, @ByRef opencv_core.DMatchVectorVector matches, float maxDistance, @ByVal(nullValue="cv::noArray()") opencv_core.Mat mask, @Cast(value="bool") boolean compactResult)
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.
public void radiusMatch(@ByVal opencv_core.Mat queryDescriptors, @ByVal opencv_core.Mat trainDescriptors, @ByRef opencv_core.DMatchVectorVector matches, float maxDistance)
public void match(@ByVal opencv_core.Mat queryDescriptors, @ByRef opencv_core.DMatchVector matches, @ByVal(nullValue="cv::noArray()") opencv_core.MatVector masks)
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].public void match(@ByVal opencv_core.Mat queryDescriptors, @ByRef opencv_core.DMatchVector matches)
public void knnMatch(@ByVal opencv_core.Mat queryDescriptors, @ByRef opencv_core.DMatchVectorVector matches, int k, @ByVal(nullValue="cv::noArray()") opencv_core.MatVector masks, @Cast(value="bool") boolean compactResult)
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.public void knnMatch(@ByVal opencv_core.Mat queryDescriptors, @ByRef opencv_core.DMatchVectorVector matches, int k)
public void radiusMatch(@ByVal opencv_core.Mat queryDescriptors, @ByRef opencv_core.DMatchVectorVector matches, float maxDistance, @ByVal(nullValue="cv::noArray()") opencv_core.MatVector masks, @Cast(value="bool") boolean compactResult)
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.public void radiusMatch(@ByVal opencv_core.Mat queryDescriptors, @ByRef opencv_core.DMatchVectorVector matches, float maxDistance)
public void read(@Const@ByRef opencv_core.FileNode arg0)
opencv_core.Algorithmread in class opencv_core.Algorithmpublic void write(@ByRef opencv_core.FileStorage arg0)
opencv_core.Algorithmwrite in class opencv_core.Algorithm@opencv_core.Ptr public opencv_features2d.DescriptorMatcher clone(@Cast(value="bool") boolean emptyTrainData)
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.@opencv_core.Ptr public opencv_features2d.DescriptorMatcher clone()
@opencv_core.Ptr public static opencv_features2d.DescriptorMatcher create(@opencv_core.Str BytePointer descriptorMatcherType)
descriptorMatcherType - Descriptor matcher type. Now the following matcher types are
supported:
- BruteForce (it uses L2 )
- BruteForce-L1
- BruteForce-Hamming
- BruteForce-Hamming(2)
- FlannBased@opencv_core.Ptr public static opencv_features2d.DescriptorMatcher create(@opencv_core.Str String descriptorMatcherType)
Copyright © 2016. All rights reserved.