001// 002// This file is auto-generated. Please don't modify it! 003// 004package org.opencv.features2d; 005 006import org.opencv.features2d.BFMatcher; 007import org.opencv.features2d.DescriptorMatcher; 008 009// C++: class BFMatcher 010/** 011 * Brute-force descriptor matcher. 012 * 013 * For each descriptor in the first set, this matcher finds the closest descriptor in the second set 014 * by trying each one. This descriptor matcher supports masking permissible matches of descriptor 015 * sets. 016 */ 017public class BFMatcher extends DescriptorMatcher { 018 019 protected BFMatcher(long addr) { super(addr); } 020 021 // internal usage only 022 public static BFMatcher __fromPtr__(long addr) { return new BFMatcher(addr); } 023 024 // 025 // C++: cv::BFMatcher::BFMatcher(int normType = NORM_L2, bool crossCheck = false) 026 // 027 028 /** 029 * Brute-force matcher constructor (obsolete). Please use BFMatcher.create() 030 * 031 * 032 * @param normType automatically generated 033 * @param crossCheck automatically generated 034 */ 035 public BFMatcher(int normType, boolean crossCheck) { 036 super(BFMatcher_0(normType, crossCheck)); 037 } 038 039 /** 040 * Brute-force matcher constructor (obsolete). Please use BFMatcher.create() 041 * 042 * 043 * @param normType automatically generated 044 */ 045 public BFMatcher(int normType) { 046 super(BFMatcher_1(normType)); 047 } 048 049 /** 050 * Brute-force matcher constructor (obsolete). Please use BFMatcher.create() 051 * 052 * 053 */ 054 public BFMatcher() { 055 super(BFMatcher_2()); 056 } 057 058 059 // 060 // C++: static Ptr_BFMatcher cv::BFMatcher::create(int normType = NORM_L2, bool crossCheck = false) 061 // 062 063 /** 064 * Brute-force matcher create method. 065 * @param normType One of NORM_L1, NORM_L2, NORM_HAMMING, NORM_HAMMING2. L1 and L2 norms are 066 * preferable choices for SIFT and SURF descriptors, NORM_HAMMING should be used with ORB, BRISK and 067 * BRIEF, NORM_HAMMING2 should be used with ORB when WTA_K==3 or 4 (see ORB::ORB constructor 068 * description). 069 * @param crossCheck If it is false, this is will be default BFMatcher behaviour when it finds the k 070 * nearest neighbors for each query descriptor. If crossCheck==true, then the knnMatch() method with 071 * k=1 will only return pairs (i,j) such that for i-th query descriptor the j-th descriptor in the 072 * matcher's collection is the nearest and vice versa, i.e. the BFMatcher will only return consistent 073 * pairs. Such technique usually produces best results with minimal number of outliers when there are 074 * enough matches. This is alternative to the ratio test, used by D. Lowe in SIFT paper. 075 * @return automatically generated 076 */ 077 public static BFMatcher create(int normType, boolean crossCheck) { 078 return BFMatcher.__fromPtr__(create_0(normType, crossCheck)); 079 } 080 081 /** 082 * Brute-force matcher create method. 083 * @param normType One of NORM_L1, NORM_L2, NORM_HAMMING, NORM_HAMMING2. L1 and L2 norms are 084 * preferable choices for SIFT and SURF descriptors, NORM_HAMMING should be used with ORB, BRISK and 085 * BRIEF, NORM_HAMMING2 should be used with ORB when WTA_K==3 or 4 (see ORB::ORB constructor 086 * description). 087 * nearest neighbors for each query descriptor. If crossCheck==true, then the knnMatch() method with 088 * k=1 will only return pairs (i,j) such that for i-th query descriptor the j-th descriptor in the 089 * matcher's collection is the nearest and vice versa, i.e. the BFMatcher will only return consistent 090 * pairs. Such technique usually produces best results with minimal number of outliers when there are 091 * enough matches. This is alternative to the ratio test, used by D. Lowe in SIFT paper. 092 * @return automatically generated 093 */ 094 public static BFMatcher create(int normType) { 095 return BFMatcher.__fromPtr__(create_1(normType)); 096 } 097 098 /** 099 * Brute-force matcher create method. 100 * preferable choices for SIFT and SURF descriptors, NORM_HAMMING should be used with ORB, BRISK and 101 * BRIEF, NORM_HAMMING2 should be used with ORB when WTA_K==3 or 4 (see ORB::ORB constructor 102 * description). 103 * nearest neighbors for each query descriptor. If crossCheck==true, then the knnMatch() method with 104 * k=1 will only return pairs (i,j) such that for i-th query descriptor the j-th descriptor in the 105 * matcher's collection is the nearest and vice versa, i.e. the BFMatcher will only return consistent 106 * pairs. Such technique usually produces best results with minimal number of outliers when there are 107 * enough matches. This is alternative to the ratio test, used by D. Lowe in SIFT paper. 108 * @return automatically generated 109 */ 110 public static BFMatcher create() { 111 return BFMatcher.__fromPtr__(create_2()); 112 } 113 114 115 @Override 116 protected void finalize() throws Throwable { 117 delete(nativeObj); 118 } 119 120 121 122 // C++: cv::BFMatcher::BFMatcher(int normType = NORM_L2, bool crossCheck = false) 123 private static native long BFMatcher_0(int normType, boolean crossCheck); 124 private static native long BFMatcher_1(int normType); 125 private static native long BFMatcher_2(); 126 127 // C++: static Ptr_BFMatcher cv::BFMatcher::create(int normType = NORM_L2, bool crossCheck = false) 128 private static native long create_0(int normType, boolean crossCheck); 129 private static native long create_1(int normType); 130 private static native long create_2(); 131 132 // native support for java finalize() 133 private static native void delete(long nativeObj); 134 135}