From f1d24e18684fcf03f7d1c99bbdcbf4991c768895 Mon Sep 17 00:00:00 2001 From: Andrey Pavlenko Date: Tue, 2 Aug 2011 15:00:00 +0000 Subject: [PATCH] Java API: adding missing class --- modules/java/src/java/features2d+DMatch.java | 50 ++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 modules/java/src/java/features2d+DMatch.java diff --git a/modules/java/src/java/features2d+DMatch.java b/modules/java/src/java/features2d+DMatch.java new file mode 100644 index 000000000..9ecc80c6b --- /dev/null +++ b/modules/java/src/java/features2d+DMatch.java @@ -0,0 +1,50 @@ +package org.opencv.features2d; + +//C++: class DMatch +//javadoc: DMatch +public class DMatch { + + //javadoc: DMatch::queryIdx + public int queryIdx; + //javadoc: DMatch::trainIdx + public int trainIdx; + //javadoc: DMatch::imgIdx + public int imgIdx; + //javadoc: DMatch::distance + public float distance; + + + //javadoc: DMatch::DMatch() + public DMatch() { + this(-1, -1, Float.MAX_VALUE); + } + + + public DMatch( int _queryIdx, int _trainIdx, float _distance ) { + queryIdx = _queryIdx; + trainIdx = _trainIdx; + imgIdx = -1; + distance = _distance; + } + + + public DMatch( int _queryIdx, int _trainIdx, int _imgIdx, float _distance ) { + queryIdx = _queryIdx; + trainIdx = _trainIdx; + imgIdx = _imgIdx; + distance = _distance; + } + + // less is better + boolean lessThan(DMatch it) { + return distance < it.distance; + } + + + @Override + public String toString() { + return "DMatch [queryIdx=" + queryIdx + ", trainIdx=" + trainIdx + + ", imgIdx=" + imgIdx + ", distance=" + distance + "]"; + } + +}