Class cv::FlannBasedMatcher#
Flann-based descriptor matcher. View details
#include <opencv2/features.hpp>Collaboration diagram for cv::FlannBasedMatcher:
Public Types#
Public Types inherited from cv::DescriptorMatcher
Return |
Name |
Description |
|---|---|---|
Public Member Functions#
Public Member Functions inherited from cv::DescriptorMatcher
Return |
Name |
Description |
|---|---|---|
|
Adds descriptors to train a CPU(trainDescCollectionis) or GPU(utrainDescCollectionis) descriptor collection. |
|
|
Clears the train descriptor collections. |
|
|
Clones the matcher. |
|
|
Returns true if there are no train descriptors in the both collections. |
|
|
Returns a constant link to the train descriptor collection trainDescCollection . |
|
|
Returns true if the descriptor matcher supports masking permissible matches. |
|
|
Finds the k best matches for each descriptor from a query set. |
|
|
||
|
Finds the best match for each descriptor from a query set. |
|
|
||
|
For each query descriptor, finds the training descriptors not farther than the specified distance. |
|
|
||
|
Reads algorithm parameters from a file storage. |
|
|
||
|
Trains a descriptor matcher. |
|
|
||
|
||
|
Stores algorithm parameters in a file storage. |
|
|
Public Member Functions inherited from cv::Algorithm
Return |
Name |
Description |
|---|---|---|
|
Clears the algorithm state. |
|
|
Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read. |
|
|
Reads algorithm parameters from a file storage. |
|
|
||
|
|
|
|
Stores algorithm parameters in a file storage. |
|
|
Static Public Member Functions#
Static Public Member Functions inherited from cv::DescriptorMatcher
Return |
Name |
Description |
|---|---|---|
|
||
|
Creates a descriptor matcher of a given type with the default parameters (using default constructor). |
Static Public Member Functions inherited from cv::Algorithm
Return |
Name |
Description |
|---|---|---|
|
|
Loads algorithm from the file. |
|
|
Loads algorithm from a String. |
|
Reads algorithm from the file node. |
Additional Inherited Members#
Protected Member Functions inherited from cv::DescriptorMatcher
Return |
Name |
Description |
|---|---|---|
|
|
|
|
||
|
Protected Member Functions inherited from cv::Algorithm
Return |
Name |
Description |
|---|---|---|
|
Static Protected Member Functions inherited from cv::DescriptorMatcher
Return |
Name |
Description |
|---|---|---|
|
||
|
||
|
|
Protected Attributes inherited from cv::DescriptorMatcher
Detailed Description#
Flann-based descriptor matcher.
This matcher trains cv::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#
FlannBasedMatcher()#
cv::FlannBasedMatcher::FlannBasedMatcher(
const Ptr< flann::IndexParams > & indexParams = makePtr< flann::KDTreeIndexParams >(),
const Ptr< flann::SearchParams > & searchParams = makePtr< flann::SearchParams >() )
Python:
cv.FlannBasedMatcher([, indexParams[, searchParams]]) -> <FlannBasedMatcher object>
Member Function Documentation#
add()#
void cv::FlannBasedMatcher::add(InputArrayOfArrays 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.
Parameters
descriptors— Descriptors to add. Each descriptors[i] is a set of descriptors from the same train image.
clear()#
void cv::FlannBasedMatcher::clear()
Clears the train descriptor collections.
clone()#
CV_NODISCARD_STD Ptr< DescriptorMatcher > cv::FlannBasedMatcher::clone(bool emptyTrainData = false)
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.
isMaskSupported()#
bool cv::FlannBasedMatcher::isMaskSupported()
Returns true if the descriptor matcher supports masking permissible matches.
read()#
void cv::FlannBasedMatcher::read(const FileNode & fn)
Reads algorithm parameters from a file storage.
train()#
void cv::FlannBasedMatcher::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 ).
write()#
void cv::FlannBasedMatcher::write(FileStorage & fs)
Stores algorithm parameters in a file storage.
create()#
static Ptr< FlannBasedMatcher > cv::FlannBasedMatcher::create()
Python:
cv.FlannBasedMatcher.create() -> retval
cv.FlannBasedMatcher_create() -> retval
convertToDMatches()#
static void cv::FlannBasedMatcher::convertToDMatches(
const DescriptorCollection & descriptors,
const Mat & indices,
const Mat & distances,
std::vector< std::vector< DMatch > > & matches )
knnMatchImpl()#
void cv::FlannBasedMatcher::knnMatchImpl(
InputArray queryDescriptors,
std::vector< std::vector< DMatch > > & matches,
int k,
InputArrayOfArrays masks = noArray(),
bool compactResult = false )
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().
radiusMatchImpl()#
void cv::FlannBasedMatcher::radiusMatchImpl(
InputArray queryDescriptors,
std::vector< std::vector< DMatch > > & matches,
float maxDistance,
InputArrayOfArrays masks = noArray(),
bool compactResult = false )
Member Data Documentation#
addedDescCount#
int cv::FlannBasedMatcher::addedDescCount
flannIndex#
Ptr< flann::Index > cv::FlannBasedMatcher::flannIndex
indexParams#
Ptr< flann::IndexParams > cv::FlannBasedMatcher::indexParams
mergedDescriptors#
DescriptorCollection cv::FlannBasedMatcher::mergedDescriptors
searchParams#
Ptr< flann::SearchParams > cv::FlannBasedMatcher::searchParams
Source file#
The documentation for this class was generated from the following file:
opencv2/features.hpp