1 2 // 3 // This file is auto-generated. Please don't modify it! 4 // 5 package org.opencv.features2d; 6 7 import java.lang.String; 8 import java.util.ArrayList; 9 import java.util.List; 10 import org.opencv.core.Mat; 11 import org.opencv.core.MatOfDMatch; 12 import org.opencv.utils.Converters; 13 14 // C++: class javaDescriptorMatcher 15 //javadoc: javaDescriptorMatcher 16 public class DescriptorMatcher { 17 18 protected final long nativeObj; DescriptorMatcher(long addr)19 protected DescriptorMatcher(long addr) { nativeObj = addr; } 20 21 22 public static final int 23 FLANNBASED = 1, 24 BRUTEFORCE = 2, 25 BRUTEFORCE_L1 = 3, 26 BRUTEFORCE_HAMMING = 4, 27 BRUTEFORCE_HAMMINGLUT = 5, 28 BRUTEFORCE_SL2 = 6; 29 30 31 // 32 // C++: bool isMaskSupported() 33 // 34 35 //javadoc: javaDescriptorMatcher::isMaskSupported() isMaskSupported()36 public boolean isMaskSupported() 37 { 38 39 boolean retVal = isMaskSupported_0(nativeObj); 40 41 return retVal; 42 } 43 44 45 // 46 // C++: void add(vector_Mat descriptors) 47 // 48 49 //javadoc: javaDescriptorMatcher::add(descriptors) add(List<Mat> descriptors)50 public void add(List<Mat> descriptors) 51 { 52 Mat descriptors_mat = Converters.vector_Mat_to_Mat(descriptors); 53 add_0(nativeObj, descriptors_mat.nativeObj); 54 55 return; 56 } 57 58 59 // 60 // C++: vector_Mat getTrainDescriptors() 61 // 62 63 //javadoc: javaDescriptorMatcher::getTrainDescriptors() getTrainDescriptors()64 public List<Mat> getTrainDescriptors() 65 { 66 List<Mat> retVal = new ArrayList<Mat>(); 67 Mat retValMat = new Mat(getTrainDescriptors_0(nativeObj)); 68 Converters.Mat_to_vector_Mat(retValMat, retVal); 69 return retVal; 70 } 71 72 73 // 74 // C++: void clear() 75 // 76 77 //javadoc: javaDescriptorMatcher::clear() clear()78 public void clear() 79 { 80 81 clear_0(nativeObj); 82 83 return; 84 } 85 86 87 // 88 // C++: bool empty() 89 // 90 91 //javadoc: javaDescriptorMatcher::empty() empty()92 public boolean empty() 93 { 94 95 boolean retVal = empty_0(nativeObj); 96 97 return retVal; 98 } 99 100 101 // 102 // C++: void train() 103 // 104 105 //javadoc: javaDescriptorMatcher::train() train()106 public void train() 107 { 108 109 train_0(nativeObj); 110 111 return; 112 } 113 114 115 // 116 // C++: void match(Mat queryDescriptors, Mat trainDescriptors, vector_DMatch& matches, Mat mask = Mat()) 117 // 118 119 //javadoc: javaDescriptorMatcher::match(queryDescriptors, trainDescriptors, matches, mask) match(Mat queryDescriptors, Mat trainDescriptors, MatOfDMatch matches, Mat mask)120 public void match(Mat queryDescriptors, Mat trainDescriptors, MatOfDMatch matches, Mat mask) 121 { 122 Mat matches_mat = matches; 123 match_0(nativeObj, queryDescriptors.nativeObj, trainDescriptors.nativeObj, matches_mat.nativeObj, mask.nativeObj); 124 125 return; 126 } 127 128 //javadoc: javaDescriptorMatcher::match(queryDescriptors, trainDescriptors, matches) match(Mat queryDescriptors, Mat trainDescriptors, MatOfDMatch matches)129 public void match(Mat queryDescriptors, Mat trainDescriptors, MatOfDMatch matches) 130 { 131 Mat matches_mat = matches; 132 match_1(nativeObj, queryDescriptors.nativeObj, trainDescriptors.nativeObj, matches_mat.nativeObj); 133 134 return; 135 } 136 137 138 // 139 // C++: void knnMatch(Mat queryDescriptors, Mat trainDescriptors, vector_vector_DMatch& matches, int k, Mat mask = Mat(), bool compactResult = false) 140 // 141 142 //javadoc: javaDescriptorMatcher::knnMatch(queryDescriptors, trainDescriptors, matches, k, mask, compactResult) knnMatch(Mat queryDescriptors, Mat trainDescriptors, List<MatOfDMatch> matches, int k, Mat mask, boolean compactResult)143 public void knnMatch(Mat queryDescriptors, Mat trainDescriptors, List<MatOfDMatch> matches, int k, Mat mask, boolean compactResult) 144 { 145 Mat matches_mat = new Mat(); 146 knnMatch_0(nativeObj, queryDescriptors.nativeObj, trainDescriptors.nativeObj, matches_mat.nativeObj, k, mask.nativeObj, compactResult); 147 Converters.Mat_to_vector_vector_DMatch(matches_mat, matches); 148 matches_mat.release(); 149 return; 150 } 151 152 //javadoc: javaDescriptorMatcher::knnMatch(queryDescriptors, trainDescriptors, matches, k) knnMatch(Mat queryDescriptors, Mat trainDescriptors, List<MatOfDMatch> matches, int k)153 public void knnMatch(Mat queryDescriptors, Mat trainDescriptors, List<MatOfDMatch> matches, int k) 154 { 155 Mat matches_mat = new Mat(); 156 knnMatch_1(nativeObj, queryDescriptors.nativeObj, trainDescriptors.nativeObj, matches_mat.nativeObj, k); 157 Converters.Mat_to_vector_vector_DMatch(matches_mat, matches); 158 matches_mat.release(); 159 return; 160 } 161 162 163 // 164 // C++: void radiusMatch(Mat queryDescriptors, Mat trainDescriptors, vector_vector_DMatch& matches, float maxDistance, Mat mask = Mat(), bool compactResult = false) 165 // 166 167 //javadoc: javaDescriptorMatcher::radiusMatch(queryDescriptors, trainDescriptors, matches, maxDistance, mask, compactResult) radiusMatch(Mat queryDescriptors, Mat trainDescriptors, List<MatOfDMatch> matches, float maxDistance, Mat mask, boolean compactResult)168 public void radiusMatch(Mat queryDescriptors, Mat trainDescriptors, List<MatOfDMatch> matches, float maxDistance, Mat mask, boolean compactResult) 169 { 170 Mat matches_mat = new Mat(); 171 radiusMatch_0(nativeObj, queryDescriptors.nativeObj, trainDescriptors.nativeObj, matches_mat.nativeObj, maxDistance, mask.nativeObj, compactResult); 172 Converters.Mat_to_vector_vector_DMatch(matches_mat, matches); 173 matches_mat.release(); 174 return; 175 } 176 177 //javadoc: javaDescriptorMatcher::radiusMatch(queryDescriptors, trainDescriptors, matches, maxDistance) radiusMatch(Mat queryDescriptors, Mat trainDescriptors, List<MatOfDMatch> matches, float maxDistance)178 public void radiusMatch(Mat queryDescriptors, Mat trainDescriptors, List<MatOfDMatch> matches, float maxDistance) 179 { 180 Mat matches_mat = new Mat(); 181 radiusMatch_1(nativeObj, queryDescriptors.nativeObj, trainDescriptors.nativeObj, matches_mat.nativeObj, maxDistance); 182 Converters.Mat_to_vector_vector_DMatch(matches_mat, matches); 183 matches_mat.release(); 184 return; 185 } 186 187 188 // 189 // C++: void match(Mat queryDescriptors, vector_DMatch& matches, vector_Mat masks = std::vector<Mat>()) 190 // 191 192 //javadoc: javaDescriptorMatcher::match(queryDescriptors, matches, masks) match(Mat queryDescriptors, MatOfDMatch matches, List<Mat> masks)193 public void match(Mat queryDescriptors, MatOfDMatch matches, List<Mat> masks) 194 { 195 Mat matches_mat = matches; 196 Mat masks_mat = Converters.vector_Mat_to_Mat(masks); 197 match_2(nativeObj, queryDescriptors.nativeObj, matches_mat.nativeObj, masks_mat.nativeObj); 198 199 return; 200 } 201 202 //javadoc: javaDescriptorMatcher::match(queryDescriptors, matches) match(Mat queryDescriptors, MatOfDMatch matches)203 public void match(Mat queryDescriptors, MatOfDMatch matches) 204 { 205 Mat matches_mat = matches; 206 match_3(nativeObj, queryDescriptors.nativeObj, matches_mat.nativeObj); 207 208 return; 209 } 210 211 212 // 213 // C++: void knnMatch(Mat queryDescriptors, vector_vector_DMatch& matches, int k, vector_Mat masks = std::vector<Mat>(), bool compactResult = false) 214 // 215 216 //javadoc: javaDescriptorMatcher::knnMatch(queryDescriptors, matches, k, masks, compactResult) knnMatch(Mat queryDescriptors, List<MatOfDMatch> matches, int k, List<Mat> masks, boolean compactResult)217 public void knnMatch(Mat queryDescriptors, List<MatOfDMatch> matches, int k, List<Mat> masks, boolean compactResult) 218 { 219 Mat matches_mat = new Mat(); 220 Mat masks_mat = Converters.vector_Mat_to_Mat(masks); 221 knnMatch_2(nativeObj, queryDescriptors.nativeObj, matches_mat.nativeObj, k, masks_mat.nativeObj, compactResult); 222 Converters.Mat_to_vector_vector_DMatch(matches_mat, matches); 223 matches_mat.release(); 224 return; 225 } 226 227 //javadoc: javaDescriptorMatcher::knnMatch(queryDescriptors, matches, k) knnMatch(Mat queryDescriptors, List<MatOfDMatch> matches, int k)228 public void knnMatch(Mat queryDescriptors, List<MatOfDMatch> matches, int k) 229 { 230 Mat matches_mat = new Mat(); 231 knnMatch_3(nativeObj, queryDescriptors.nativeObj, matches_mat.nativeObj, k); 232 Converters.Mat_to_vector_vector_DMatch(matches_mat, matches); 233 matches_mat.release(); 234 return; 235 } 236 237 238 // 239 // C++: void radiusMatch(Mat queryDescriptors, vector_vector_DMatch& matches, float maxDistance, vector_Mat masks = std::vector<Mat>(), bool compactResult = false) 240 // 241 242 //javadoc: javaDescriptorMatcher::radiusMatch(queryDescriptors, matches, maxDistance, masks, compactResult) radiusMatch(Mat queryDescriptors, List<MatOfDMatch> matches, float maxDistance, List<Mat> masks, boolean compactResult)243 public void radiusMatch(Mat queryDescriptors, List<MatOfDMatch> matches, float maxDistance, List<Mat> masks, boolean compactResult) 244 { 245 Mat matches_mat = new Mat(); 246 Mat masks_mat = Converters.vector_Mat_to_Mat(masks); 247 radiusMatch_2(nativeObj, queryDescriptors.nativeObj, matches_mat.nativeObj, maxDistance, masks_mat.nativeObj, compactResult); 248 Converters.Mat_to_vector_vector_DMatch(matches_mat, matches); 249 matches_mat.release(); 250 return; 251 } 252 253 //javadoc: javaDescriptorMatcher::radiusMatch(queryDescriptors, matches, maxDistance) radiusMatch(Mat queryDescriptors, List<MatOfDMatch> matches, float maxDistance)254 public void radiusMatch(Mat queryDescriptors, List<MatOfDMatch> matches, float maxDistance) 255 { 256 Mat matches_mat = new Mat(); 257 radiusMatch_3(nativeObj, queryDescriptors.nativeObj, matches_mat.nativeObj, maxDistance); 258 Converters.Mat_to_vector_vector_DMatch(matches_mat, matches); 259 matches_mat.release(); 260 return; 261 } 262 263 264 // 265 // C++: javaDescriptorMatcher* jclone(bool emptyTrainData = false) 266 // 267 268 //javadoc: javaDescriptorMatcher::jclone(emptyTrainData) clone(boolean emptyTrainData)269 public DescriptorMatcher clone(boolean emptyTrainData) 270 { 271 272 DescriptorMatcher retVal = new DescriptorMatcher(clone_0(nativeObj, emptyTrainData)); 273 274 return retVal; 275 } 276 277 //javadoc: javaDescriptorMatcher::jclone() clone()278 public DescriptorMatcher clone() 279 { 280 281 DescriptorMatcher retVal = new DescriptorMatcher(clone_1(nativeObj)); 282 283 return retVal; 284 } 285 286 287 // 288 // C++: static javaDescriptorMatcher* create(int matcherType) 289 // 290 291 //javadoc: javaDescriptorMatcher::create(matcherType) create(int matcherType)292 public static DescriptorMatcher create(int matcherType) 293 { 294 295 DescriptorMatcher retVal = new DescriptorMatcher(create_0(matcherType)); 296 297 return retVal; 298 } 299 300 301 // 302 // C++: void write(String fileName) 303 // 304 305 //javadoc: javaDescriptorMatcher::write(fileName) write(String fileName)306 public void write(String fileName) 307 { 308 309 write_0(nativeObj, fileName); 310 311 return; 312 } 313 314 315 // 316 // C++: void read(String fileName) 317 // 318 319 //javadoc: javaDescriptorMatcher::read(fileName) read(String fileName)320 public void read(String fileName) 321 { 322 323 read_0(nativeObj, fileName); 324 325 return; 326 } 327 328 329 @Override finalize()330 protected void finalize() throws Throwable { 331 delete(nativeObj); 332 } 333 334 335 336 // C++: bool isMaskSupported() isMaskSupported_0(long nativeObj)337 private static native boolean isMaskSupported_0(long nativeObj); 338 339 // C++: void add(vector_Mat descriptors) add_0(long nativeObj, long descriptors_mat_nativeObj)340 private static native void add_0(long nativeObj, long descriptors_mat_nativeObj); 341 342 // C++: vector_Mat getTrainDescriptors() getTrainDescriptors_0(long nativeObj)343 private static native long getTrainDescriptors_0(long nativeObj); 344 345 // C++: void clear() clear_0(long nativeObj)346 private static native void clear_0(long nativeObj); 347 348 // C++: bool empty() empty_0(long nativeObj)349 private static native boolean empty_0(long nativeObj); 350 351 // C++: void train() train_0(long nativeObj)352 private static native void train_0(long nativeObj); 353 354 // C++: void match(Mat queryDescriptors, Mat trainDescriptors, vector_DMatch& matches, Mat mask = Mat()) match_0(long nativeObj, long queryDescriptors_nativeObj, long trainDescriptors_nativeObj, long matches_mat_nativeObj, long mask_nativeObj)355 private static native void match_0(long nativeObj, long queryDescriptors_nativeObj, long trainDescriptors_nativeObj, long matches_mat_nativeObj, long mask_nativeObj); match_1(long nativeObj, long queryDescriptors_nativeObj, long trainDescriptors_nativeObj, long matches_mat_nativeObj)356 private static native void match_1(long nativeObj, long queryDescriptors_nativeObj, long trainDescriptors_nativeObj, long matches_mat_nativeObj); 357 358 // C++: void knnMatch(Mat queryDescriptors, Mat trainDescriptors, vector_vector_DMatch& matches, int k, Mat mask = Mat(), bool compactResult = false) knnMatch_0(long nativeObj, long queryDescriptors_nativeObj, long trainDescriptors_nativeObj, long matches_mat_nativeObj, int k, long mask_nativeObj, boolean compactResult)359 private static native void knnMatch_0(long nativeObj, long queryDescriptors_nativeObj, long trainDescriptors_nativeObj, long matches_mat_nativeObj, int k, long mask_nativeObj, boolean compactResult); knnMatch_1(long nativeObj, long queryDescriptors_nativeObj, long trainDescriptors_nativeObj, long matches_mat_nativeObj, int k)360 private static native void knnMatch_1(long nativeObj, long queryDescriptors_nativeObj, long trainDescriptors_nativeObj, long matches_mat_nativeObj, int k); 361 362 // C++: void radiusMatch(Mat queryDescriptors, Mat trainDescriptors, vector_vector_DMatch& matches, float maxDistance, Mat mask = Mat(), bool compactResult = false) radiusMatch_0(long nativeObj, long queryDescriptors_nativeObj, long trainDescriptors_nativeObj, long matches_mat_nativeObj, float maxDistance, long mask_nativeObj, boolean compactResult)363 private static native void radiusMatch_0(long nativeObj, long queryDescriptors_nativeObj, long trainDescriptors_nativeObj, long matches_mat_nativeObj, float maxDistance, long mask_nativeObj, boolean compactResult); radiusMatch_1(long nativeObj, long queryDescriptors_nativeObj, long trainDescriptors_nativeObj, long matches_mat_nativeObj, float maxDistance)364 private static native void radiusMatch_1(long nativeObj, long queryDescriptors_nativeObj, long trainDescriptors_nativeObj, long matches_mat_nativeObj, float maxDistance); 365 366 // C++: void match(Mat queryDescriptors, vector_DMatch& matches, vector_Mat masks = std::vector<Mat>()) match_2(long nativeObj, long queryDescriptors_nativeObj, long matches_mat_nativeObj, long masks_mat_nativeObj)367 private static native void match_2(long nativeObj, long queryDescriptors_nativeObj, long matches_mat_nativeObj, long masks_mat_nativeObj); match_3(long nativeObj, long queryDescriptors_nativeObj, long matches_mat_nativeObj)368 private static native void match_3(long nativeObj, long queryDescriptors_nativeObj, long matches_mat_nativeObj); 369 370 // C++: void knnMatch(Mat queryDescriptors, vector_vector_DMatch& matches, int k, vector_Mat masks = std::vector<Mat>(), bool compactResult = false) knnMatch_2(long nativeObj, long queryDescriptors_nativeObj, long matches_mat_nativeObj, int k, long masks_mat_nativeObj, boolean compactResult)371 private static native void knnMatch_2(long nativeObj, long queryDescriptors_nativeObj, long matches_mat_nativeObj, int k, long masks_mat_nativeObj, boolean compactResult); knnMatch_3(long nativeObj, long queryDescriptors_nativeObj, long matches_mat_nativeObj, int k)372 private static native void knnMatch_3(long nativeObj, long queryDescriptors_nativeObj, long matches_mat_nativeObj, int k); 373 374 // C++: void radiusMatch(Mat queryDescriptors, vector_vector_DMatch& matches, float maxDistance, vector_Mat masks = std::vector<Mat>(), bool compactResult = false) radiusMatch_2(long nativeObj, long queryDescriptors_nativeObj, long matches_mat_nativeObj, float maxDistance, long masks_mat_nativeObj, boolean compactResult)375 private static native void radiusMatch_2(long nativeObj, long queryDescriptors_nativeObj, long matches_mat_nativeObj, float maxDistance, long masks_mat_nativeObj, boolean compactResult); radiusMatch_3(long nativeObj, long queryDescriptors_nativeObj, long matches_mat_nativeObj, float maxDistance)376 private static native void radiusMatch_3(long nativeObj, long queryDescriptors_nativeObj, long matches_mat_nativeObj, float maxDistance); 377 378 // C++: javaDescriptorMatcher* jclone(bool emptyTrainData = false) clone_0(long nativeObj, boolean emptyTrainData)379 private static native long clone_0(long nativeObj, boolean emptyTrainData); clone_1(long nativeObj)380 private static native long clone_1(long nativeObj); 381 382 // C++: static javaDescriptorMatcher* create(int matcherType) create_0(int matcherType)383 private static native long create_0(int matcherType); 384 385 // C++: void write(String fileName) write_0(long nativeObj, String fileName)386 private static native void write_0(long nativeObj, String fileName); 387 388 // C++: void read(String fileName) read_0(long nativeObj, String fileName)389 private static native void read_0(long nativeObj, String fileName); 390 391 // native support for java finalize() delete(long nativeObj)392 private static native void delete(long nativeObj); 393 394 } 395