Class cv::BFMatcher#
Brute-force descriptor matcher. View details
#include <opencv2/features.hpp>Collaboration diagram for cv::BFMatcher:
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#
Brute-force descriptor matcher.
For each descriptor in the first set, this matcher finds the closest descriptor in the second set by trying each one. This descriptor matcher supports masking permissible matches of descriptor sets.
Constructor & Destructor Documentation#
BFMatcher()#
cv::BFMatcher::BFMatcher(
int normType = NORM_L2,
bool crossCheck = false )
Python:
Brute-force matcher constructor (obsolete). Please use BFMatcher.create()
~BFMatcher()#
Member Function Documentation#
clone()#
CV_NODISCARD_STD Ptr< DescriptorMatcher > cv::BFMatcher::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::BFMatcher::isMaskSupported()
Returns true if the descriptor matcher supports masking permissible matches.
create()#
static Ptr< BFMatcher > cv::BFMatcher::create(
int normType = NORM_L2,
bool crossCheck = false )
Python:
cv.BFMatcher.create([, normType[, crossCheck]]) -> retval
cv.BFMatcher_create([, normType[, crossCheck]]) -> retval
Brute-force matcher create method.
Parameters
normType— One of NORM_L1, NORM_L2, NORM_HAMMING, NORM_HAMMING2. L1 and L2 norms are preferable choices for SIFT and SURF descriptors, NORM_HAMMING should be used with ORB, BRISK and BRIEF, NORM_HAMMING2 should be used with ORB when WTA_K==3 or 4 (see ORB::ORB constructor description).crossCheck— If it is false, this is will be default BFMatcher behaviour when it finds the k nearest neighbors for each query descriptor. If crossCheck==true, then the knnMatch() method with k=1 will only return pairs (i,j) such that for i-th query descriptor the j-th descriptor in the matcher’s collection is the nearest and vice versa, i.e. the BFMatcher will only return consistent pairs. Such technique usually produces best results with minimal number of outliers when there are enough matches. This is alternative to the ratio test, used by D. Lowe in SIFT paper.
knnMatchImpl()#
void cv::BFMatcher::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::BFMatcher::radiusMatchImpl(
InputArray queryDescriptors,
std::vector< std::vector< DMatch > > & matches,
float maxDistance,
InputArrayOfArrays masks = noArray(),
bool compactResult = false )
Member Data Documentation#
crossCheck#
bool cv::BFMatcher::crossCheck
normType#
int cv::BFMatcher::normType
Source file#
The documentation for this class was generated from the following file:
opencv2/features.hpp