Class cv::detail::BestOf2NearestMatcher#

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. View details

Collaboration diagram for cv::detail::BestOf2NearestMatcher:

Public Member Functions#

Public Member Functions inherited from cv::detail::FeaturesMatcher

Additional Inherited Members#

Protected Member Functions inherited from cv::detail::FeaturesMatcher

Return

Name

Description

FeaturesMatcher(bool is_thread_safe = false)

void

match(
    const ImageFeatures & features1,
    const ImageFeatures & features2,
    MatchesInfo & matches_info )

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

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 inherited from cv::detail::FeaturesMatcher

Return

Name

Description

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

Examples
samples/cpp/stitching_detailed.cpp.

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()

Python:

cv.detail.BestOf2NearestMatcher.collectGarbage()

Frees unused memory allocated before if there is any.

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. )

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 )

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

Member Data Documentation#

impl_#

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

matches_confidence_thresh_#

double cv::detail::BestOf2NearestMatcher::matches_confidence_thresh_

num_matches_thresh1_#

int cv::detail::BestOf2NearestMatcher::num_matches_thresh1_

num_matches_thresh2_#

int cv::detail::BestOf2NearestMatcher::num_matches_thresh2_

Source file#

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