Flann-based descriptor matcher.
More...
#include "features2d.hpp"
Inheritance diagram for cv::FlannBasedMatcher:
Public Member Functions
Adds descriptors to train a CPU(trainDescCollectionis) or GPU(utrainDescCollectionis) descriptor collection.
More...
Clears the train descriptor collections.
More...
Returns true if the descriptor matcher supports masking permissible matches.
More...
Reads algorithm parameters from a file storage.
More...
Trains a descriptor matcher.
More...
Stores algorithm parameters in a file storage.
More...
virtual bool
empty () const
Returns true if there are no train descriptors in the both collections.
More...
Returns a constant link to the train descriptor collection trainDescCollection .
More...
Finds the k best matches for each descriptor from a query set.
More...
Finds the best match for each descriptor from a query set.
More...
For each query descriptor, finds the training descriptors not farther than the specified distance.
More...
Protected Member Functions
Static Protected Member Functions
static void
convertToDMatches (const DescriptorCollection &descriptors, const
Mat &indices, const
Mat &distances, std::vector< std::vector<
DMatch > > &matches)
Protected Attributes
Collection of descriptors from train images.
More...
Additional Inherited Members
Creates a descriptor matcher of a given type with the default parameters (using default constructor).
More...
template<typename _Tp >
Loads algorithm from the file.
More...
template<typename _Tp >
template<typename _Tp >
Reads algorithm from the file node.
More...
Detailed Description
Flann-based descriptor matcher.
This matcher trains flann::Index_ on a train descriptor collection and calls its nearest search methods to find the best matches. So, this matcher may be faster when matching a large train collection than the brute force matcher. FlannBasedMatcher does not support masking permissible matches of descriptor sets because flann::Index does not support this. :
Constructor & Destructor Documentation
Member Function Documentation
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.
- Parameters
-
descriptors Descriptors to add. Each descriptors[i] is a set of descriptors from the same train image.
Reimplemented from cv::DescriptorMatcher.
virtual void cv::FlannBasedMatcher::clear
(
)
virtual
Clones the matcher.
- Parameters
-
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.
Implements cv::DescriptorMatcher.
static void cv::FlannBasedMatcher::convertToDMatches
(
const DescriptorCollection &
descriptors,
std::vector< std::vector<
DMatch > > &
matches
)
staticprotected
virtual bool cv::FlannBasedMatcher::isMaskSupported
(
)
const
virtual
Returns true if the descriptor matcher supports masking permissible matches.
Implements cv::DescriptorMatcher.
virtual void cv::FlannBasedMatcher::knnMatchImpl
(
InputArray
queryDescriptors,
std::vector< std::vector<
DMatch > > &
matches,
int
k,
bool
compactResult = false
)
protectedvirtual
In fact the matching is implemented only by the following two methods. These methods suppose that the class object has been trained already. Public match methods call these methods after calling train().
Implements cv::DescriptorMatcher.
virtual void cv::FlannBasedMatcher::radiusMatchImpl
(
InputArray
queryDescriptors,
std::vector< std::vector<
DMatch > > &
matches,
float
maxDistance,
bool
compactResult = false
)
protectedvirtual
virtual void cv::FlannBasedMatcher::read
(
const
FileNode &
fn )
virtual
virtual void cv::FlannBasedMatcher::train
(
)
virtual
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 ).
Reimplemented from cv::DescriptorMatcher.
virtual void cv::FlannBasedMatcher::write
(
FileStorage &
fs )
const
virtual
Member Data Documentation
int cv::FlannBasedMatcher::addedDescCount
protected
DescriptorCollection cv::FlannBasedMatcher::mergedDescriptors
protected
The documentation for this class was generated from the following file: