001//
002// This file is auto-generated. Please don't modify it!
003//
004package org.opencv.features2d;
005
006import java.util.ArrayList;
007import java.util.List;
008import org.opencv.core.Algorithm;
009import org.opencv.core.Mat;
010import org.opencv.core.MatOfDMatch;
011import org.opencv.features2d.DescriptorMatcher;
012import org.opencv.utils.Converters;
013
014// C++: class DescriptorMatcher
015/**
016 * Abstract base class for matching keypoint descriptors.
017 *
018 * It has two groups of match methods: for matching descriptors of an image with another image or with
019 * an image set.
020 */
021public class DescriptorMatcher extends Algorithm {
022
023    protected DescriptorMatcher(long addr) { super(addr); }
024
025    // internal usage only
026    public static DescriptorMatcher __fromPtr__(long addr) { return new DescriptorMatcher(addr); }
027
028    // C++: enum MatcherType (cv.DescriptorMatcher.MatcherType)
029    public static final int
030            FLANNBASED = 1,
031            BRUTEFORCE = 2,
032            BRUTEFORCE_L1 = 3,
033            BRUTEFORCE_HAMMING = 4,
034            BRUTEFORCE_HAMMINGLUT = 5,
035            BRUTEFORCE_SL2 = 6;
036
037
038    //
039    // C++:  void cv::DescriptorMatcher::add(vector_Mat descriptors)
040    //
041
042    /**
043     * Adds descriptors to train a CPU(trainDescCollectionis) or GPU(utrainDescCollectionis) descriptor
044     *     collection.
045     *
046     *     If the collection is not empty, the new descriptors are added to existing train descriptors.
047     *
048     *     @param descriptors Descriptors to add. Each descriptors[i] is a set of descriptors from the same
049     *     train image.
050     */
051    public void add(List<Mat> descriptors) {
052        Mat descriptors_mat = Converters.vector_Mat_to_Mat(descriptors);
053        add_0(nativeObj, descriptors_mat.nativeObj);
054    }
055
056
057    //
058    // C++:  vector_Mat cv::DescriptorMatcher::getTrainDescriptors()
059    //
060
061    /**
062     * Returns a constant link to the train descriptor collection trainDescCollection .
063     * @return automatically generated
064     */
065    public List<Mat> getTrainDescriptors() {
066        List<Mat> retVal = new ArrayList<Mat>();
067        Mat retValMat = new Mat(getTrainDescriptors_0(nativeObj));
068        Converters.Mat_to_vector_Mat(retValMat, retVal);
069        return retVal;
070    }
071
072
073    //
074    // C++:  void cv::DescriptorMatcher::clear()
075    //
076
077    /**
078     * Clears the train descriptor collections.
079     */
080    public void clear() {
081        clear_0(nativeObj);
082    }
083
084
085    //
086    // C++:  bool cv::DescriptorMatcher::empty()
087    //
088
089    /**
090     * Returns true if there are no train descriptors in the both collections.
091     * @return automatically generated
092     */
093    public boolean empty() {
094        return empty_0(nativeObj);
095    }
096
097
098    //
099    // C++:  bool cv::DescriptorMatcher::isMaskSupported()
100    //
101
102    /**
103     * Returns true if the descriptor matcher supports masking permissible matches.
104     * @return automatically generated
105     */
106    public boolean isMaskSupported() {
107        return isMaskSupported_0(nativeObj);
108    }
109
110
111    //
112    // C++:  void cv::DescriptorMatcher::train()
113    //
114
115    /**
116     * Trains a descriptor matcher
117     *
118     *     Trains a descriptor matcher (for example, the flann index). In all methods to match, the method
119     *     train() is run every time before matching. Some descriptor matchers (for example, BruteForceMatcher)
120     *     have an empty implementation of this method. Other matchers really train their inner structures (for
121     *     example, FlannBasedMatcher trains flann::Index ).
122     */
123    public void train() {
124        train_0(nativeObj);
125    }
126
127
128    //
129    // C++:  void cv::DescriptorMatcher::match(Mat queryDescriptors, Mat trainDescriptors, vector_DMatch& matches, Mat mask = Mat())
130    //
131
132    /**
133     * Finds the best match for each descriptor from a query set.
134     *
135     *     @param queryDescriptors Query set of descriptors.
136     *     @param trainDescriptors Train set of descriptors. This set is not added to the train descriptors
137     *     collection stored in the class object.
138     *     @param matches Matches. If a query descriptor is masked out in mask , no match is added for this
139     *     descriptor. So, matches size may be smaller than the query descriptors count.
140     *     @param mask Mask specifying permissible matches between an input query and train matrices of
141     *     descriptors.
142     *
143     *     In the first variant of this method, the train descriptors are passed as an input argument. In the
144     *     second variant of the method, train descriptors collection that was set by DescriptorMatcher::add is
145     *     used. Optional mask (or masks) can be passed to specify which query and training descriptors can be
146     *     matched. Namely, queryDescriptors[i] can be matched with trainDescriptors[j] only if
147     *     mask.at&lt;uchar&gt;(i,j) is non-zero.
148     */
149    public void match(Mat queryDescriptors, Mat trainDescriptors, MatOfDMatch matches, Mat mask) {
150        Mat matches_mat = matches;
151        match_0(nativeObj, queryDescriptors.nativeObj, trainDescriptors.nativeObj, matches_mat.nativeObj, mask.nativeObj);
152    }
153
154    /**
155     * Finds the best match for each descriptor from a query set.
156     *
157     *     @param queryDescriptors Query set of descriptors.
158     *     @param trainDescriptors Train set of descriptors. This set is not added to the train descriptors
159     *     collection stored in the class object.
160     *     @param matches Matches. If a query descriptor is masked out in mask , no match is added for this
161     *     descriptor. So, matches size may be smaller than the query descriptors count.
162     *     descriptors.
163     *
164     *     In the first variant of this method, the train descriptors are passed as an input argument. In the
165     *     second variant of the method, train descriptors collection that was set by DescriptorMatcher::add is
166     *     used. Optional mask (or masks) can be passed to specify which query and training descriptors can be
167     *     matched. Namely, queryDescriptors[i] can be matched with trainDescriptors[j] only if
168     *     mask.at&lt;uchar&gt;(i,j) is non-zero.
169     */
170    public void match(Mat queryDescriptors, Mat trainDescriptors, MatOfDMatch matches) {
171        Mat matches_mat = matches;
172        match_1(nativeObj, queryDescriptors.nativeObj, trainDescriptors.nativeObj, matches_mat.nativeObj);
173    }
174
175
176    //
177    // C++:  void cv::DescriptorMatcher::knnMatch(Mat queryDescriptors, Mat trainDescriptors, vector_vector_DMatch& matches, int k, Mat mask = Mat(), bool compactResult = false)
178    //
179
180    /**
181     * Finds the k best matches for each descriptor from a query set.
182     *
183     *     @param queryDescriptors Query set of descriptors.
184     *     @param trainDescriptors Train set of descriptors. This set is not added to the train descriptors
185     *     collection stored in the class object.
186     *     @param mask Mask specifying permissible matches between an input query and train matrices of
187     *     descriptors.
188     *     @param matches Matches. Each matches[i] is k or less matches for the same query descriptor.
189     *     @param k Count of best matches found per each query descriptor or less if a query descriptor has
190     *     less than k possible matches in total.
191     *     @param compactResult Parameter used when the mask (or masks) is not empty. If compactResult is
192     *     false, the matches vector has the same size as queryDescriptors rows. If compactResult is true,
193     *     the matches vector does not contain matches for fully masked-out query descriptors.
194     *
195     *     These extended variants of DescriptorMatcher::match methods find several best matches for each query
196     *     descriptor. The matches are returned in the distance increasing order. See DescriptorMatcher::match
197     *     for the details about query and train descriptors.
198     */
199    public void knnMatch(Mat queryDescriptors, Mat trainDescriptors, List<MatOfDMatch> matches, int k, Mat mask, boolean compactResult) {
200        Mat matches_mat = new Mat();
201        knnMatch_0(nativeObj, queryDescriptors.nativeObj, trainDescriptors.nativeObj, matches_mat.nativeObj, k, mask.nativeObj, compactResult);
202        Converters.Mat_to_vector_vector_DMatch(matches_mat, matches);
203        matches_mat.release();
204    }
205
206    /**
207     * Finds the k best matches for each descriptor from a query set.
208     *
209     *     @param queryDescriptors Query set of descriptors.
210     *     @param trainDescriptors Train set of descriptors. This set is not added to the train descriptors
211     *     collection stored in the class object.
212     *     @param mask Mask specifying permissible matches between an input query and train matrices of
213     *     descriptors.
214     *     @param matches Matches. Each matches[i] is k or less matches for the same query descriptor.
215     *     @param k Count of best matches found per each query descriptor or less if a query descriptor has
216     *     less than k possible matches in total.
217     *     false, the matches vector has the same size as queryDescriptors rows. If compactResult is true,
218     *     the matches vector does not contain matches for fully masked-out query descriptors.
219     *
220     *     These extended variants of DescriptorMatcher::match methods find several best matches for each query
221     *     descriptor. The matches are returned in the distance increasing order. See DescriptorMatcher::match
222     *     for the details about query and train descriptors.
223     */
224    public void knnMatch(Mat queryDescriptors, Mat trainDescriptors, List<MatOfDMatch> matches, int k, Mat mask) {
225        Mat matches_mat = new Mat();
226        knnMatch_1(nativeObj, queryDescriptors.nativeObj, trainDescriptors.nativeObj, matches_mat.nativeObj, k, mask.nativeObj);
227        Converters.Mat_to_vector_vector_DMatch(matches_mat, matches);
228        matches_mat.release();
229    }
230
231    /**
232     * Finds the k best matches for each descriptor from a query set.
233     *
234     *     @param queryDescriptors Query set of descriptors.
235     *     @param trainDescriptors Train set of descriptors. This set is not added to the train descriptors
236     *     collection stored in the class object.
237     *     descriptors.
238     *     @param matches Matches. Each matches[i] is k or less matches for the same query descriptor.
239     *     @param k Count of best matches found per each query descriptor or less if a query descriptor has
240     *     less than k possible matches in total.
241     *     false, the matches vector has the same size as queryDescriptors rows. If compactResult is true,
242     *     the matches vector does not contain matches for fully masked-out query descriptors.
243     *
244     *     These extended variants of DescriptorMatcher::match methods find several best matches for each query
245     *     descriptor. The matches are returned in the distance increasing order. See DescriptorMatcher::match
246     *     for the details about query and train descriptors.
247     */
248    public void knnMatch(Mat queryDescriptors, Mat trainDescriptors, List<MatOfDMatch> matches, int k) {
249        Mat matches_mat = new Mat();
250        knnMatch_2(nativeObj, queryDescriptors.nativeObj, trainDescriptors.nativeObj, matches_mat.nativeObj, k);
251        Converters.Mat_to_vector_vector_DMatch(matches_mat, matches);
252        matches_mat.release();
253    }
254
255
256    //
257    // C++:  void cv::DescriptorMatcher::radiusMatch(Mat queryDescriptors, Mat trainDescriptors, vector_vector_DMatch& matches, float maxDistance, Mat mask = Mat(), bool compactResult = false)
258    //
259
260    /**
261     * For each query descriptor, finds the training descriptors not farther than the specified distance.
262     *
263     *     @param queryDescriptors Query set of descriptors.
264     *     @param trainDescriptors Train set of descriptors. This set is not added to the train descriptors
265     *     collection stored in the class object.
266     *     @param matches Found matches.
267     *     @param compactResult Parameter used when the mask (or masks) is not empty. If compactResult is
268     *     false, the matches vector has the same size as queryDescriptors rows. If compactResult is true,
269     *     the matches vector does not contain matches for fully masked-out query descriptors.
270     *     @param maxDistance Threshold for the distance between matched descriptors. Distance means here
271     *     metric distance (e.g. Hamming distance), not the distance between coordinates (which is measured
272     *     in Pixels)!
273     *     @param mask Mask specifying permissible matches between an input query and train matrices of
274     *     descriptors.
275     *
276     *     For each query descriptor, the methods find such training descriptors that the distance between the
277     *     query descriptor and the training descriptor is equal or smaller than maxDistance. Found matches are
278     *     returned in the distance increasing order.
279     */
280    public void radiusMatch(Mat queryDescriptors, Mat trainDescriptors, List<MatOfDMatch> matches, float maxDistance, Mat mask, boolean compactResult) {
281        Mat matches_mat = new Mat();
282        radiusMatch_0(nativeObj, queryDescriptors.nativeObj, trainDescriptors.nativeObj, matches_mat.nativeObj, maxDistance, mask.nativeObj, compactResult);
283        Converters.Mat_to_vector_vector_DMatch(matches_mat, matches);
284        matches_mat.release();
285    }
286
287    /**
288     * For each query descriptor, finds the training descriptors not farther than the specified distance.
289     *
290     *     @param queryDescriptors Query set of descriptors.
291     *     @param trainDescriptors Train set of descriptors. This set is not added to the train descriptors
292     *     collection stored in the class object.
293     *     @param matches Found matches.
294     *     false, the matches vector has the same size as queryDescriptors rows. If compactResult is true,
295     *     the matches vector does not contain matches for fully masked-out query descriptors.
296     *     @param maxDistance Threshold for the distance between matched descriptors. Distance means here
297     *     metric distance (e.g. Hamming distance), not the distance between coordinates (which is measured
298     *     in Pixels)!
299     *     @param mask Mask specifying permissible matches between an input query and train matrices of
300     *     descriptors.
301     *
302     *     For each query descriptor, the methods find such training descriptors that the distance between the
303     *     query descriptor and the training descriptor is equal or smaller than maxDistance. Found matches are
304     *     returned in the distance increasing order.
305     */
306    public void radiusMatch(Mat queryDescriptors, Mat trainDescriptors, List<MatOfDMatch> matches, float maxDistance, Mat mask) {
307        Mat matches_mat = new Mat();
308        radiusMatch_1(nativeObj, queryDescriptors.nativeObj, trainDescriptors.nativeObj, matches_mat.nativeObj, maxDistance, mask.nativeObj);
309        Converters.Mat_to_vector_vector_DMatch(matches_mat, matches);
310        matches_mat.release();
311    }
312
313    /**
314     * For each query descriptor, finds the training descriptors not farther than the specified distance.
315     *
316     *     @param queryDescriptors Query set of descriptors.
317     *     @param trainDescriptors Train set of descriptors. This set is not added to the train descriptors
318     *     collection stored in the class object.
319     *     @param matches Found matches.
320     *     false, the matches vector has the same size as queryDescriptors rows. If compactResult is true,
321     *     the matches vector does not contain matches for fully masked-out query descriptors.
322     *     @param maxDistance Threshold for the distance between matched descriptors. Distance means here
323     *     metric distance (e.g. Hamming distance), not the distance between coordinates (which is measured
324     *     in Pixels)!
325     *     descriptors.
326     *
327     *     For each query descriptor, the methods find such training descriptors that the distance between the
328     *     query descriptor and the training descriptor is equal or smaller than maxDistance. Found matches are
329     *     returned in the distance increasing order.
330     */
331    public void radiusMatch(Mat queryDescriptors, Mat trainDescriptors, List<MatOfDMatch> matches, float maxDistance) {
332        Mat matches_mat = new Mat();
333        radiusMatch_2(nativeObj, queryDescriptors.nativeObj, trainDescriptors.nativeObj, matches_mat.nativeObj, maxDistance);
334        Converters.Mat_to_vector_vector_DMatch(matches_mat, matches);
335        matches_mat.release();
336    }
337
338
339    //
340    // C++:  void cv::DescriptorMatcher::match(Mat queryDescriptors, vector_DMatch& matches, vector_Mat masks = vector_Mat())
341    //
342
343    /**
344     *
345     *     @param queryDescriptors Query set of descriptors.
346     *     @param matches Matches. If a query descriptor is masked out in mask , no match is added for this
347     *     descriptor. So, matches size may be smaller than the query descriptors count.
348     *     @param masks Set of masks. Each masks[i] specifies permissible matches between the input query
349     *     descriptors and stored train descriptors from the i-th image trainDescCollection[i].
350     */
351    public void match(Mat queryDescriptors, MatOfDMatch matches, List<Mat> masks) {
352        Mat matches_mat = matches;
353        Mat masks_mat = Converters.vector_Mat_to_Mat(masks);
354        match_2(nativeObj, queryDescriptors.nativeObj, matches_mat.nativeObj, masks_mat.nativeObj);
355    }
356
357    /**
358     *
359     *     @param queryDescriptors Query set of descriptors.
360     *     @param matches Matches. If a query descriptor is masked out in mask , no match is added for this
361     *     descriptor. So, matches size may be smaller than the query descriptors count.
362     *     descriptors and stored train descriptors from the i-th image trainDescCollection[i].
363     */
364    public void match(Mat queryDescriptors, MatOfDMatch matches) {
365        Mat matches_mat = matches;
366        match_3(nativeObj, queryDescriptors.nativeObj, matches_mat.nativeObj);
367    }
368
369
370    //
371    // C++:  void cv::DescriptorMatcher::knnMatch(Mat queryDescriptors, vector_vector_DMatch& matches, int k, vector_Mat masks = vector_Mat(), bool compactResult = false)
372    //
373
374    /**
375     *
376     *     @param queryDescriptors Query set of descriptors.
377     *     @param matches Matches. Each matches[i] is k or less matches for the same query descriptor.
378     *     @param k Count of best matches found per each query descriptor or less if a query descriptor has
379     *     less than k possible matches in total.
380     *     @param masks Set of masks. Each masks[i] specifies permissible matches between the input query
381     *     descriptors and stored train descriptors from the i-th image trainDescCollection[i].
382     *     @param compactResult Parameter used when the mask (or masks) is not empty. If compactResult is
383     *     false, the matches vector has the same size as queryDescriptors rows. If compactResult is true,
384     *     the matches vector does not contain matches for fully masked-out query descriptors.
385     */
386    public void knnMatch(Mat queryDescriptors, List<MatOfDMatch> matches, int k, List<Mat> masks, boolean compactResult) {
387        Mat matches_mat = new Mat();
388        Mat masks_mat = Converters.vector_Mat_to_Mat(masks);
389        knnMatch_3(nativeObj, queryDescriptors.nativeObj, matches_mat.nativeObj, k, masks_mat.nativeObj, compactResult);
390        Converters.Mat_to_vector_vector_DMatch(matches_mat, matches);
391        matches_mat.release();
392    }
393
394    /**
395     *
396     *     @param queryDescriptors Query set of descriptors.
397     *     @param matches Matches. Each matches[i] is k or less matches for the same query descriptor.
398     *     @param k Count of best matches found per each query descriptor or less if a query descriptor has
399     *     less than k possible matches in total.
400     *     @param masks Set of masks. Each masks[i] specifies permissible matches between the input query
401     *     descriptors and stored train descriptors from the i-th image trainDescCollection[i].
402     *     false, the matches vector has the same size as queryDescriptors rows. If compactResult is true,
403     *     the matches vector does not contain matches for fully masked-out query descriptors.
404     */
405    public void knnMatch(Mat queryDescriptors, List<MatOfDMatch> matches, int k, List<Mat> masks) {
406        Mat matches_mat = new Mat();
407        Mat masks_mat = Converters.vector_Mat_to_Mat(masks);
408        knnMatch_4(nativeObj, queryDescriptors.nativeObj, matches_mat.nativeObj, k, masks_mat.nativeObj);
409        Converters.Mat_to_vector_vector_DMatch(matches_mat, matches);
410        matches_mat.release();
411    }
412
413    /**
414     *
415     *     @param queryDescriptors Query set of descriptors.
416     *     @param matches Matches. Each matches[i] is k or less matches for the same query descriptor.
417     *     @param k Count of best matches found per each query descriptor or less if a query descriptor has
418     *     less than k possible matches in total.
419     *     descriptors and stored train descriptors from the i-th image trainDescCollection[i].
420     *     false, the matches vector has the same size as queryDescriptors rows. If compactResult is true,
421     *     the matches vector does not contain matches for fully masked-out query descriptors.
422     */
423    public void knnMatch(Mat queryDescriptors, List<MatOfDMatch> matches, int k) {
424        Mat matches_mat = new Mat();
425        knnMatch_5(nativeObj, queryDescriptors.nativeObj, matches_mat.nativeObj, k);
426        Converters.Mat_to_vector_vector_DMatch(matches_mat, matches);
427        matches_mat.release();
428    }
429
430
431    //
432    // C++:  void cv::DescriptorMatcher::radiusMatch(Mat queryDescriptors, vector_vector_DMatch& matches, float maxDistance, vector_Mat masks = vector_Mat(), bool compactResult = false)
433    //
434
435    /**
436     *
437     *     @param queryDescriptors Query set of descriptors.
438     *     @param matches Found matches.
439     *     @param maxDistance Threshold for the distance between matched descriptors. Distance means here
440     *     metric distance (e.g. Hamming distance), not the distance between coordinates (which is measured
441     *     in Pixels)!
442     *     @param masks Set of masks. Each masks[i] specifies permissible matches between the input query
443     *     descriptors and stored train descriptors from the i-th image trainDescCollection[i].
444     *     @param compactResult Parameter used when the mask (or masks) is not empty. If compactResult is
445     *     false, the matches vector has the same size as queryDescriptors rows. If compactResult is true,
446     *     the matches vector does not contain matches for fully masked-out query descriptors.
447     */
448    public void radiusMatch(Mat queryDescriptors, List<MatOfDMatch> matches, float maxDistance, List<Mat> masks, boolean compactResult) {
449        Mat matches_mat = new Mat();
450        Mat masks_mat = Converters.vector_Mat_to_Mat(masks);
451        radiusMatch_3(nativeObj, queryDescriptors.nativeObj, matches_mat.nativeObj, maxDistance, masks_mat.nativeObj, compactResult);
452        Converters.Mat_to_vector_vector_DMatch(matches_mat, matches);
453        matches_mat.release();
454    }
455
456    /**
457     *
458     *     @param queryDescriptors Query set of descriptors.
459     *     @param matches Found matches.
460     *     @param maxDistance Threshold for the distance between matched descriptors. Distance means here
461     *     metric distance (e.g. Hamming distance), not the distance between coordinates (which is measured
462     *     in Pixels)!
463     *     @param masks Set of masks. Each masks[i] specifies permissible matches between the input query
464     *     descriptors and stored train descriptors from the i-th image trainDescCollection[i].
465     *     false, the matches vector has the same size as queryDescriptors rows. If compactResult is true,
466     *     the matches vector does not contain matches for fully masked-out query descriptors.
467     */
468    public void radiusMatch(Mat queryDescriptors, List<MatOfDMatch> matches, float maxDistance, List<Mat> masks) {
469        Mat matches_mat = new Mat();
470        Mat masks_mat = Converters.vector_Mat_to_Mat(masks);
471        radiusMatch_4(nativeObj, queryDescriptors.nativeObj, matches_mat.nativeObj, maxDistance, masks_mat.nativeObj);
472        Converters.Mat_to_vector_vector_DMatch(matches_mat, matches);
473        matches_mat.release();
474    }
475
476    /**
477     *
478     *     @param queryDescriptors Query set of descriptors.
479     *     @param matches Found matches.
480     *     @param maxDistance Threshold for the distance between matched descriptors. Distance means here
481     *     metric distance (e.g. Hamming distance), not the distance between coordinates (which is measured
482     *     in Pixels)!
483     *     descriptors and stored train descriptors from the i-th image trainDescCollection[i].
484     *     false, the matches vector has the same size as queryDescriptors rows. If compactResult is true,
485     *     the matches vector does not contain matches for fully masked-out query descriptors.
486     */
487    public void radiusMatch(Mat queryDescriptors, List<MatOfDMatch> matches, float maxDistance) {
488        Mat matches_mat = new Mat();
489        radiusMatch_5(nativeObj, queryDescriptors.nativeObj, matches_mat.nativeObj, maxDistance);
490        Converters.Mat_to_vector_vector_DMatch(matches_mat, matches);
491        matches_mat.release();
492    }
493
494
495    //
496    // C++:  void cv::DescriptorMatcher::write(String fileName)
497    //
498
499    public void write(String fileName) {
500        write_0(nativeObj, fileName);
501    }
502
503
504    //
505    // C++:  void cv::DescriptorMatcher::read(String fileName)
506    //
507
508    public void read(String fileName) {
509        read_0(nativeObj, fileName);
510    }
511
512
513    //
514    // C++:  void cv::DescriptorMatcher::read(FileNode arg1)
515    //
516
517    // Unknown type 'FileNode' (I), skipping the function
518
519
520    //
521    // C++:  Ptr_DescriptorMatcher cv::DescriptorMatcher::clone(bool emptyTrainData = false)
522    //
523
524    /**
525     * Clones the matcher.
526     *
527     *     @param emptyTrainData If emptyTrainData is false, the method creates a deep copy of the object,
528     *     that is, copies both parameters and train data. If emptyTrainData is true, the method creates an
529     *     object copy with the current parameters but with empty train data.
530     * @return automatically generated
531     */
532    public DescriptorMatcher clone(boolean emptyTrainData) {
533        return DescriptorMatcher.__fromPtr__(clone_0(nativeObj, emptyTrainData));
534    }
535
536    /**
537     * Clones the matcher.
538     *
539     *     that is, copies both parameters and train data. If emptyTrainData is true, the method creates an
540     *     object copy with the current parameters but with empty train data.
541     * @return automatically generated
542     */
543    public DescriptorMatcher clone() {
544        return DescriptorMatcher.__fromPtr__(clone_1(nativeObj));
545    }
546
547
548    //
549    // C++: static Ptr_DescriptorMatcher cv::DescriptorMatcher::create(String descriptorMatcherType)
550    //
551
552    /**
553     * Creates a descriptor matcher of a given type with the default parameters (using default
554     *     constructor).
555     *
556     *     @param descriptorMatcherType Descriptor matcher type. Now the following matcher types are
557     *     supported:
558     * <ul>
559     *   <li>
560     *        {@code BruteForce} (it uses L2 )
561     *   </li>
562     *   <li>
563     *        {@code BruteForce-L1}
564     *   </li>
565     *   <li>
566     *        {@code BruteForce-Hamming}
567     *   </li>
568     *   <li>
569     *        {@code BruteForce-Hamming(2)}
570     *   </li>
571     *   <li>
572     *        {@code FlannBased}
573     *   </li>
574     * </ul>
575     * @return automatically generated
576     */
577    public static DescriptorMatcher create(String descriptorMatcherType) {
578        return DescriptorMatcher.__fromPtr__(create_0(descriptorMatcherType));
579    }
580
581
582    //
583    // C++: static Ptr_DescriptorMatcher cv::DescriptorMatcher::create(DescriptorMatcher_MatcherType matcherType)
584    //
585
586    public static DescriptorMatcher create(int matcherType) {
587        return DescriptorMatcher.__fromPtr__(create_1(matcherType));
588    }
589
590
591    //
592    // C++:  void cv::DescriptorMatcher::write(Ptr_FileStorage fs, String name = String())
593    //
594
595    // Unknown type 'Ptr_FileStorage' (I), skipping the function
596
597
598    @Override
599    protected void finalize() throws Throwable {
600        delete(nativeObj);
601    }
602
603
604
605    // C++:  void cv::DescriptorMatcher::add(vector_Mat descriptors)
606    private static native void add_0(long nativeObj, long descriptors_mat_nativeObj);
607
608    // C++:  vector_Mat cv::DescriptorMatcher::getTrainDescriptors()
609    private static native long getTrainDescriptors_0(long nativeObj);
610
611    // C++:  void cv::DescriptorMatcher::clear()
612    private static native void clear_0(long nativeObj);
613
614    // C++:  bool cv::DescriptorMatcher::empty()
615    private static native boolean empty_0(long nativeObj);
616
617    // C++:  bool cv::DescriptorMatcher::isMaskSupported()
618    private static native boolean isMaskSupported_0(long nativeObj);
619
620    // C++:  void cv::DescriptorMatcher::train()
621    private static native void train_0(long nativeObj);
622
623    // C++:  void cv::DescriptorMatcher::match(Mat queryDescriptors, Mat trainDescriptors, vector_DMatch& matches, Mat mask = Mat())
624    private static native void match_0(long nativeObj, long queryDescriptors_nativeObj, long trainDescriptors_nativeObj, long matches_mat_nativeObj, long mask_nativeObj);
625    private static native void match_1(long nativeObj, long queryDescriptors_nativeObj, long trainDescriptors_nativeObj, long matches_mat_nativeObj);
626
627    // C++:  void cv::DescriptorMatcher::knnMatch(Mat queryDescriptors, Mat trainDescriptors, vector_vector_DMatch& matches, int k, Mat mask = Mat(), bool compactResult = false)
628    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);
629    private static native void knnMatch_1(long nativeObj, long queryDescriptors_nativeObj, long trainDescriptors_nativeObj, long matches_mat_nativeObj, int k, long mask_nativeObj);
630    private static native void knnMatch_2(long nativeObj, long queryDescriptors_nativeObj, long trainDescriptors_nativeObj, long matches_mat_nativeObj, int k);
631
632    // C++:  void cv::DescriptorMatcher::radiusMatch(Mat queryDescriptors, Mat trainDescriptors, vector_vector_DMatch& matches, float maxDistance, Mat mask = Mat(), bool compactResult = false)
633    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);
634    private static native void radiusMatch_1(long nativeObj, long queryDescriptors_nativeObj, long trainDescriptors_nativeObj, long matches_mat_nativeObj, float maxDistance, long mask_nativeObj);
635    private static native void radiusMatch_2(long nativeObj, long queryDescriptors_nativeObj, long trainDescriptors_nativeObj, long matches_mat_nativeObj, float maxDistance);
636
637    // C++:  void cv::DescriptorMatcher::match(Mat queryDescriptors, vector_DMatch& matches, vector_Mat masks = vector_Mat())
638    private static native void match_2(long nativeObj, long queryDescriptors_nativeObj, long matches_mat_nativeObj, long masks_mat_nativeObj);
639    private static native void match_3(long nativeObj, long queryDescriptors_nativeObj, long matches_mat_nativeObj);
640
641    // C++:  void cv::DescriptorMatcher::knnMatch(Mat queryDescriptors, vector_vector_DMatch& matches, int k, vector_Mat masks = vector_Mat(), bool compactResult = false)
642    private static native void knnMatch_3(long nativeObj, long queryDescriptors_nativeObj, long matches_mat_nativeObj, int k, long masks_mat_nativeObj, boolean compactResult);
643    private static native void knnMatch_4(long nativeObj, long queryDescriptors_nativeObj, long matches_mat_nativeObj, int k, long masks_mat_nativeObj);
644    private static native void knnMatch_5(long nativeObj, long queryDescriptors_nativeObj, long matches_mat_nativeObj, int k);
645
646    // C++:  void cv::DescriptorMatcher::radiusMatch(Mat queryDescriptors, vector_vector_DMatch& matches, float maxDistance, vector_Mat masks = vector_Mat(), bool compactResult = false)
647    private static native void radiusMatch_3(long nativeObj, long queryDescriptors_nativeObj, long matches_mat_nativeObj, float maxDistance, long masks_mat_nativeObj, boolean compactResult);
648    private static native void radiusMatch_4(long nativeObj, long queryDescriptors_nativeObj, long matches_mat_nativeObj, float maxDistance, long masks_mat_nativeObj);
649    private static native void radiusMatch_5(long nativeObj, long queryDescriptors_nativeObj, long matches_mat_nativeObj, float maxDistance);
650
651    // C++:  void cv::DescriptorMatcher::write(String fileName)
652    private static native void write_0(long nativeObj, String fileName);
653
654    // C++:  void cv::DescriptorMatcher::read(String fileName)
655    private static native void read_0(long nativeObj, String fileName);
656
657    // C++:  Ptr_DescriptorMatcher cv::DescriptorMatcher::clone(bool emptyTrainData = false)
658    private static native long clone_0(long nativeObj, boolean emptyTrainData);
659    private static native long clone_1(long nativeObj);
660
661    // C++: static Ptr_DescriptorMatcher cv::DescriptorMatcher::create(String descriptorMatcherType)
662    private static native long create_0(String descriptorMatcherType);
663
664    // C++: static Ptr_DescriptorMatcher cv::DescriptorMatcher::create(DescriptorMatcher_MatcherType matcherType)
665    private static native long create_1(int matcherType);
666
667    // native support for java finalize()
668    private static native void delete(long nativeObj);
669
670}