[][src]Struct opencv::features2d::BFMatcher

pub struct BFMatcher { /* fields omitted */ }

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.

Methods

impl BFMatcher[src]

pub fn new(norm_type: i32, cross_check: bool) -> Result<BFMatcher>[src]

Brute-force matcher constructor (obsolete). Please use BFMatcher.create()

C++ default parameters

  • norm_type: NORM_L2
  • cross_check: false

pub fn is_mask_supported(&self) -> Result<bool>[src]

pub fn create(norm_type: i32, cross_check: bool) -> Result<PtrOfBFMatcher>[src]

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.

C++ default parameters

  • norm_type: NORM_L2
  • cross_check: false

pub fn clone(&self, empty_train_data: bool) -> Result<PtrOfDescriptorMatcher>[src]

C++ default parameters

  • empty_train_data: false

Trait Implementations

impl Algorithm for BFMatcher[src]

fn clear(&mut self) -> Result<()>[src]

Clears the algorithm state

fn empty(&self) -> Result<bool>[src]

Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read

fn save(&self, filename: &str) -> Result<()>[src]

Saves the algorithm to a file. In order to make this method work, the derived class must implement Algorithm::write(FileStorage& fs). Read more

fn get_default_name(&self) -> Result<String>[src]

Returns the algorithm string identifier. This string is used as top level xml/yml node tag when the object is saved to a file or string. Read more

impl DescriptorMatcher for BFMatcher[src]

fn add(&mut self, descriptors: &VectorOfMat) -> Result<()>[src]

Adds descriptors to train a CPU(trainDescCollectionis) or GPU(utrainDescCollectionis) descriptor collection. Read more

fn get_train_descriptors(&self) -> Result<VectorOfMat>[src]

Returns a constant link to the train descriptor collection trainDescCollection .

fn clear(&mut self) -> Result<()>[src]

Clears the train descriptor collections.

fn empty(&self) -> Result<bool>[src]

Returns true if there are no train descriptors in the both collections.

fn is_mask_supported(&self) -> Result<bool>[src]

Returns true if the descriptor matcher supports masking permissible matches.

fn train(&mut self) -> Result<()>[src]

Trains a descriptor matcher Read more

fn train_matches(
    &self,
    query_descriptors: &Mat,
    train_descriptors: &Mat,
    matches: &VectorOfDMatch,
    mask: &Mat
) -> Result<()>
[src]

Finds the best match for each descriptor from a query set. Read more

fn knn_train_matches(
    &self,
    query_descriptors: &Mat,
    train_descriptors: &Mat,
    matches: &VectorOfVectorOfDMatch,
    k: i32,
    mask: &Mat,
    compact_result: bool
) -> Result<()>
[src]

Finds the k best matches for each descriptor from a query set. Read more

fn train_radius_matches(
    &self,
    query_descriptors: &Mat,
    train_descriptors: &Mat,
    matches: &VectorOfVectorOfDMatch,
    max_distance: f32,
    mask: &Mat,
    compact_result: bool
) -> Result<()>
[src]

For each query descriptor, finds the training descriptors not farther than the specified distance. Read more

fn matches(
    &mut self,
    query_descriptors: &Mat,
    matches: &VectorOfDMatch,
    masks: &VectorOfMat
) -> Result<()>
[src]

Parameters * queryDescriptors: Query set of descriptors. * matches: Matches. If a query descriptor is masked out in mask , no match is added for this descriptor. So, matches size may be smaller than the query descriptors count. * masks: Set of masks. Each masks[i] specifies permissible matches between the input query descriptors and stored train descriptors from the i-th image trainDescCollection[i]. Read more

fn knn_matches(
    &mut self,
    query_descriptors: &Mat,
    matches: &VectorOfVectorOfDMatch,
    k: i32,
    masks: &VectorOfMat,
    compact_result: bool
) -> Result<()>
[src]

Parameters * queryDescriptors: Query set of descriptors. * matches: Matches. Each matches[i] is k or less matches for the same query descriptor. * k: Count of best matches found per each query descriptor or less if a query descriptor has less than k possible matches in total. * masks: Set of masks. Each masks[i] specifies permissible matches between the input query descriptors and stored train descriptors from the i-th image trainDescCollection[i]. * compactResult: Parameter used when the mask (or masks) is not empty. If compactResult is false, the matches vector has the same size as queryDescriptors rows. If compactResult is true, the matches vector does not contain matches for fully masked-out query descriptors. Read more

fn radius_matches(
    &mut self,
    query_descriptors: &Mat,
    matches: &VectorOfVectorOfDMatch,
    max_distance: f32,
    masks: &VectorOfMat,
    compact_result: bool
) -> Result<()>
[src]

Parameters * queryDescriptors: Query set of descriptors. * matches: Found matches. * maxDistance: Threshold for the distance between matched descriptors. Distance means here metric distance (e.g. Hamming distance), not the distance between coordinates (which is measured in Pixels)! * masks: Set of masks. Each masks[i] specifies permissible matches between the input query descriptors and stored train descriptors from the i-th image trainDescCollection[i]. * compactResult: Parameter used when the mask (or masks) is not empty. If compactResult is false, the matches vector has the same size as queryDescriptors rows. If compactResult is true, the matches vector does not contain matches for fully masked-out query descriptors. Read more

fn write(&self, file_name: &str) -> Result<()>[src]

fn read(&mut self, file_name: &str) -> Result<()>[src]

fn clone(&self, empty_train_data: bool) -> Result<PtrOfDescriptorMatcher>[src]

Clones the matcher. Read more

impl Drop for BFMatcher[src]

Auto Trait Implementations

impl !Send for BFMatcher

impl !Sync for BFMatcher

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]