| OpenCV 5.0.0alpha Open Source Computer Vision

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
cv::detail::BestOf2NearestMatcher Class Reference
Images stitching » Features Finding and Images Matching

Features matcher which finds two best matches for each feature and leaves the best one only if the ratio between descriptor distances is greater than the threshold match_conf. More...

`#include <opencv2/stitching/detail/matchers.hpp>`

Collaboration diagram for cv::detail::BestOf2NearestMatcher:

## Public Member Functions
| BestOf2NearestMatcher (bool try_use_gpu=false, float match_conf=0.3f, int num_matches_thresh1=6, int num_matches_thresh2=6, double matches_confidence_thresh=3.)
| Constructs a "best of 2 nearest" matcher.
void | collectGarbage () CV_OVERRIDE
| Frees unused memory allocated before if there is any.
Public Member Functions inherited from cv::detail::FeaturesMatcher
virtual | ~FeaturesMatcher ()
bool | isThreadSafe () const
void | operator() (const ImageFeatures &features1, const ImageFeatures &features2, MatchesInfo &matches_info)
void | operator() (const std::vector< ImageFeatures > &features, std::vector< MatchesInfo > &pairwise_matches, const cv::UMat &mask=cv::UMat())
| Performs images matching.

## Static Public Member Functions
static Ptr< BestOf2NearestMatcher > | create (bool try_use_gpu=false, float match_conf=0.3f, int num_matches_thresh1=6, int num_matches_thresh2=6, double matches_confidence_thresh=3.)

## Protected Member Functions
void | match (const ImageFeatures &features1, const ImageFeatures &features2, MatchesInfo &matches_info) CV_OVERRIDE
| This method must implement matching logic in order to make the wrappers detail::FeaturesMatcher::operator()_ work.
Protected Member Functions inherited from cv::detail::FeaturesMatcher
| FeaturesMatcher (bool is_thread_safe=false)
virtual void | match (const std::vector< ImageFeatures > &features, std::vector< MatchesInfo > &pairwise_matches, const cv::UMat &mask=cv::UMat())
| This method implements logic to match features between arbitrary number of features. By default this checks every pair of inputs in the input, but the behaviour can be changed by subclasses.

## Protected Attributes
Ptr< FeaturesMatcher > | impl_
double | matches_confidence_thresh_
int | num_matches_thresh1_
int | num_matches_thresh2_
Protected Attributes inherited from cv::detail::FeaturesMatcher
bool | is_thread_safe_

## Detailed Description

Features matcher which finds two best matches for each feature and leaves the best one only if the ratio between descriptor distances is greater than the threshold match_conf.

See also
  detail::FeaturesMatcher

## Constructor & Destructor Documentation

## ◆ BestOf2NearestMatcher()

cv::detail::BestOf2NearestMatcher::BestOf2NearestMatcher | ( | bool | try_use_gpu = false,
|  | float | match_conf = 0.3f,
|  | int | num_matches_thresh1 = 6,
|  | int | num_matches_thresh2 = 6,
|  | double | matches_confidence_thresh = 3. )

Python:
| cv.detail.BestOf2NearestMatcher( | [, try_use_gpu[, match_conf[, num_matches_thresh1[, num_matches_thresh2[, matches_confidence_thresh]]]]] | ) -> | <detail_BestOf2NearestMatcher object>

Constructs a "best of 2 nearest" matcher.

Parameters

  try_use_gpu | Should try to use GPU or not
  match_conf | Match distances ration threshold
  num_matches_thresh1 | Minimum number of matches required for the 2D projective transform estimation used in the inliers classification step
  num_matches_thresh2 | Minimum number of matches required for the 2D projective transform re-estimation on inliers
  matches_confidence_thresh | Matching confidence threshold to take the match into account. The threshold was determined experimentally and set to 3 by default.

## Member Function Documentation

## ◆ collectGarbage()

void cv::detail::BestOf2NearestMatcher::collectGarbage | ( |  | ) |
| virtual

Python:
| cv.detail.BestOf2NearestMatcher.collectGarbage( |  | ) -> | None

Frees unused memory allocated before if there is any.

Reimplemented from cv::detail::FeaturesMatcher.

## ◆ create()

static Ptr< BestOf2NearestMatcher > cv::detail::BestOf2NearestMatcher::create | ( | bool | try_use_gpu = false,
|  | float | match_conf = 0.3f,
|  | int | num_matches_thresh1 = 6,
|  | int | num_matches_thresh2 = 6,
|  | double | matches_confidence_thresh = 3. )
| static

Python:
| cv.detail.BestOf2NearestMatcher.create( | [, try_use_gpu[, match_conf[, num_matches_thresh1[, num_matches_thresh2[, matches_confidence_thresh]]]]] | ) -> | retval
| cv.detail.BestOf2NearestMatcher_create( | [, try_use_gpu[, match_conf[, num_matches_thresh1[, num_matches_thresh2[, matches_confidence_thresh]]]]] | ) -> | retval

## ◆ match()

void cv::detail::BestOf2NearestMatcher::match | ( | const ImageFeatures & | features1,
|  | const ImageFeatures & | features2,
|  | MatchesInfo & | matches_info )
| protected virtual

This method must implement matching logic in order to make the wrappers detail::FeaturesMatcher::operator()_ work.

Parameters

  features1 | first image features
  features2 | second image features
  matches_info | found matches

Implements cv::detail::FeaturesMatcher.

Reimplemented in cv::detail::BestOf2NearestRangeMatcher.

## Member Data Documentation

## ◆ impl_

Ptr<FeaturesMatcher> cv::detail::BestOf2NearestMatcher::impl_
| protected

## ◆ matches_confidence_thresh_

double cv::detail::BestOf2NearestMatcher::matches_confidence_thresh_
| protected

## ◆ num_matches_thresh1_

int cv::detail::BestOf2NearestMatcher::num_matches_thresh1_
| protected

## ◆ num_matches_thresh2_

int cv::detail::BestOf2NearestMatcher::num_matches_thresh2_
| protected

The documentation for this class was generated from the following file:

- opencv2/stitching/detail/matchers.hpp