From a0590273e92a017dad825814e16ae2f3efc6957a Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Fri, 5 Aug 2011 08:39:28 +0000 Subject: [PATCH] Java API: fixed problems in video and ml modules; generated test stubs for all exported functions (now we have 1701 tests). --- CMakeLists.txt | 2 +- .../src/org/opencv/test/OpenCVTestCase.java | 40 +- .../src/org/opencv/test/android/UtilsTest.java | 23 + .../calib3d/{calib3dTest.java => Calib3dTest.java} | 42 +- .../src/org/opencv/test/calib3d/StereoBMTest.java | 4 - .../org/opencv/test/calib3d/StereoSGBMTest.java | 4 - .../test/core/{coreTest.java => CoreTest.java} | 31 +- .../src/org/opencv/test/core/CvTypeTest.java | 63 +++ .../src/org/opencv/test/core/MatTest.java | 228 +++++++++- .../src/org/opencv/test/core/Point3Test.java | 12 +- .../src/org/opencv/test/core/PointTest.java | 14 +- .../src/org/opencv/test/core/RangeTest.java | 14 +- .../src/org/opencv/test/core/RectTest.java | 20 +- .../src/org/opencv/test/core/RotatedRectTest.java | 39 +- .../src/org/opencv/test/core/ScalarTest.java | 12 +- .../src/org/opencv/test/core/SizeTest.java | 12 +- .../src/org/opencv/test/core/TermCriteriaTest.java | 10 +- .../features2d/BRIEFDescriptorExtractorTest.java | 6 +- .../BruteForceDescriptorMatcherTest.java | 174 +++++--- .../BruteForceHammingDescriptorMatcherTest.java | 154 ++++--- .../BruteForceHammingLUTDescriptorMatcherTest.java | 162 ++++--- .../BruteForceL1DescriptorMatcherTest.java | 166 ++++--- .../src/org/opencv/test/features2d/DMatchTest.java | 27 ++ .../features2d/DynamicFASTFeatureDetectorTest.java | 39 ++ .../features2d/DynamicGFTTFeatureDetectorTest.java | 39 ++ .../DynamicHARRISFeatureDetectorTest.java | 39 ++ .../features2d/DynamicMSERFeatureDetectorTest.java | 39 ++ .../features2d/DynamicORBFeatureDetectorTest.java | 39 ++ .../features2d/DynamicSIFTFeatureDetectorTest.java | 39 ++ .../features2d/DynamicSTARFeatureDetectorTest.java | 39 ++ .../features2d/DynamicSURFFeatureDetectorTest.java | 39 ++ .../test/features2d/FASTFeatureDetectorTest.java | 48 +- .../{features2dTest.java => Features2dTest.java} | 101 ++++- .../FernGenericDescriptorMatcherTest.java | 127 ++++++ .../FlannBasedDescriptorMatcherTest.java | 387 ++++++++++------- .../test/features2d/GFTTFeatureDetectorTest.java | 39 ++ .../features2d/GridFASTFeatureDetectorTest.java | 39 ++ .../features2d/GridGFTTFeatureDetectorTest.java | 39 ++ .../features2d/GridHARRISFeatureDetectorTest.java | 39 ++ .../features2d/GridMSERFeatureDetectorTest.java | 39 ++ .../features2d/GridORBFeatureDetectorTest.java | 39 ++ .../features2d/GridSIFTFeatureDetectorTest.java | 39 ++ .../features2d/GridSTARFeatureDetectorTest.java | 39 ++ .../features2d/GridSURFFeatureDetectorTest.java | 39 ++ .../test/features2d/HARRISFeatureDetectorTest.java | 39 ++ .../org/opencv/test/features2d/KeyPointTest.java | 8 +- .../test/features2d/MSERFeatureDetectorTest.java | 39 ++ .../features2d/ORBDescriptorExtractorTest.java | 12 +- .../test/features2d/ORBFeatureDetectorTest.java | 39 ++ .../OneWayGenericDescriptorMatcherTest.java | 127 ++++++ .../OpponentBRIEFDescriptorExtractorTest.java | 39 ++ .../OpponentORBDescriptorExtractorTest.java | 39 ++ .../OpponentSIFTDescriptorExtractorTest.java | 39 ++ .../OpponentSURFDescriptorExtractorTest.java | 39 ++ .../features2d/PyramidFASTFeatureDetectorTest.java | 39 ++ .../features2d/PyramidGFTTFeatureDetectorTest.java | 39 ++ .../PyramidHARRISFeatureDetectorTest.java | 39 ++ .../features2d/PyramidMSERFeatureDetectorTest.java | 39 ++ .../features2d/PyramidORBFeatureDetectorTest.java | 39 ++ .../features2d/PyramidSIFTFeatureDetectorTest.java | 39 ++ .../features2d/PyramidSTARFeatureDetectorTest.java | 39 ++ .../features2d/PyramidSURFFeatureDetectorTest.java | 39 ++ .../features2d/SIFTDescriptorExtractorTest.java | 13 +- .../test/features2d/SIFTFeatureDetectorTest.java | 39 ++ .../test/features2d/STARFeatureDetectorTest.java | 72 +-- .../features2d/SURFDescriptorExtractorTest.java | 6 +- .../test/features2d/SURFFeatureDetectorTest.java | 102 ++--- .../highgui/{highguiTest.java => HighguiTest.java} | 22 +- .../org/opencv/test/highgui/VideoCaptureTest.java | 168 ++++--- .../imgproc/{imgprocTest.java => ImgprocTest.java} | 150 ++++--- .../src/org/opencv/test/imgproc/MomentsTest.java | 4 - .../src/org/opencv/test/ml/CvANN_MLPTest.java | 140 +++--- .../opencv/test/ml/CvANN_MLP_TrainParamsTest.java | 152 +++---- .../src/org/opencv/test/ml/CvBoostParamsTest.java | 88 ++-- .../src/org/opencv/test/ml/CvBoostTest.java | 188 ++++---- .../src/org/opencv/test/ml/CvDTreeParamsTest.java | 152 +++---- .../src/org/opencv/test/ml/CvDTreeTest.java | 92 ++-- .../src/org/opencv/test/ml/CvEMParamsTest.java | 72 +-- .../src/org/opencv/test/ml/CvEMTest.java | 172 ++++---- .../src/org/opencv/test/ml/CvERTreesTest.java | 76 ++-- .../org/opencv/test/ml/CvGBTreesParamsTest.java | 88 ++-- .../src/org/opencv/test/ml/CvGBTreesTest.java | 172 ++++---- .../src/org/opencv/test/ml/CvKNearestTest.java | 108 +++-- .../test/ml/CvNormalBayesClassifierTest.java | 108 +++-- .../src/org/opencv/test/ml/CvParamGridTest.java | 72 +-- .../src/org/opencv/test/ml/CvRTParamsTest.java | 56 +-- .../src/org/opencv/test/ml/CvRTreesTest.java | 124 +++--- .../src/org/opencv/test/ml/CvSVMParamsTest.java | 152 +++---- .../src/org/opencv/test/ml/CvSVMTest.java | 204 +++++---- .../src/org/opencv/test/ml/CvStatModelTest.java | 56 +-- .../opencv/test/objdetect/HOGDescriptorTest.java | 8 +- .../{objdetectTest.java => ObjdetectTest.java} | 6 +- .../opencv/test/{ => utils}/ConvertersTest.java | 483 +++++++++++++-------- .../test/video/BackgroundSubtractorMOGTest.java | 8 +- .../test/video/BackgroundSubtractorTest.java | 19 - .../org/opencv/test/video/KalmanFilterTest.java | 4 - .../test/video/{videoTest.java => VideoTest.java} | 66 +-- modules/java/gen_java.py | 201 ++++++++- 98 files changed, 4764 insertions(+), 2196 deletions(-) create mode 100644 modules/java/android_test/src/org/opencv/test/android/UtilsTest.java rename modules/java/android_test/src/org/opencv/test/calib3d/{calib3dTest.java => Calib3dTest.java} (92%) rename modules/java/android_test/src/org/opencv/test/core/{coreTest.java => CoreTest.java} (98%) create mode 100644 modules/java/android_test/src/org/opencv/test/core/CvTypeTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/DMatchTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/DynamicFASTFeatureDetectorTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/DynamicGFTTFeatureDetectorTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/DynamicHARRISFeatureDetectorTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/DynamicMSERFeatureDetectorTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/DynamicORBFeatureDetectorTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/DynamicSIFTFeatureDetectorTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/DynamicSTARFeatureDetectorTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/DynamicSURFFeatureDetectorTest.java rename modules/java/android_test/src/org/opencv/test/features2d/{features2dTest.java => Features2dTest.java} (57%) create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/FernGenericDescriptorMatcherTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/GFTTFeatureDetectorTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/GridFASTFeatureDetectorTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/GridGFTTFeatureDetectorTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/GridHARRISFeatureDetectorTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/GridMSERFeatureDetectorTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/GridORBFeatureDetectorTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/GridSIFTFeatureDetectorTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/GridSTARFeatureDetectorTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/GridSURFFeatureDetectorTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/HARRISFeatureDetectorTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/MSERFeatureDetectorTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/ORBFeatureDetectorTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/OneWayGenericDescriptorMatcherTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/OpponentBRIEFDescriptorExtractorTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/OpponentORBDescriptorExtractorTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/OpponentSIFTDescriptorExtractorTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/OpponentSURFDescriptorExtractorTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/PyramidFASTFeatureDetectorTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/PyramidGFTTFeatureDetectorTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/PyramidHARRISFeatureDetectorTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/PyramidMSERFeatureDetectorTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/PyramidORBFeatureDetectorTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/PyramidSIFTFeatureDetectorTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/PyramidSTARFeatureDetectorTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/PyramidSURFFeatureDetectorTest.java create mode 100644 modules/java/android_test/src/org/opencv/test/features2d/SIFTFeatureDetectorTest.java rename modules/java/android_test/src/org/opencv/test/highgui/{highguiTest.java => HighguiTest.java} (56%) rename modules/java/android_test/src/org/opencv/test/imgproc/{imgprocTest.java => ImgprocTest.java} (97%) rename modules/java/android_test/src/org/opencv/test/objdetect/{objdetectTest.java => ObjdetectTest.java} (87%) rename modules/java/android_test/src/org/opencv/test/{ => utils}/ConvertersTest.java (57%) delete mode 100644 modules/java/android_test/src/org/opencv/test/video/BackgroundSubtractorTest.java rename modules/java/android_test/src/org/opencv/test/video/{videoTest.java => VideoTest.java} (65%) diff --git a/CMakeLists.txt b/CMakeLists.txt index de37a81..921a40f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1707,7 +1707,7 @@ status(" Documentation:") status(" Sphinx:" HAVE_SPHINX THEN "${SPHINX_BUILD} (ver ${SPHINX_VERSION})" ELSE NO) status(" PdfLaTeX compiler:" PDFLATEX_COMPILER THEN "${PDFLATEX_COMPILER}" ELSE NO) if (BUILD_DOCS AND HAVE_SPHINX) - status(" Build Documentation:" PDFLATEX_COMPILER THEN YES ELSE "YES (HTML only)") + status(" Build Documentation:" PDFLATEX_COMPILER THEN YES ELSE "YES (only HTML without math formulas)") else() status(" Build Documentation:" NO) endif() diff --git a/modules/java/android_test/src/org/opencv/test/OpenCVTestCase.java b/modules/java/android_test/src/org/opencv/test/OpenCVTestCase.java index 5f81171..414de27 100644 --- a/modules/java/android_test/src/org/opencv/test/OpenCVTestCase.java +++ b/modules/java/android_test/src/org/opencv/test/OpenCVTestCase.java @@ -1,15 +1,5 @@ package org.opencv.test; -import org.opencv.core.Core; -import org.opencv.core.CvType; -import org.opencv.core.Mat; -import org.opencv.core.Point; -import org.opencv.core.Rect; -import org.opencv.core.Scalar; -import org.opencv.features2d.DMatch; -import org.opencv.features2d.KeyPoint; -import org.opencv.highgui.Highgui; - import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; @@ -21,6 +11,16 @@ import java.util.List; import junit.framework.TestCase; +import org.opencv.core.Core; +import org.opencv.core.CvType; +import org.opencv.core.Mat; +import org.opencv.core.Point; +import org.opencv.core.Rect; +import org.opencv.core.Scalar; +import org.opencv.features2d.DMatch; +import org.opencv.features2d.KeyPoint; +import org.opencv.highgui.Highgui; + public class OpenCVTestCase extends TestCase { protected static int matSize = 10; @@ -167,24 +167,30 @@ public class OpenCVTestCase extends TestCase { super.tearDown(); } - public static void assertListIntegerEquals(List list1, List list2) { + public static void assertListEquals(List list1, List list2) { if (list1.size() != list2.size()) { throw new UnsupportedOperationException(); } - + + if (!list1.isEmpty()) + { + if (list1.get(0) instanceof Float || list1.get(0) instanceof Double) + throw new UnsupportedOperationException(); + } + for (int i = 0; i < list1.size(); i++) assertEquals(list1.get(i), list2.get(i)); } - - public static void assertListFloatEquals(List list1, List list2, double epsilon) { + + public static void assertListEquals(List list1, List list2, double epsilon) { if (list1.size() != list2.size()) { throw new UnsupportedOperationException(); } - + for (int i = 0; i < list1.size(); i++) - assertTrue(Math.abs(list1.get(i) - list2.get(i)) <= epsilon); + assertTrue(Math.abs(list1.get(i).doubleValue() - list2.get(i).doubleValue()) <= epsilon); } - + public static void assertListMatEquals(List list1, List list2, double epsilon) { if (list1.size() != list2.size()) { throw new UnsupportedOperationException(); diff --git a/modules/java/android_test/src/org/opencv/test/android/UtilsTest.java b/modules/java/android_test/src/org/opencv/test/android/UtilsTest.java new file mode 100644 index 0000000..93adca1 --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/android/UtilsTest.java @@ -0,0 +1,23 @@ +package org.opencv.test.android; + +import org.opencv.test.OpenCVTestCase; + +public class UtilsTest extends OpenCVTestCase { + + public void testBitmapToMat() { + fail("Not yet implemented"); + } + + public void testExportResourceContextInt() { + fail("Not yet implemented"); + } + + public void testExportResourceContextIntString() { + fail("Not yet implemented"); + } + + public void testMatToBitmap() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/calib3d/calib3dTest.java b/modules/java/android_test/src/org/opencv/test/calib3d/Calib3dTest.java similarity index 92% rename from modules/java/android_test/src/org/opencv/test/calib3d/calib3dTest.java rename to modules/java/android_test/src/org/opencv/test/calib3d/Calib3dTest.java index 23006ec..9c917be 100644 --- a/modules/java/android_test/src/org/opencv/test/calib3d/calib3dTest.java +++ b/modules/java/android_test/src/org/opencv/test/calib3d/Calib3dTest.java @@ -13,11 +13,7 @@ import org.opencv.core.Scalar; import org.opencv.core.Size; import org.opencv.test.OpenCVTestCase; -public class calib3dTest extends OpenCVTestCase { - - public void test_1() { - super.test_1("calib3d"); - } +public class Calib3dTest extends OpenCVTestCase { public void testCalibrateCameraListOfMatListOfMatSizeMatMatListOfMatListOfMat() { fail("Not yet implemented"); @@ -238,7 +234,7 @@ public class calib3dTest extends OpenCVTestCase { assertEquals(CvType.CV_32FC2, centers.type()); } - public void testFindFundamentalMatMatMat() { + public void testFindFundamentalMatListOfPointListOfPoint() { List pts1 = new ArrayList(); List pts2 = new ArrayList(); @@ -257,24 +253,23 @@ public class calib3dTest extends OpenCVTestCase { assertMatEqual(truth, fm, EPS); } - public void testFindFundamentalMatMatMatInt() { + public void testFindFundamentalMatListOfPointListOfPointInt() { fail("Not yet implemented"); } - public void testFindFundamentalMatMatMatIntDouble() { + public void testFindFundamentalMatListOfPointListOfPointIntDouble() { fail("Not yet implemented"); } - public void testFindFundamentalMatMatMatIntDoubleDouble() { + public void testFindFundamentalMatListOfPointListOfPointIntDoubleDouble() { fail("Not yet implemented"); } - public void testFindFundamentalMatMatMatIntDoubleDoubleMat() { + public void testFindFundamentalMatListOfPointListOfPointIntDoubleDoubleMat() { fail("Not yet implemented"); } - public void testFindHomographyMatMat() { - + public void testFindHomographyListOfPointListOfPoint() { List originalPoints = new ArrayList(); List transformedPoints = new ArrayList(); @@ -293,15 +288,15 @@ public class calib3dTest extends OpenCVTestCase { assertMatEqual(truth, hmg, EPS); } - public void testFindHomographyMatMatInt() { + public void testFindHomographyListOfPointListOfPointInt() { fail("Not yet implemented"); } - public void testFindHomographyMatMatIntDouble() { + public void testFindHomographyListOfPointListOfPointIntDouble() { fail("Not yet implemented"); } - public void testFindHomographyMatMatIntDoubleMat() { + public void testFindHomographyListOfPointListOfPointIntDoubleMat() { fail("Not yet implemented"); } @@ -495,7 +490,7 @@ public class calib3dTest extends OpenCVTestCase { fail("Not yet implemented"); } - public void testSolvePnPMatMatMatMatMatMat() { + public void testSolvePnPListOfPoint3ListOfPointMatMatMatMat() { Mat intrinsics = Mat.eye(3, 3, CvType.CV_32F); intrinsics.put(0, 0, 400); intrinsics.put(1, 1, 400); @@ -527,31 +522,31 @@ public class calib3dTest extends OpenCVTestCase { assertMatEqual(truth_tvec, tvec, EPS); } - public void testSolvePnPMatMatMatMatMatMatBoolean() { + public void testSolvePnPListOfPoint3ListOfPointMatMatMatMatBoolean() { fail("Not yet implemented"); } - public void testSolvePnPRansacMatMatMatMatMatMat() { + public void testSolvePnPRansacListOfPoint3ListOfPointMatMatMatMat() { fail("Not yet implemented"); } - public void testSolvePnPRansacMatMatMatMatMatMatBoolean() { + public void testSolvePnPRansacListOfPoint3ListOfPointMatMatMatMatBoolean() { fail("Not yet implemented"); } - public void testSolvePnPRansacMatMatMatMatMatMatBooleanInt() { + public void testSolvePnPRansacListOfPoint3ListOfPointMatMatMatMatBooleanInt() { fail("Not yet implemented"); } - public void testSolvePnPRansacMatMatMatMatMatMatBooleanIntFloat() { + public void testSolvePnPRansacListOfPoint3ListOfPointMatMatMatMatBooleanIntFloat() { fail("Not yet implemented"); } - public void testSolvePnPRansacMatMatMatMatMatMatBooleanIntFloatInt() { + public void testSolvePnPRansacListOfPoint3ListOfPointMatMatMatMatBooleanIntFloatInt() { fail("Not yet implemented"); } - public void testSolvePnPRansacMatMatMatMatMatMatBooleanIntFloatIntMat() { + public void testSolvePnPRansacListOfPoint3ListOfPointMatMatMatMatBooleanIntFloatIntMat() { fail("Not yet implemented"); } @@ -582,5 +577,4 @@ public class calib3dTest extends OpenCVTestCase { public void testValidateDisparityMatMatIntIntInt() { fail("Not yet implemented"); } - } diff --git a/modules/java/android_test/src/org/opencv/test/calib3d/StereoBMTest.java b/modules/java/android_test/src/org/opencv/test/calib3d/StereoBMTest.java index 6c1cf08..eac6673 100644 --- a/modules/java/android_test/src/org/opencv/test/calib3d/StereoBMTest.java +++ b/modules/java/android_test/src/org/opencv/test/calib3d/StereoBMTest.java @@ -4,10 +4,6 @@ import org.opencv.test.OpenCVTestCase; public class StereoBMTest extends OpenCVTestCase { - protected void setUp() throws Exception { - super.setUp(); - } - public void testComputeMatMatMat() { fail("Not yet implemented"); } diff --git a/modules/java/android_test/src/org/opencv/test/calib3d/StereoSGBMTest.java b/modules/java/android_test/src/org/opencv/test/calib3d/StereoSGBMTest.java index 72c0643..897d290 100644 --- a/modules/java/android_test/src/org/opencv/test/calib3d/StereoSGBMTest.java +++ b/modules/java/android_test/src/org/opencv/test/calib3d/StereoSGBMTest.java @@ -4,10 +4,6 @@ import org.opencv.test.OpenCVTestCase; public class StereoSGBMTest extends OpenCVTestCase { - protected void setUp() throws Exception { - super.setUp(); - } - public void testCompute() { fail("Not yet implemented"); } diff --git a/modules/java/android_test/src/org/opencv/test/core/coreTest.java b/modules/java/android_test/src/org/opencv/test/core/CoreTest.java similarity index 98% rename from modules/java/android_test/src/org/opencv/test/core/coreTest.java rename to modules/java/android_test/src/org/opencv/test/core/CoreTest.java index 65f541e..937a0b7 100644 --- a/modules/java/android_test/src/org/opencv/test/core/coreTest.java +++ b/modules/java/android_test/src/org/opencv/test/core/CoreTest.java @@ -13,11 +13,7 @@ import org.opencv.core.Scalar; import org.opencv.test.OpenCVTestCase; import org.opencv.utils.Converters; -public class coreTest extends OpenCVTestCase { - - public void test_1() { - super.test_1("CORE"); - } +public class CoreTest extends OpenCVTestCase { public void testAbsdiff() { Core.absdiff(gray128, gray255, dst); @@ -167,9 +163,8 @@ public class coreTest extends OpenCVTestCase { try { Core.checkRange(outOfRange, false); fail("Core.checkRange should throw the CvException"); - } catch (Exception e) { - if (!(e instanceof CvException)) - fail("Core.checkRange should throw the CvException"); + } catch (CvException e) { + //expected } } @@ -223,11 +218,9 @@ public class coreTest extends OpenCVTestCase { Scalar color0 = new Scalar(0); assertTrue(0 == Core.countNonZero(gray0)); - Core.circle(gray0, center2, radius * 2, color128, 2, 4, 1/* - * Number of + Core.circle(gray0, center2, radius * 2, color128, 2, 4, 1/* Number of * fractional - * bits - */); + * bits */); Core.circle(gray0, center, radius, color0, 2, 4, 0); assertTrue(0 == Core.countNonZero(gray0)); } @@ -507,21 +500,21 @@ public class coreTest extends OpenCVTestCase { lp.add(new Point(1, 1)); lp.add(new Point(5, 1)); lp.add(new Point(5, 8)); - lp.add(new Point(1, 8)); + lp.add(new Point(1, 8)); Mat points = Converters.vector_Point_to_Mat(lp); - + List lp2 = new ArrayList(); lp2.add(new Point(0, 0)); lp2.add(new Point(10, 2)); lp2.add(new Point(10, 16)); lp2.add(new Point(2, 16)); Mat points2 = Converters.vector_Point_to_Mat(lp2); - + assertEquals(0, Core.countNonZero(gray0)); - Core.fillConvexPoly(gray0, points, colorWhite, 4 /*TODO: lineType*/, 0); + Core.fillConvexPoly(gray0, points, colorWhite, 4 /* TODO: lineType */, 0); assertTrue(0 < Core.countNonZero(gray0)); - Core.fillConvexPoly(gray0, points2, colorBlack, 4 /*TODO: lineType*/, 0); + Core.fillConvexPoly(gray0, points2, colorBlack, 4 /* TODO: lineType */, 0); assertEquals(0, Core.countNonZero(gray0)); } @@ -613,6 +606,10 @@ public class coreTest extends OpenCVTestCase { fail("Not yet implemented"); } + public void testGetNumberOfCPUs() { + fail("Not yet implemented"); + } + public void testGetOptimalDFTSize() { int vecsize = Core.getOptimalDFTSize(0); assertEquals(1, vecsize); diff --git a/modules/java/android_test/src/org/opencv/test/core/CvTypeTest.java b/modules/java/android_test/src/org/opencv/test/core/CvTypeTest.java new file mode 100644 index 0000000..fc3b5ac --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/core/CvTypeTest.java @@ -0,0 +1,63 @@ +package org.opencv.test.core; + +import org.opencv.core.CvType; +import org.opencv.test.OpenCVTestCase; + +public class CvTypeTest extends OpenCVTestCase { + + public void testMakeType() { + assertEquals(CvType.CV_8UC4, CvType.makeType(CvType.CV_8U, 4)); + } + + public void testCV_8UC() { + assertEquals(CvType.CV_8UC4, CvType.CV_8UC(4)); + } + + public void testCV_8SC() { + assertEquals(CvType.CV_8SC4, CvType.CV_8SC(4)); + } + + public void testCV_16UC() { + assertEquals(CvType.CV_16UC4, CvType.CV_16UC(4)); + } + + public void testCV_16SC() { + assertEquals(CvType.CV_16SC4, CvType.CV_16SC(4)); + } + + public void testCV_32SC() { + assertEquals(CvType.CV_32SC4, CvType.CV_32SC(4)); + } + + public void testCV_32FC() { + assertEquals(CvType.CV_32FC4, CvType.CV_32FC(4)); + } + + public void testCV_64FC() { + assertEquals(CvType.CV_64FC4, CvType.CV_64FC(4)); + } + + public void testChannels() { + assertEquals(1, CvType.channels(CvType.CV_64F)); + } + + public void testDepth() { + assertEquals(CvType.CV_64F, CvType.depth(CvType.CV_64FC3)); + } + + public void testIsInteger() { + assertFalse(CvType.isInteger(CvType.CV_32FC3)); + assertTrue(CvType.isInteger(CvType.CV_16S)); + } + + public void testELEM_SIZE() { + assertEquals(3 * 8, CvType.ELEM_SIZE(CvType.CV_64FC3)); + } + + public void testTypeToString() { + assertEquals("CV_32FC1", CvType.typeToString(CvType.CV_32F)); + assertEquals("CV_32FC3", CvType.typeToString(CvType.CV_32FC3)); + assertEquals("CV_32FC(128)", CvType.typeToString(CvType.CV_32FC(128))); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/core/MatTest.java b/modules/java/android_test/src/org/opencv/test/core/MatTest.java index 55466db..fb20712 100644 --- a/modules/java/android_test/src/org/opencv/test/core/MatTest.java +++ b/modules/java/android_test/src/org/opencv/test/core/MatTest.java @@ -1,5 +1,7 @@ package org.opencv.test.core; +import java.util.Arrays; + import org.opencv.core.CvType; import org.opencv.core.Mat; import org.opencv.core.Scalar; @@ -7,8 +9,16 @@ import org.opencv.test.OpenCVTestCase; public class MatTest extends OpenCVTestCase { - public void test_1() { - super.test_1("Mat"); + public void testAdjustROI() { + fail("Not yet implemented"); + } + + public void testAssignToMat() { + fail("Not yet implemented"); + } + + public void testAssignToMatInt() { + fail("Not yet implemented"); } public void testChannels() { @@ -17,9 +27,23 @@ public class MatTest extends OpenCVTestCase { assertEquals(4, rgba0.channels()); } + public void testCheckVectorInt() { + fail("Not yet implemented"); + } + + public void testCheckVectorIntInt() { + fail("Not yet implemented"); + } + + public void testCheckVectorIntIntBoolean() { + fail("Not yet implemented"); + } + public void testClone() { dst = gray0.clone(); assertMatEqual(gray0, dst); + assertFalse(gray0.getNativeObjAddr() == dst.getNativeObjAddr()); + assertFalse(gray0.dataAddr() == dst.dataAddr()); } public void testCol() { @@ -28,14 +52,30 @@ public class MatTest extends OpenCVTestCase { assertEquals(gray0.rows(), col.rows()); } - public void testColRange() { + public void testColRangeIntInt() { Mat cols = gray0.colRange(0, gray0.cols() / 2); assertEquals(gray0.cols() / 2, cols.cols()); assertEquals(gray0.rows(), cols.rows()); } + public void testColRangeRange() { + fail("Not yet implemented"); + } + public void testCols() { - assertEquals(matSize, gray0.rows()); + assertEquals(matSize, gray0.cols()); + } + + public void testConvertToMatInt() { + fail("Not yet implemented"); + } + + public void testConvertToMatIntDouble() { + fail("Not yet implemented"); + } + + public void testConvertToMatIntDoubleDouble() { + fail("Not yet implemented"); } public void testCopyTo() { @@ -43,6 +83,22 @@ public class MatTest extends OpenCVTestCase { assertMatEqual(rgbLena, dst); } + public void testCopyToMat() { + fail("Not yet implemented"); + } + + public void testCopyToMatMat() { + fail("Not yet implemented"); + } + + public void testCreateIntIntInt() { + fail("Not yet implemented"); + } + + public void testCreateSizeInt() { + fail("Not yet implemented"); + } + public void testCross() { Mat answer = new Mat(1, 3, CvType.CV_32F); answer.put(0, 0, 7.0, 1.0, -5.0); @@ -53,6 +109,7 @@ public class MatTest extends OpenCVTestCase { public void testDataAddr() { assertTrue(0 != gray0.dataAddr()); + assertEquals(0, new Mat().dataAddr()); } public void testDepth() { @@ -60,12 +117,16 @@ public class MatTest extends OpenCVTestCase { assertEquals(CvType.CV_32F, gray0_32f.depth()); } - public void testRelease() { - assertTrue(gray0.empty() == false); - assertTrue(gray0.rows() > 0); - gray0.release(); - assertTrue(gray0.empty() == true); - assertTrue(gray0.rows() == 0); + public void testDiag() { + fail("Not yet implemented"); + } + + public void testDiagInt() { + fail("Not yet implemented"); + } + + public void testDiagMat() { + fail("Not yet implemented"); } public void testDot() { @@ -83,6 +144,10 @@ public class MatTest extends OpenCVTestCase { assertEquals(3, rgbLena.elemSize()); } + public void testElemSize1() { + fail("Not yet implemented"); + } + public void testEmpty() { assertTrue(dst.empty()); assertTrue(!gray0.empty()); @@ -93,6 +158,14 @@ public class MatTest extends OpenCVTestCase { assertMatEqual(eye, eye.inv(), EPS); } + public void testEyeIntIntInt() { + fail("Not yet implemented"); + } + + public void testEyeSizeInt() { + fail("Not yet implemented"); + } + public void testGetIntInt() { fail("Not yet implemented"); } @@ -102,8 +175,11 @@ public class MatTest extends OpenCVTestCase { byte[] goodData = new byte[9]; byte[] badData = new byte[7]; m.get(1, 1, goodData); + + assertTrue(Arrays.equals(new byte[] { 1, 2, 3, 1, 2, 3, 1, 2, 3 }, goodData)); + try { - m.get(2, 2, badData); + m.get(2, 2, badData); fail("Expected UnsupportedOperationException (data.length % CvType.channels(t) != 0)"); } catch (UnsupportedOperationException e) { // expected @@ -141,6 +217,10 @@ public class MatTest extends OpenCVTestCase { assertMatEqual(grayE_32f, dst, EPS); } + public void testInvInt() { + fail("Not yet implemented"); + } + public void testIsContinuous() { assertTrue(gray0.isContinuous()); @@ -154,9 +234,13 @@ public class MatTest extends OpenCVTestCase { assertTrue(subMat.isSubmatrix()); } + public void testLocateROI() { + fail("Not yet implemented"); + } + public void testMat() { Mat m = new Mat(); - assertTrue(null != m); + assertNotNull(m); assertTrue(m.empty()); } @@ -196,6 +280,50 @@ public class MatTest extends OpenCVTestCase { assertMatEqual(m2, gray0_32f, EPS); } + public void testMatLong() { + fail("Not yet implemented"); + } + + public void testMatMatRange() { + fail("Not yet implemented"); + } + + public void testMatMatRangeRange() { + fail("Not yet implemented"); + } + + public void testMatMatRect() { + fail("Not yet implemented"); + } + + public void testMatSizeInt() { + fail("Not yet implemented"); + } + + public void testMatSizeIntScalar() { + fail("Not yet implemented"); + } + + public void testMulMat() { + fail("Not yet implemented"); + } + + public void testMulMatDouble() { + fail("Not yet implemented"); + } + + public void testOnesIntIntInt() { + fail("Not yet implemented"); + } + + public void testOnesSizeInt() { + fail("Not yet implemented"); + } + + public void testPush_back() { + fail("Not yet implemented"); + } + public void testPutIntIntByteArray() { fail("Not yet implemented"); } @@ -203,8 +331,9 @@ public class MatTest extends OpenCVTestCase { public void testPutIntIntDoubleArray() { Mat m = new Mat(5, 5, CvType.CV_8UC3); m.put(1, 1, 10, 20, 30, 40, 50, 60); + try { - m.put(2, 2, 11, 22, 33, 44, 55); + m.put(2, 2, 11, 22, 33, 44, 55); fail("Expected UnsupportedOperationException (data.length % CvType.channels(t) != 0)"); } catch (UnsupportedOperationException e) { // expected @@ -223,33 +352,92 @@ public class MatTest extends OpenCVTestCase { fail("Not yet implemented"); } + public void testRelease() { + assertFalse(gray0.empty()); + assertTrue(gray0.rows() > 0); + + gray0.release(); + + assertTrue(gray0.empty()); + assertEquals(0, gray0.rows()); + assertEquals(0, gray0.dataAddr()); + } + + public void testReshapeInt() { + fail("Not yet implemented"); + } + + public void testReshapeIntInt() { + fail("Not yet implemented"); + } + public void testRow() { Mat row = gray0.row(0); assertEquals(1, row.rows()); assertEquals(gray0.cols(), row.cols()); } - public void testRowRange() { + public void testRowRangeIntInt() { + fail("Not yet implemented"); Mat rows = gray0.rowRange(0, gray0.rows() / 2); assertEquals(gray0.rows() / 2, rows.rows()); assertEquals(gray0.cols(), rows.cols()); } + public void testRowRangeRange() { + fail("Not yet implemented"); + } + public void testRows() { assertEquals(matSize, gray0.rows()); } - public void testSetTo() { + public void testSetToMat() { + fail("Not yet implemented"); + } + + public void testSetToMatMat() { + fail("Not yet implemented"); + } + + public void testSetToScalar() { gray0.setTo(new Scalar(127)); assertMatEqual(gray127, gray0); + + } + + public void testSize() { + fail("Not yet implemented"); + } + + public void testStep1() { + fail("Not yet implemented"); } - public void testSubmat() { + public void testStep1Int() { + fail("Not yet implemented"); + } + + public void testSubmatIntIntIntInt() { Mat submat = gray0.submat(0, gray0.rows() / 2, 0, gray0.cols() / 2); + assertTrue(submat.isSubmatrix()); + assertFalse(submat.isContinuous()); assertEquals(gray0.rows() / 2, submat.rows()); assertEquals(gray0.cols() / 2, submat.cols()); } + public void testSubmatRangeRange() { + fail("Not yet implemented"); + } + + public void testSubmatRect() { + fail("Not yet implemented"); + } + + public void testT() { + fail("Not yet implemented"); + } + public void testToString() { assertTrue(null != gray0.toString()); } @@ -271,4 +459,12 @@ public class MatTest extends OpenCVTestCase { assertEquals(rgba128.cols(), rgba128.width()); } + public void testZerosIntIntInt() { + fail("Not yet implemented"); + } + + public void testZerosSizeInt() { + fail("Not yet implemented"); + } + } diff --git a/modules/java/android_test/src/org/opencv/test/core/Point3Test.java b/modules/java/android_test/src/org/opencv/test/core/Point3Test.java index d662c8f..5ca811e 100644 --- a/modules/java/android_test/src/org/opencv/test/core/Point3Test.java +++ b/modules/java/android_test/src/org/opencv/test/core/Point3Test.java @@ -5,14 +5,14 @@ import org.opencv.core.Point3; import org.opencv.test.OpenCVTestCase; public class Point3Test extends OpenCVTestCase { - + private Point3 p1; - private Point3 p2; + private Point3 p2; @Override protected void setUp() throws Exception { super.setUp(); - + p1 = new Point3(2, 2, 2); p2 = new Point3(1, 1, 1); } @@ -42,9 +42,13 @@ public class Point3Test extends OpenCVTestCase { assertFalse(flag); } + public void testHashCode() { + assertEquals(p1.hashCode(), p1.hashCode()); + } + public void testPoint3() { p1 = new Point3(); - + assertNotNull(p1); assertTrue(0 == p1.x); assertTrue(0 == p1.y); diff --git a/modules/java/android_test/src/org/opencv/test/core/PointTest.java b/modules/java/android_test/src/org/opencv/test/core/PointTest.java index a65bbab..877cc1d 100644 --- a/modules/java/android_test/src/org/opencv/test/core/PointTest.java +++ b/modules/java/android_test/src/org/opencv/test/core/PointTest.java @@ -5,14 +5,14 @@ import org.opencv.core.Rect; import org.opencv.test.OpenCVTestCase; public class PointTest extends OpenCVTestCase { - + private Point p1; - private Point p2; + private Point p2; @Override protected void setUp() throws Exception { super.setUp(); - + p1 = new Point(2, 2); p2 = new Point(1, 1); } @@ -36,6 +36,10 @@ public class PointTest extends OpenCVTestCase { assertFalse(flag); } + public void testHashCode() { + assertEquals(p1.hashCode(), p1.hashCode()); + } + public void testInside() { Rect rect = new Rect(0, 0, 5, 3); assertTrue(p1.inside(rect)); @@ -46,7 +50,7 @@ public class PointTest extends OpenCVTestCase { public void testPoint() { Point p = new Point(); - + assertNotNull(p); assertEquals(0.0, p.x); assertEquals(0.0, p.y); @@ -62,7 +66,7 @@ public class PointTest extends OpenCVTestCase { public void testPointDoubleDouble() { p1 = new Point(7, 5); - + assertNotNull(p1); assertEquals(7.0, p1.x); assertEquals(5.0, p1.y); diff --git a/modules/java/android_test/src/org/opencv/test/core/RangeTest.java b/modules/java/android_test/src/org/opencv/test/core/RangeTest.java index ed81296..6734fbc 100644 --- a/modules/java/android_test/src/org/opencv/test/core/RangeTest.java +++ b/modules/java/android_test/src/org/opencv/test/core/RangeTest.java @@ -5,14 +5,14 @@ import org.opencv.test.OpenCVTestCase; public class RangeTest extends OpenCVTestCase { - Range range; Range r1; Range r2; + Range range; @Override protected void setUp() throws Exception { super.setUp(); - + range = new Range(); r1 = new Range(1, 11); r2 = new Range(1, 1); @@ -42,11 +42,15 @@ public class RangeTest extends OpenCVTestCase { public void testEqualsObject() { assertFalse(r2.equals(r1)); - + range = r1.clone(); assertTrue(r1.equals(range)); } + public void testHashCode() { + assertEquals(r1.hashCode(), r1.hashCode()); + } + public void testIntersection() { range = r1.intersection(r2); assertEquals(r2, range); @@ -54,7 +58,7 @@ public class RangeTest extends OpenCVTestCase { public void testRange() { range = new Range(); - + assertNotNull(range); assertEquals(0, range.start); assertEquals(0, range.end); @@ -70,7 +74,7 @@ public class RangeTest extends OpenCVTestCase { public void testRangeIntInt() { r1 = new Range(12, 13); - + assertNotNull(r1); assertEquals(12, r1.start); assertEquals(13, r1.end); diff --git a/modules/java/android_test/src/org/opencv/test/core/RectTest.java b/modules/java/android_test/src/org/opencv/test/core/RectTest.java index 49fd4c4..c12160b 100644 --- a/modules/java/android_test/src/org/opencv/test/core/RectTest.java +++ b/modules/java/android_test/src/org/opencv/test/core/RectTest.java @@ -6,14 +6,14 @@ import org.opencv.core.Size; import org.opencv.test.OpenCVTestCase; public class RectTest extends OpenCVTestCase { - + private Rect r; private Rect rect; @Override protected void setUp() throws Exception { super.setUp(); - + r = new Rect(); rect = new Rect(0, 0, 10, 10); } @@ -38,7 +38,7 @@ public class RectTest extends OpenCVTestCase { public void testContains() { Rect rect = new Rect(0, 0, 10, 10); - + Point p_inner = new Point(5, 5); Point p_outer = new Point(5, 55); Point p_bl = new Point(0, 0); @@ -65,9 +65,13 @@ public class RectTest extends OpenCVTestCase { assertTrue(flag); } + public void testHashCode() { + assertEquals(rect.hashCode(), rect.hashCode()); + } + public void testRect() { r = new Rect(); - + assertEquals(0, r.x); assertEquals(0, r.y); assertEquals(0, r.width); @@ -77,7 +81,7 @@ public class RectTest extends OpenCVTestCase { public void testRectDoubleArray() { double[] vals = { 1, 3, 5, 2 }; r = new Rect(vals); - + assertEquals(1, r.x); assertEquals(3, r.y); assertEquals(5, r.width); @@ -86,7 +90,7 @@ public class RectTest extends OpenCVTestCase { public void testRectIntIntIntInt() { r = new Rect(1, 3, 5, 2); - + assertNotNull(rect); assertEquals(0, rect.x); assertEquals(0, rect.y); @@ -97,8 +101,8 @@ public class RectTest extends OpenCVTestCase { public void testRectPointPoint() { Point p1 = new Point(4, 4); Point p2 = new Point(2, 3); - - r = new Rect(p1, p2); + + r = new Rect(p1, p2); assertNotNull(r); assertEquals(2, r.x); assertEquals(3, r.y); diff --git a/modules/java/android_test/src/org/opencv/test/core/RotatedRectTest.java b/modules/java/android_test/src/org/opencv/test/core/RotatedRectTest.java index 1fc7fbe..914bd6e 100644 --- a/modules/java/android_test/src/org/opencv/test/core/RotatedRectTest.java +++ b/modules/java/android_test/src/org/opencv/test/core/RotatedRectTest.java @@ -21,10 +21,6 @@ public class RotatedRectTest extends OpenCVTestCase { angle = 40; } - public void test_1() { - super.test_1("core.RotatedRect"); - } - public void testBoundingRect() { size = new Size(matSize / 2, matSize / 2); assertEquals(size.height, size.width); @@ -85,6 +81,11 @@ public class RotatedRectTest extends OpenCVTestCase { assertTrue(!rrect1.equals(size)); } + public void testHashCode() { + RotatedRect rr = new RotatedRect(center, size, angle); + assertEquals(rr.hashCode(), rr.hashCode()); + } + public void testPoints() { RotatedRect rrect = new RotatedRect(center, size, angle); @@ -105,28 +106,28 @@ public class RotatedRectTest extends OpenCVTestCase { Math.abs((p[1].x + p[3].x) / 2 - center.x) + Math.abs((p[1].y + p[3].y) / 2 - center.y) < EPS); assertTrue("Orthogonal vectors 01 and 12", - Math.abs((p[1].x - p[0].x) * (p[2].x - p[1].x) + - (p[1].y - p[0].y) * (p[2].y - p[1].y)) < EPS); + Math.abs((p[1].x - p[0].x) * (p[2].x - p[1].x) + + (p[1].y - p[0].y) * (p[2].y - p[1].y)) < EPS); assertTrue("Orthogonal vectors 12 and 23", - Math.abs((p[2].x - p[1].x) * (p[3].x - p[2].x) + - (p[2].y - p[1].y) * (p[3].y - p[2].y)) < EPS); + Math.abs((p[2].x - p[1].x) * (p[3].x - p[2].x) + + (p[2].y - p[1].y) * (p[3].y - p[2].y)) < EPS); assertTrue("Orthogonal vectors 23 and 30", - Math.abs((p[3].x - p[2].x) * (p[0].x - p[3].x) + - (p[3].y - p[2].y) * (p[0].y - p[3].y)) < EPS); + Math.abs((p[3].x - p[2].x) * (p[0].x - p[3].x) + + (p[3].y - p[2].y) * (p[0].y - p[3].y)) < EPS); assertTrue("Orthogonal vectors 30 and 01", - Math.abs((p[0].x - p[3].x) * (p[1].x - p[0].x) + - (p[0].y - p[3].y) * (p[1].y - p[0].y)) < EPS); + Math.abs((p[0].x - p[3].x) * (p[1].x - p[0].x) + + (p[0].y - p[3].y) * (p[1].y - p[0].y)) < EPS); assertTrue("Length of the vector 01", - Math.abs((p[1].x - p[0].x) * (p[1].x - p[0].x) + - (p[1].y - p[0].y) * (p[1].y - p[0].y) - size.height * size.height) < EPS); + Math.abs((p[1].x - p[0].x) * (p[1].x - p[0].x) + + (p[1].y - p[0].y) * (p[1].y - p[0].y) - size.height * size.height) < EPS); assertTrue("Length of the vector 21", - Math.abs((p[1].x - p[2].x) * (p[1].x - p[2].x) + - (p[1].y - p[2].y) * (p[1].y - p[2].y) - size.width * size.width) < EPS); + Math.abs((p[1].x - p[2].x) * (p[1].x - p[2].x) + + (p[1].y - p[2].y) * (p[1].y - p[2].y) - size.width * size.width) < EPS); assertTrue("Angle of the vector 21 with the axes", Math.abs((p[2].x - p[1].x) / size.width - Math.cos(angle * Math.PI / 180)) < EPS); } @@ -141,7 +142,7 @@ public class RotatedRectTest extends OpenCVTestCase { } public void testRotatedRectDoubleArray() { - double[] vals = {1.5, 2.6, 3.7, 4.2, 5.1}; + double[] vals = { 1.5, 2.6, 3.7, 4.2, 5.1 }; RotatedRect rr = new RotatedRect(vals); assertNotNull(rr); @@ -161,4 +162,8 @@ public class RotatedRectTest extends OpenCVTestCase { assertTrue(rr.angle == 40.0); } + public void testSet() { + fail("Not yet implemented"); + } + } diff --git a/modules/java/android_test/src/org/opencv/test/core/ScalarTest.java b/modules/java/android_test/src/org/opencv/test/core/ScalarTest.java index 079b05d..ddcfb98 100644 --- a/modules/java/android_test/src/org/opencv/test/core/ScalarTest.java +++ b/modules/java/android_test/src/org/opencv/test/core/ScalarTest.java @@ -5,16 +5,16 @@ import org.opencv.test.OpenCVTestCase; public class ScalarTest extends OpenCVTestCase { + private Scalar dstScalar; private Scalar s1; private Scalar s2; - private Scalar dstScalar; @Override protected void setUp() throws Exception { super.setUp(); s1 = new Scalar(1.0); - s2 = Scalar.all(1.0); + s2 = Scalar.all(1.0); dstScalar = null; } @@ -42,6 +42,10 @@ public class ScalarTest extends OpenCVTestCase { assertFalse(s2.equals(s1)); } + public void testHashCode() { + assertEquals(s2.hashCode(), s2.hashCode()); + } + public void testIsReal() { assertTrue(s1.isReal()); @@ -68,8 +72,8 @@ public class ScalarTest extends OpenCVTestCase { public void testScalarDoubleArray() { double[] vals = { 2.0, 4.0, 5.0, 3.0 }; dstScalar = new Scalar(vals); - - Scalar truth = new Scalar(2.0, 4.0, 5.0, 3.0); + + Scalar truth = new Scalar(2.0, 4.0, 5.0, 3.0); assertEquals(truth, dstScalar); } diff --git a/modules/java/android_test/src/org/opencv/test/core/SizeTest.java b/modules/java/android_test/src/org/opencv/test/core/SizeTest.java index 2ca04a7..a624a7c 100644 --- a/modules/java/android_test/src/org/opencv/test/core/SizeTest.java +++ b/modules/java/android_test/src/org/opencv/test/core/SizeTest.java @@ -6,14 +6,14 @@ import org.opencv.test.OpenCVTestCase; public class SizeTest extends OpenCVTestCase { + Size dstSize; Size sz1; Size sz2; - Size dstSize; @Override protected void setUp() throws Exception { super.setUp(); - + sz1 = new Size(10.0, 10.0); sz2 = new Size(-1, -1); dstSize = null; @@ -36,6 +36,10 @@ public class SizeTest extends OpenCVTestCase { assertTrue(sz1.equals(sz2)); } + public void testHashCode() { + assertEquals(sz1.hashCode(), sz1.hashCode()); + } + public void testSet() { double[] vals1 = {}; sz2.set(vals1); @@ -43,14 +47,14 @@ public class SizeTest extends OpenCVTestCase { assertEquals(0., sz2.height); double[] vals2 = { 9, 12 }; - sz1 .set(vals2); + sz1.set(vals2); assertEquals(9., sz1.width); assertEquals(12., sz1.height); } public void testSize() { dstSize = new Size(); - + assertNotNull(dstSize); assertEquals(0., dstSize.width); assertEquals(0., dstSize.height); diff --git a/modules/java/android_test/src/org/opencv/test/core/TermCriteriaTest.java b/modules/java/android_test/src/org/opencv/test/core/TermCriteriaTest.java index f3bfbf4..656d761 100644 --- a/modules/java/android_test/src/org/opencv/test/core/TermCriteriaTest.java +++ b/modules/java/android_test/src/org/opencv/test/core/TermCriteriaTest.java @@ -11,7 +11,7 @@ public class TermCriteriaTest extends OpenCVTestCase { @Override protected void setUp() throws Exception { super.setUp(); - + tc1 = new TermCriteria(); tc2 = new TermCriteria(2, 4, EPS); } @@ -28,6 +28,10 @@ public class TermCriteriaTest extends OpenCVTestCase { assertTrue(tc2.equals(tc1)); } + public void testHashCode() { + assertEquals(tc2.hashCode(), tc2.hashCode()); + } + public void testSet() { double[] vals1 = {}; tc1.set(vals1); @@ -46,7 +50,7 @@ public class TermCriteriaTest extends OpenCVTestCase { public void testTermCriteria() { tc1 = new TermCriteria(); - + assertNotNull(tc1); assertEquals(0, tc1.type); assertEquals(0, tc1.maxCount); @@ -64,7 +68,7 @@ public class TermCriteriaTest extends OpenCVTestCase { public void testTermCriteriaIntIntDouble() { tc1 = new TermCriteria(2, 4, EPS); - + assertNotNull(tc2); assertEquals(2, tc2.type); assertEquals(4, tc2.maxCount); diff --git a/modules/java/android_test/src/org/opencv/test/features2d/BRIEFDescriptorExtractorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/BRIEFDescriptorExtractorTest.java index c7eeb71..284981d 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/BRIEFDescriptorExtractorTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/BRIEFDescriptorExtractorTest.java @@ -34,7 +34,11 @@ public class BRIEFDescriptorExtractorTest extends OpenCVTestCase { super.setUp(); } - public void testCompute() { + public void testComputeListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testComputeMatListOfKeyPointMat() { KeyPoint point = new KeyPoint(55.775577545166016f, 44.224422454833984f, 16, 9.754629f, 8617.863f, 1, -1); List keypoints = Arrays.asList(point); Mat img = getTestImg(); diff --git a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceDescriptorMatcherTest.java b/modules/java/android_test/src/org/opencv/test/features2d/BruteForceDescriptorMatcherTest.java index 44ca899..0f6b8f2 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceDescriptorMatcherTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/BruteForceDescriptorMatcherTest.java @@ -23,34 +23,12 @@ public class BruteForceDescriptorMatcherTest extends OpenCVTestCase { int matSize; DMatch[] truth; - protected void setUp() throws Exception { - matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE); - matSize = 100; - - truth = new DMatch[] { - new DMatch(0, 0, 0, 0.643284f), - new DMatch(1, 1, 0, 0.92945856f), - new DMatch(2, 1, 0, 0.2841479f), - new DMatch(3, 1, 0, 0.9194034f), - new DMatch(4, 1, 0, 0.3006621f) }; - - super.setUp(); - } - - private Mat getTrainImg() { - Mat cross = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255)); - Core.line(cross, new Point(20, matSize / 2), new Point(matSize - 21, matSize / 2), new Scalar(100), 2); - Core.line(cross, new Point(matSize / 2, 20), new Point(matSize / 2, matSize - 21), new Scalar(100), 2); - - return cross; - } - - private Mat getQueryImg() { - Mat cross = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255)); - Core.line(cross, new Point(30, matSize / 2), new Point(matSize - 31, matSize / 2), new Scalar(100), 3); - Core.line(cross, new Point(matSize / 2, 30), new Point(matSize / 2, matSize - 31), new Scalar(100), 3); - - return cross; + private Mat getMaskImg() { + return new Mat(5, 2, CvType.CV_8U, new Scalar(0)) { + { + put(0, 0, 1, 1, 1, 1); + } + }; } private Mat getQueryDescriptors() { @@ -71,6 +49,14 @@ public class BruteForceDescriptorMatcherTest extends OpenCVTestCase { return descriptors; } + private Mat getQueryImg() { + Mat cross = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255)); + Core.line(cross, new Point(30, matSize / 2), new Point(matSize - 31, matSize / 2), new Scalar(100), 3); + Core.line(cross, new Point(matSize / 2, 30), new Point(matSize / 2, matSize - 31), new Scalar(100), 3); + + return cross; + } + private Mat getTrainDescriptors() { Mat img = getTrainImg(); List keypoints = Arrays.asList(new KeyPoint(50, 50, 16, 0, 20000, 1, -1), new KeyPoint(42, 42, 16, 160, 10000, 1, -1)); @@ -83,12 +69,26 @@ public class BruteForceDescriptorMatcherTest extends OpenCVTestCase { return descriptors; } - private Mat getMaskImg() { - return new Mat(5, 2, CvType.CV_8U, new Scalar(0)) { - { - put(0,0, 1, 1, 1, 1); - } - }; + private Mat getTrainImg() { + Mat cross = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255)); + Core.line(cross, new Point(20, matSize / 2), new Point(matSize - 21, matSize / 2), new Scalar(100), 2); + Core.line(cross, new Point(matSize / 2, 20), new Point(matSize / 2, matSize - 21), new Scalar(100), 2); + + return cross; + } + + protected void setUp() throws Exception { + matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE); + matSize = 100; + + truth = new DMatch[] { + new DMatch(0, 0, 0, 0.643284f), + new DMatch(1, 1, 0, 0.92945856f), + new DMatch(2, 1, 0, 0.2841479f), + new DMatch(3, 1, 0, 0.9194034f), + new DMatch(4, 1, 0, 0.3006621f) }; + + super.setUp(); } public void testAdd() { @@ -104,15 +104,6 @@ public class BruteForceDescriptorMatcherTest extends OpenCVTestCase { assertTrue(matcher.empty()); } - public void testCloneBoolean() { - matcher.add(Arrays.asList(new Mat())); - - DescriptorMatcher cloned = matcher.clone(true); - - assertNotNull(cloned); - assertTrue(cloned.empty()); - } - public void testClone() { Mat train = new Mat(1, 1, CvType.CV_8U, new Scalar(123)); Mat truth = train.clone(); @@ -127,6 +118,15 @@ public class BruteForceDescriptorMatcherTest extends OpenCVTestCase { assertMatEqual(truth, descriptors.get(0)); } + public void testCloneBoolean() { + matcher.add(Arrays.asList(new Mat())); + + DescriptorMatcher cloned = matcher.clone(true); + + assertNotNull(cloned); + assertTrue(cloned.empty()); + } + public void testCreate() { assertNotNull(matcher); } @@ -150,13 +150,49 @@ public class BruteForceDescriptorMatcherTest extends OpenCVTestCase { assertTrue(matcher.isMaskSupported()); } - public void testMatchMatMatListOfDMatchMat() { + public void testKnnMatchMatListOfListOfDMatchInt() { + fail("Not yet implemented"); + } + + public void testKnnMatchMatListOfListOfDMatchIntListOfMat() { + fail("Not yet implemented"); + } + + public void testKnnMatchMatListOfListOfDMatchIntListOfMatBoolean() { + fail("Not yet implemented"); + } + + public void testKnnMatchMatMatListOfListOfDMatchInt() { + fail("Not yet implemented"); + } + + public void testKnnMatchMatMatListOfListOfDMatchIntMat() { + fail("Not yet implemented"); + } + + public void testKnnMatchMatMatListOfListOfDMatchIntMatBoolean() { + fail("Not yet implemented"); + } + + public void testMatchMatListOfDMatch() { + Mat train = getTrainDescriptors(); + Mat query = getQueryDescriptors(); + List matches = new ArrayList(); + matcher.add(Arrays.asList(train)); + + matcher.match(query, matches); + + assertListDMatchEquals(Arrays.asList(truth), matches, EPS); + } + + public void testMatchMatListOfDMatchListOfMat() { Mat train = getTrainDescriptors(); Mat query = getQueryDescriptors(); Mat mask = getMaskImg(); List matches = new ArrayList(); - - matcher.match(query, train, matches, mask); + matcher.add(Arrays.asList(train)); + + matcher.match(query, matches, Arrays.asList(mask)); assertListDMatchEquals(Arrays.asList(truth[0], truth[1]), matches, EPS); } @@ -165,37 +201,49 @@ public class BruteForceDescriptorMatcherTest extends OpenCVTestCase { Mat train = getTrainDescriptors(); Mat query = getQueryDescriptors(); List matches = new ArrayList(); - + matcher.match(query, train, matches); - + assertListDMatchEquals(Arrays.asList(truth), matches, EPS); -// OpenCVTestRunner.Log("matches found: " + matches.size()); -// for (DMatch m : matches) -// OpenCVTestRunner.Log(m.toString()); + // OpenCVTestRunner.Log("matches found: " + matches.size()); + // for (DMatch m : matches) + // OpenCVTestRunner.Log(m.toString()); } - public void testMatchMatListOfDMatchListOfMat() { + public void testMatchMatMatListOfDMatchMat() { Mat train = getTrainDescriptors(); Mat query = getQueryDescriptors(); Mat mask = getMaskImg(); List matches = new ArrayList(); - matcher.add(Arrays.asList(train)); - matcher.match(query, matches, Arrays.asList(mask)); + matcher.match(query, train, matches, mask); assertListDMatchEquals(Arrays.asList(truth[0], truth[1]), matches, EPS); } - public void testMatchMatListOfDMatch() { - Mat train = getTrainDescriptors(); - Mat query = getQueryDescriptors(); - List matches = new ArrayList(); - matcher.add(Arrays.asList(train)); - - matcher.match(query, matches); - - assertListDMatchEquals(Arrays.asList(truth), matches, EPS); + public void testRadiusMatchMatListOfListOfDMatchFloat() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatListOfListOfDMatchFloatListOfMat() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatListOfListOfDMatchFloatListOfMatBoolean() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatMatListOfListOfDMatchFloat() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatMatListOfListOfDMatchFloatMat() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatMatListOfListOfDMatchFloatMatBoolean() { + fail("Not yet implemented"); } public void testRead() { diff --git a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingDescriptorMatcherTest.java b/modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingDescriptorMatcherTest.java index 5324f70..5a95d40 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingDescriptorMatcherTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingDescriptorMatcherTest.java @@ -23,30 +23,24 @@ public class BruteForceHammingDescriptorMatcherTest extends OpenCVTestCase { int matSize; DMatch[] truth; - protected void setUp() throws Exception { - matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE_HAMMING); - matSize = 100; - - truth = new DMatch[] { - new DMatch (0, 0, 0, 51), - new DMatch (1, 2, 0, 42), - new DMatch (2, 1, 0, 40), - new DMatch (3, 3, 0, 53) }; - super.setUp(); + private Mat getMaskImg() { + return new Mat(4, 4, CvType.CV_8U, new Scalar(0)) { + { + put(0, 0, 1, 1, 1, 1, 1, 1, 1, 1); + } + }; } - private Mat getTrainImg() { - Mat img = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255)); - Core.line(img, new Point(40, 40), new Point(matSize - 40, matSize - 40), new Scalar(0), 8); - return img; + private Mat getQueryDescriptors() { + return getTestDescriptors(getQueryImg()); } - + private Mat getQueryImg() { Mat img = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255)); Core.line(img, new Point(40, matSize - 40), new Point(matSize - 50, 50), new Scalar(0), 8); return img; } - + private Mat getTestDescriptors(Mat img) { List keypoints = new ArrayList(); Mat descriptors = new Mat(); @@ -56,24 +50,30 @@ public class BruteForceHammingDescriptorMatcherTest extends OpenCVTestCase { detector.detect(img, keypoints); extractor.compute(img, keypoints, descriptors); - + return descriptors; } - private Mat getQueryDescriptors() { - return getTestDescriptors(getQueryImg()); - } - private Mat getTrainDescriptors() { return getTestDescriptors(getTrainImg()); } - private Mat getMaskImg() { - return new Mat(4, 4, CvType.CV_8U, new Scalar(0)) { - { - put(0, 0, 1, 1, 1, 1, 1, 1, 1, 1); - } - }; + private Mat getTrainImg() { + Mat img = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255)); + Core.line(img, new Point(40, 40), new Point(matSize - 40, matSize - 40), new Scalar(0), 8); + return img; + } + + protected void setUp() throws Exception { + matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE_HAMMING); + matSize = 100; + + truth = new DMatch[] { + new DMatch(0, 0, 0, 51), + new DMatch(1, 2, 0, 42), + new DMatch(2, 1, 0, 40), + new DMatch(3, 3, 0, 53) }; + super.setUp(); } public void testAdd() { @@ -89,15 +89,6 @@ public class BruteForceHammingDescriptorMatcherTest extends OpenCVTestCase { assertTrue(matcher.empty()); } - public void testCloneBoolean() { - matcher.add(Arrays.asList(new Mat())); - - DescriptorMatcher cloned = matcher.clone(true); - - assertNotNull(cloned); - assertTrue(cloned.empty()); - } - public void testClone() { Mat train = new Mat(1, 1, CvType.CV_8U, new Scalar(123)); Mat truth = train.clone(); @@ -112,6 +103,15 @@ public class BruteForceHammingDescriptorMatcherTest extends OpenCVTestCase { assertMatEqual(truth, descriptors.get(0)); } + public void testCloneBoolean() { + matcher.add(Arrays.asList(new Mat())); + + DescriptorMatcher cloned = matcher.clone(true); + + assertNotNull(cloned); + assertTrue(cloned.empty()); + } + public void testCreate() { assertNotNull(matcher); } @@ -135,24 +135,38 @@ public class BruteForceHammingDescriptorMatcherTest extends OpenCVTestCase { assertTrue(matcher.isMaskSupported()); } - public void testMatchMatMatListOfDMatchMat() { - Mat train = getTrainDescriptors(); - Mat query = getQueryDescriptors(); - Mat mask = getMaskImg(); - List matches = new ArrayList(); - - matcher.match(query, train, matches, mask); + public void testKnnMatchMatListOfListOfDMatchInt() { + fail("Not yet implemented"); + } - assertListDMatchEquals(Arrays.asList(truth[0], truth[1]), matches, EPS); + public void testKnnMatchMatListOfListOfDMatchIntListOfMat() { + fail("Not yet implemented"); } - public void testMatchMatMatListOfDMatch() { + public void testKnnMatchMatListOfListOfDMatchIntListOfMatBoolean() { + fail("Not yet implemented"); + } + + public void testKnnMatchMatMatListOfListOfDMatchInt() { + fail("Not yet implemented"); + } + + public void testKnnMatchMatMatListOfListOfDMatchIntMat() { + fail("Not yet implemented"); + } + + public void testKnnMatchMatMatListOfListOfDMatchIntMatBoolean() { + fail("Not yet implemented"); + } + + public void testMatchMatListOfDMatch() { Mat train = getTrainDescriptors(); Mat query = getQueryDescriptors(); List matches = new ArrayList(); - - matcher.match(query, train, matches); - + matcher.add(Arrays.asList(train)); + + matcher.match(query, matches); + assertListDMatchEquals(Arrays.asList(truth), matches, EPS); } @@ -168,17 +182,51 @@ public class BruteForceHammingDescriptorMatcherTest extends OpenCVTestCase { assertListDMatchEquals(Arrays.asList(truth[0], truth[1]), matches, EPS); } - public void testMatchMatListOfDMatch() { + public void testMatchMatMatListOfDMatch() { Mat train = getTrainDescriptors(); Mat query = getQueryDescriptors(); List matches = new ArrayList(); - matcher.add(Arrays.asList(train)); - - matcher.match(query, matches); - + + matcher.match(query, train, matches); + assertListDMatchEquals(Arrays.asList(truth), matches, EPS); } + public void testMatchMatMatListOfDMatchMat() { + Mat train = getTrainDescriptors(); + Mat query = getQueryDescriptors(); + Mat mask = getMaskImg(); + List matches = new ArrayList(); + + matcher.match(query, train, matches, mask); + + assertListDMatchEquals(Arrays.asList(truth[0], truth[1]), matches, EPS); + } + + public void testRadiusMatchMatListOfListOfDMatchFloat() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatListOfListOfDMatchFloatListOfMat() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatListOfListOfDMatchFloatListOfMatBoolean() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatMatListOfListOfDMatchFloat() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatMatListOfListOfDMatchFloatMat() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatMatListOfListOfDMatchFloatMatBoolean() { + fail("Not yet implemented"); + } + public void testRead() { String filename = OpenCVTestRunner.getTempFileName("yml"); writeFile(filename, "%YAML:1.0\n"); diff --git a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingLUTDescriptorMatcherTest.java b/modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingLUTDescriptorMatcherTest.java index 48b3c57..c364cd6 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingLUTDescriptorMatcherTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingLUTDescriptorMatcherTest.java @@ -23,30 +23,24 @@ public class BruteForceHammingLUTDescriptorMatcherTest extends OpenCVTestCase { int matSize; DMatch[] truth; - protected void setUp() throws Exception { - matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE_HAMMINGLUT); - matSize = 100; - - truth = new DMatch[] { - new DMatch (0, 0, 0, 51), - new DMatch (1, 2, 0, 42), - new DMatch (2, 1, 0, 40), - new DMatch (3, 3, 0, 53) }; - super.setUp(); + private Mat getMaskImg() { + return new Mat(4, 4, CvType.CV_8U, new Scalar(0)) { + { + put(0, 0, 1, 1, 1, 1, 1, 1, 1, 1); + } + }; } - private Mat getTrainImg() { - Mat img = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255)); - Core.line(img, new Point(40, 40), new Point(matSize - 40, matSize - 40), new Scalar(0), 8); - return img; + private Mat getQueryDescriptors() { + return getTestDescriptors(getQueryImg()); } - + private Mat getQueryImg() { Mat img = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255)); Core.line(img, new Point(40, matSize - 40), new Point(matSize - 50, 50), new Scalar(0), 8); return img; } - + private Mat getTestDescriptors(Mat img) { List keypoints = new ArrayList(); Mat descriptors = new Mat(); @@ -56,24 +50,30 @@ public class BruteForceHammingLUTDescriptorMatcherTest extends OpenCVTestCase { detector.detect(img, keypoints); extractor.compute(img, keypoints, descriptors); - + return descriptors; } - private Mat getQueryDescriptors() { - return getTestDescriptors(getQueryImg()); - } - private Mat getTrainDescriptors() { return getTestDescriptors(getTrainImg()); } - private Mat getMaskImg() { - return new Mat(4, 4, CvType.CV_8U, new Scalar(0)) { - { - put(0, 0, 1, 1, 1, 1, 1, 1, 1, 1); - } - }; + private Mat getTrainImg() { + Mat img = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255)); + Core.line(img, new Point(40, 40), new Point(matSize - 40, matSize - 40), new Scalar(0), 8); + return img; + } + + protected void setUp() throws Exception { + matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE_HAMMINGLUT); + matSize = 100; + + truth = new DMatch[] { + new DMatch(0, 0, 0, 51), + new DMatch(1, 2, 0, 42), + new DMatch(2, 1, 0, 40), + new DMatch(3, 3, 0, 53) }; + super.setUp(); } public void testAdd() { @@ -89,15 +89,6 @@ public class BruteForceHammingLUTDescriptorMatcherTest extends OpenCVTestCase { assertTrue(matcher.empty()); } - public void testCloneBoolean() { - matcher.add(Arrays.asList(new Mat())); - - DescriptorMatcher cloned = matcher.clone(true); - - assertNotNull(cloned); - assertTrue(cloned.empty()); - } - public void testClone() { Mat train = new Mat(1, 1, CvType.CV_8U, new Scalar(123)); Mat truth = train.clone(); @@ -112,6 +103,15 @@ public class BruteForceHammingLUTDescriptorMatcherTest extends OpenCVTestCase { assertMatEqual(truth, descriptors.get(0)); } + public void testCloneBoolean() { + matcher.add(Arrays.asList(new Mat())); + + DescriptorMatcher cloned = matcher.clone(true); + + assertNotNull(cloned); + assertTrue(cloned.empty()); + } + public void testCreate() { assertNotNull(matcher); } @@ -135,28 +135,38 @@ public class BruteForceHammingLUTDescriptorMatcherTest extends OpenCVTestCase { assertTrue(matcher.isMaskSupported()); } - public void testMatchMatMatListOfDMatchMat() { - Mat train = getTrainDescriptors(); - Mat query = getQueryDescriptors(); - Mat mask = getMaskImg(); - List matches = new ArrayList(); - - matcher.match(query, train, matches, mask); + public void testKnnMatchMatListOfListOfDMatchInt() { + fail("Not yet implemented"); + } - assertListDMatchEquals(Arrays.asList(truth[0], truth[1]), matches, EPS); + public void testKnnMatchMatListOfListOfDMatchIntListOfMat() { + fail("Not yet implemented"); } - public void testMatchMatMatListOfDMatch() { + public void testKnnMatchMatListOfListOfDMatchIntListOfMatBoolean() { + fail("Not yet implemented"); + } + + public void testKnnMatchMatMatListOfListOfDMatchInt() { + fail("Not yet implemented"); + } + + public void testKnnMatchMatMatListOfListOfDMatchIntMat() { + fail("Not yet implemented"); + } + + public void testKnnMatchMatMatListOfListOfDMatchIntMatBoolean() { + fail("Not yet implemented"); + } + + public void testMatchMatListOfDMatch() { Mat train = getTrainDescriptors(); Mat query = getQueryDescriptors(); List matches = new ArrayList(); - - matcher.match(query, train, matches); - - OpenCVTestRunner.Log("matches found: " + matches.size()); - for (DMatch m : matches) - OpenCVTestRunner.Log(m.toString()); - + matcher.add(Arrays.asList(train)); + + matcher.match(query, matches); + assertListDMatchEquals(Arrays.asList(truth), matches, EPS); } @@ -172,17 +182,55 @@ public class BruteForceHammingLUTDescriptorMatcherTest extends OpenCVTestCase { assertListDMatchEquals(Arrays.asList(truth[0], truth[1]), matches, EPS); } - public void testMatchMatListOfDMatch() { + public void testMatchMatMatListOfDMatch() { Mat train = getTrainDescriptors(); Mat query = getQueryDescriptors(); List matches = new ArrayList(); - matcher.add(Arrays.asList(train)); - - matcher.match(query, matches); - + + matcher.match(query, train, matches); + + OpenCVTestRunner.Log("matches found: " + matches.size()); + for (DMatch m : matches) + OpenCVTestRunner.Log(m.toString()); + assertListDMatchEquals(Arrays.asList(truth), matches, EPS); } + public void testMatchMatMatListOfDMatchMat() { + Mat train = getTrainDescriptors(); + Mat query = getQueryDescriptors(); + Mat mask = getMaskImg(); + List matches = new ArrayList(); + + matcher.match(query, train, matches, mask); + + assertListDMatchEquals(Arrays.asList(truth[0], truth[1]), matches, EPS); + } + + public void testRadiusMatchMatListOfListOfDMatchFloat() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatListOfListOfDMatchFloatListOfMat() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatListOfListOfDMatchFloatListOfMatBoolean() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatMatListOfListOfDMatchFloat() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatMatListOfListOfDMatchFloatMat() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatMatListOfListOfDMatchFloatMatBoolean() { + fail("Not yet implemented"); + } + public void testRead() { String filename = OpenCVTestRunner.getTempFileName("yml"); writeFile(filename, "%YAML:1.0\n"); diff --git a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceL1DescriptorMatcherTest.java b/modules/java/android_test/src/org/opencv/test/features2d/BruteForceL1DescriptorMatcherTest.java index 4287b8e..4be17e8 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceL1DescriptorMatcherTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/BruteForceL1DescriptorMatcherTest.java @@ -23,33 +23,12 @@ public class BruteForceL1DescriptorMatcherTest extends OpenCVTestCase { int matSize; DMatch[] truth; - protected void setUp() throws Exception { - matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE_L1); - matSize = 100; - - truth = new DMatch[] { - new DMatch(0, 0, 0, 3.175296f), - new DMatch(1, 1, 0, 3.5954158f), - new DMatch(2, 1, 0, 1.2537984f), - new DMatch(3, 1, 0, 3.5761614f), - new DMatch(4, 1, 0, 1.3250958f) }; - super.setUp(); - } - - private Mat getTrainImg() { - Mat cross = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255)); - Core.line(cross, new Point(20, matSize / 2), new Point(matSize - 21, matSize / 2), new Scalar(100), 2); - Core.line(cross, new Point(matSize / 2, 20), new Point(matSize / 2, matSize - 21), new Scalar(100), 2); - - return cross; - } - - private Mat getQueryImg() { - Mat cross = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255)); - Core.line(cross, new Point(30, matSize / 2), new Point(matSize - 31, matSize / 2), new Scalar(100), 3); - Core.line(cross, new Point(matSize / 2, 30), new Point(matSize / 2, matSize - 31), new Scalar(100), 3); - - return cross; + private Mat getMaskImg() { + return new Mat(5, 2, CvType.CV_8U, new Scalar(0)) { + { + put(0, 0, 1, 1, 1, 1); + } + }; } private Mat getQueryDescriptors() { @@ -70,6 +49,14 @@ public class BruteForceL1DescriptorMatcherTest extends OpenCVTestCase { return descriptors; } + private Mat getQueryImg() { + Mat cross = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255)); + Core.line(cross, new Point(30, matSize / 2), new Point(matSize - 31, matSize / 2), new Scalar(100), 3); + Core.line(cross, new Point(matSize / 2, 30), new Point(matSize / 2, matSize - 31), new Scalar(100), 3); + + return cross; + } + private Mat getTrainDescriptors() { Mat img = getTrainImg(); List keypoints = Arrays.asList(new KeyPoint(50, 50, 16, 0, 20000, 1, -1), new KeyPoint(42, 42, 16, 160, 10000, 1, -1)); @@ -82,12 +69,25 @@ public class BruteForceL1DescriptorMatcherTest extends OpenCVTestCase { return descriptors; } - private Mat getMaskImg() { - return new Mat(5, 2, CvType.CV_8U, new Scalar(0)) { - { - put(0,0, 1, 1, 1, 1); - } - }; + private Mat getTrainImg() { + Mat cross = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255)); + Core.line(cross, new Point(20, matSize / 2), new Point(matSize - 21, matSize / 2), new Scalar(100), 2); + Core.line(cross, new Point(matSize / 2, 20), new Point(matSize / 2, matSize - 21), new Scalar(100), 2); + + return cross; + } + + protected void setUp() throws Exception { + matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE_L1); + matSize = 100; + + truth = new DMatch[] { + new DMatch(0, 0, 0, 3.175296f), + new DMatch(1, 1, 0, 3.5954158f), + new DMatch(2, 1, 0, 1.2537984f), + new DMatch(3, 1, 0, 3.5761614f), + new DMatch(4, 1, 0, 1.3250958f) }; + super.setUp(); } public void testAdd() { @@ -103,15 +103,6 @@ public class BruteForceL1DescriptorMatcherTest extends OpenCVTestCase { assertTrue(matcher.empty()); } - public void testCloneBoolean() { - matcher.add(Arrays.asList(new Mat())); - - DescriptorMatcher cloned = matcher.clone(true); - - assertNotNull(cloned); - assertTrue(cloned.empty()); - } - public void testClone() { Mat train = new Mat(1, 1, CvType.CV_8U, new Scalar(123)); Mat truth = train.clone(); @@ -126,6 +117,15 @@ public class BruteForceL1DescriptorMatcherTest extends OpenCVTestCase { assertMatEqual(truth, descriptors.get(0)); } + public void testCloneBoolean() { + matcher.add(Arrays.asList(new Mat())); + + DescriptorMatcher cloned = matcher.clone(true); + + assertNotNull(cloned); + assertTrue(cloned.empty()); + } + public void testCreate() { assertNotNull(matcher); } @@ -149,24 +149,38 @@ public class BruteForceL1DescriptorMatcherTest extends OpenCVTestCase { assertTrue(matcher.isMaskSupported()); } - public void testMatchMatMatListOfDMatchMat() { - Mat train = getTrainDescriptors(); - Mat query = getQueryDescriptors(); - Mat mask = getMaskImg(); - List matches = new ArrayList(); - - matcher.match(query, train, matches, mask); + public void testKnnMatchMatListOfListOfDMatchInt() { + fail("Not yet implemented"); + } - assertListDMatchEquals(Arrays.asList(truth[0], truth[1]), matches, EPS); + public void testKnnMatchMatListOfListOfDMatchIntListOfMat() { + fail("Not yet implemented"); } - public void testMatchMatMatListOfDMatch() { + public void testKnnMatchMatListOfListOfDMatchIntListOfMatBoolean() { + fail("Not yet implemented"); + } + + public void testKnnMatchMatMatListOfListOfDMatchInt() { + fail("Not yet implemented"); + } + + public void testKnnMatchMatMatListOfListOfDMatchIntMat() { + fail("Not yet implemented"); + } + + public void testKnnMatchMatMatListOfListOfDMatchIntMatBoolean() { + fail("Not yet implemented"); + } + + public void testMatchMatListOfDMatch() { Mat train = getTrainDescriptors(); Mat query = getQueryDescriptors(); List matches = new ArrayList(); - - matcher.match(query, train, matches); - + matcher.add(Arrays.asList(train)); + + matcher.match(query, matches); + assertListDMatchEquals(Arrays.asList(truth), matches, EPS); } @@ -182,17 +196,51 @@ public class BruteForceL1DescriptorMatcherTest extends OpenCVTestCase { assertListDMatchEquals(Arrays.asList(truth[0], truth[1]), matches, EPS); } - public void testMatchMatListOfDMatch() { + public void testMatchMatMatListOfDMatch() { Mat train = getTrainDescriptors(); Mat query = getQueryDescriptors(); List matches = new ArrayList(); - matcher.add(Arrays.asList(train)); - - matcher.match(query, matches); - + + matcher.match(query, train, matches); + assertListDMatchEquals(Arrays.asList(truth), matches, EPS); } + public void testMatchMatMatListOfDMatchMat() { + Mat train = getTrainDescriptors(); + Mat query = getQueryDescriptors(); + Mat mask = getMaskImg(); + List matches = new ArrayList(); + + matcher.match(query, train, matches, mask); + + assertListDMatchEquals(Arrays.asList(truth[0], truth[1]), matches, EPS); + } + + public void testRadiusMatchMatListOfListOfDMatchFloat() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatListOfListOfDMatchFloatListOfMat() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatListOfListOfDMatchFloatListOfMatBoolean() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatMatListOfListOfDMatchFloat() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatMatListOfListOfDMatchFloatMat() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatMatListOfListOfDMatchFloatMatBoolean() { + fail("Not yet implemented"); + } + public void testRead() { String filename = OpenCVTestRunner.getTempFileName("yml"); writeFile(filename, "%YAML:1.0\n"); diff --git a/modules/java/android_test/src/org/opencv/test/features2d/DMatchTest.java b/modules/java/android_test/src/org/opencv/test/features2d/DMatchTest.java new file mode 100644 index 0000000..ab5e730 --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/DMatchTest.java @@ -0,0 +1,27 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class DMatchTest extends TestCase { + + public void testDMatch() { + fail("Not yet implemented"); + } + + public void testDMatchIntIntFloat() { + fail("Not yet implemented"); + } + + public void testDMatchIntIntIntFloat() { + fail("Not yet implemented"); + } + + public void testLessThan() { + fail("Not yet implemented"); + } + + public void testToString() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/DynamicFASTFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/DynamicFASTFeatureDetectorTest.java new file mode 100644 index 0000000..770d4a5 --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/DynamicFASTFeatureDetectorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class DynamicFASTFeatureDetectorTest extends TestCase { + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/DynamicGFTTFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/DynamicGFTTFeatureDetectorTest.java new file mode 100644 index 0000000..83194bf --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/DynamicGFTTFeatureDetectorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class DynamicGFTTFeatureDetectorTest extends TestCase { + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/DynamicHARRISFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/DynamicHARRISFeatureDetectorTest.java new file mode 100644 index 0000000..51fb0fb --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/DynamicHARRISFeatureDetectorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class DynamicHARRISFeatureDetectorTest extends TestCase { + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/DynamicMSERFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/DynamicMSERFeatureDetectorTest.java new file mode 100644 index 0000000..202807c --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/DynamicMSERFeatureDetectorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class DynamicMSERFeatureDetectorTest extends TestCase { + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/DynamicORBFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/DynamicORBFeatureDetectorTest.java new file mode 100644 index 0000000..a0f1ab8 --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/DynamicORBFeatureDetectorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class DynamicORBFeatureDetectorTest extends TestCase { + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/DynamicSIFTFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/DynamicSIFTFeatureDetectorTest.java new file mode 100644 index 0000000..56f5a7c --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/DynamicSIFTFeatureDetectorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class DynamicSIFTFeatureDetectorTest extends TestCase { + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/DynamicSTARFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/DynamicSTARFeatureDetectorTest.java new file mode 100644 index 0000000..d4e687f --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/DynamicSTARFeatureDetectorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class DynamicSTARFeatureDetectorTest extends TestCase { + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/DynamicSURFFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/DynamicSURFFeatureDetectorTest.java new file mode 100644 index 0000000..34a767c --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/DynamicSURFFeatureDetectorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class DynamicSURFFeatureDetectorTest extends TestCase { + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/FASTFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/FASTFeatureDetectorTest.java index 61ac4fd..13d1357 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/FASTFeatureDetectorTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/FASTFeatureDetectorTest.java @@ -19,14 +19,11 @@ public class FASTFeatureDetectorTest extends OpenCVTestCase { FeatureDetector detector; KeyPoint[] truth; - @Override - protected void setUp() throws Exception { - detector = FeatureDetector.create(FeatureDetector.FAST); - - truth = new KeyPoint[] { new KeyPoint(32, 27, 6, -1, 254, 0, -1), new KeyPoint(27, 32, 6, -1, 254, 0, -1), new KeyPoint(73, 68, 6, -1, 254, 0, -1), - new KeyPoint(68, 73, 6, -1, 254, 0, -1) }; - - super.setUp(); + private Mat getMaskImg() { + Mat mask = new Mat(100, 100, CvType.CV_8U, new Scalar(255)); + Mat right = mask.submat(0, 100, 50, 100); + right.setTo(new Scalar(0)); + return mask; } private Mat getTestImg() { @@ -35,25 +32,26 @@ public class FASTFeatureDetectorTest extends OpenCVTestCase { return img; } - private Mat getMaskImg() { - Mat mask = new Mat(100, 100, CvType.CV_8U, new Scalar(255)); - Mat right = mask.submat(0, 100, 50, 100); - right.setTo(new Scalar(0)); - return mask; + @Override + protected void setUp() throws Exception { + detector = FeatureDetector.create(FeatureDetector.FAST); + + truth = new KeyPoint[] { new KeyPoint(32, 27, 6, -1, 254, 0, -1), new KeyPoint(27, 32, 6, -1, 254, 0, -1), new KeyPoint(73, 68, 6, -1, 254, 0, -1), + new KeyPoint(68, 73, 6, -1, 254, 0, -1) }; + + super.setUp(); } public void testCreate() { assertNotNull(detector); } - public void testDetectMatListOfKeyPointMat() { - Mat img = getTestImg(); - Mat mask = getMaskImg(); - List keypoints = new ArrayList(); - - detector.detect(img, keypoints, mask); + public void testDetectListOfMatListOfListOfKeyPoint() { + fail("Not yet implemented"); + } - assertListKeyPointEquals(Arrays.asList(truth[0], truth[1]), keypoints, EPS); + public void testDetectListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); } public void testDetectMatListOfKeyPoint() { @@ -69,6 +67,16 @@ public class FASTFeatureDetectorTest extends OpenCVTestCase { // OpenCVTestRunner.Log(kp.toString()); } + public void testDetectMatListOfKeyPointMat() { + Mat img = getTestImg(); + Mat mask = getMaskImg(); + List keypoints = new ArrayList(); + + detector.detect(img, keypoints, mask); + + assertListKeyPointEquals(Arrays.asList(truth[0], truth[1]), keypoints, EPS); + } + public void testEmpty() { assertFalse(detector.empty()); } diff --git a/modules/java/android_test/src/org/opencv/test/features2d/features2dTest.java b/modules/java/android_test/src/org/opencv/test/features2d/Features2dTest.java similarity index 57% rename from modules/java/android_test/src/org/opencv/test/features2d/features2dTest.java rename to modules/java/android_test/src/org/opencv/test/features2d/Features2dTest.java index e9b4d94..bdaf4ef 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/features2dTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/Features2dTest.java @@ -19,66 +19,119 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -public class features2dTest extends OpenCVTestCase { - +public class Features2dTest extends OpenCVTestCase { + + public void testDrawKeypointsMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testDrawKeypointsMatListOfKeyPointMatScalar() { + fail("Not yet implemented"); + } + + public void testDrawKeypointsMatListOfKeyPointMatScalarInt() { + fail("Not yet implemented"); + } + + public void testDrawMatches2MatListOfKeyPointMatListOfKeyPointListOfListOfDMatchMat() { + fail("Not yet implemented"); + } + + public void testDrawMatches2MatListOfKeyPointMatListOfKeyPointListOfListOfDMatchMatScalar() { + fail("Not yet implemented"); + } + + public void testDrawMatches2MatListOfKeyPointMatListOfKeyPointListOfListOfDMatchMatScalarScalar() { + fail("Not yet implemented"); + } + + public void testDrawMatches2MatListOfKeyPointMatListOfKeyPointListOfListOfDMatchMatScalarScalarListOfListOfByte() { + fail("Not yet implemented"); + } + + public void testDrawMatches2MatListOfKeyPointMatListOfKeyPointListOfListOfDMatchMatScalarScalarListOfListOfByteInt() { + fail("Not yet implemented"); + } + + public void testDrawMatchesMatListOfKeyPointMatListOfKeyPointListOfDMatchMat() { + fail("Not yet implemented"); + } + + public void testDrawMatchesMatListOfKeyPointMatListOfKeyPointListOfDMatchMatScalar() { + fail("Not yet implemented"); + } + + public void testDrawMatchesMatListOfKeyPointMatListOfKeyPointListOfDMatchMatScalarScalar() { + fail("Not yet implemented"); + } + + public void testDrawMatchesMatListOfKeyPointMatListOfKeyPointListOfDMatchMatScalarScalarListOfByte() { + fail("Not yet implemented"); + } + + public void testDrawMatchesMatListOfKeyPointMatListOfKeyPointListOfDMatchMatScalarScalarListOfByteInt() { + fail("Not yet implemented"); + } + public void testPTOD() { String detectorCfg = "%YAML:1.0\nhessianThreshold: 4000.\noctaves: 3\noctaveLayers: 4\nupright: 0\n"; String extractorCfg = "%YAML:1.0\nnOctaves: 4\nnOctaveLayers: 2\nextended: 0\nupright: 0\n"; - + FeatureDetector detector = FeatureDetector.create(FeatureDetector.SURF); DescriptorExtractor extractor = DescriptorExtractor.create(DescriptorExtractor.SURF); DescriptorMatcher matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE); - + String detectorCfgFile = OpenCVTestRunner.getTempFileName("yml"); writeFile(detectorCfgFile, detectorCfg); detector.read(detectorCfgFile); - + String extractorCfgFile = OpenCVTestRunner.getTempFileName("yml"); writeFile(extractorCfgFile, extractorCfg); extractor.read(extractorCfgFile); - + Mat imgTrain = Highgui.imread(OpenCVTestRunner.LENA_PATH, Highgui.CV_LOAD_IMAGE_GRAYSCALE); - Mat imgQuery = imgTrain.submat(new Range(0, imgTrain.rows()-100), Range.all()); - + Mat imgQuery = imgTrain.submat(new Range(0, imgTrain.rows() - 100), Range.all()); + List trainKeypoints = new ArrayList(); List queryKeypoints = new ArrayList(); - + detector.detect(imgTrain, trainKeypoints); detector.detect(imgQuery, queryKeypoints); - - //OpenCVTestRunner.Log("Keypoints found: " + trainKeypoints.size() + ":" + queryKeypoints.size()); - + + // OpenCVTestRunner.Log("Keypoints found: " + trainKeypoints.size() + + // ":" + queryKeypoints.size()); + Mat trainDescriptors = new Mat(); Mat queryDescriptors = new Mat(); - + extractor.compute(imgTrain, trainKeypoints, trainDescriptors); extractor.compute(imgQuery, queryKeypoints, queryDescriptors); - + List matches = new ArrayList(); - + matcher.add(Arrays.asList(trainDescriptors)); matcher.match(queryDescriptors, matches); - - //OpenCVTestRunner.Log("Matches found: " + matches.size()); - + + // OpenCVTestRunner.Log("Matches found: " + matches.size()); + List points1 = new ArrayList(); List points2 = new ArrayList(); - - for(int i = 0; i < matches.size(); i++){ + + for (int i = 0; i < matches.size(); i++) { DMatch match = matches.get(i); points1.add(trainKeypoints.get(match.trainIdx).pt); points2.add(queryKeypoints.get(match.queryIdx).pt); } - + Mat hmg = Calib3d.findHomography(points1, points2, Calib3d.RANSAC); - + assertMatEqual(Mat.eye(3, 3, CvType.CV_64F), hmg, EPS); - + Mat outimg = new Mat(); Features2d.drawMatches(imgQuery, queryKeypoints, imgTrain, trainKeypoints, matches, outimg); String outputPath = OpenCVTestRunner.getOutputFileName("PTODresult.png"); Highgui.imwrite(outputPath, outimg); - //OpenCVTestRunner.Log("Output image is saved to: " + outputPath); + // OpenCVTestRunner.Log("Output image is saved to: " + outputPath); } } diff --git a/modules/java/android_test/src/org/opencv/test/features2d/FernGenericDescriptorMatcherTest.java b/modules/java/android_test/src/org/opencv/test/features2d/FernGenericDescriptorMatcherTest.java new file mode 100644 index 0000000..df4c69e --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/FernGenericDescriptorMatcherTest.java @@ -0,0 +1,127 @@ +package org.opencv.test.features2d; + +import org.opencv.test.OpenCVTestCase; + +public class FernGenericDescriptorMatcherTest extends OpenCVTestCase { + + public void testAdd() { + fail("Not yet implemented"); + } + + public void testClassifyMatListOfKeyPointMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testClassifyMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testClear() { + fail("Not yet implemented"); + } + + public void testCloneBoolean() { + fail("Not yet implemented"); + } + + public void testClone() { + fail("Not yet implemented"); + } + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testGetTrainImages() { + fail("Not yet implemented"); + } + + public void testGetTrainKeypoints() { + fail("Not yet implemented"); + } + + public void testIsMaskSupported() { + fail("Not yet implemented"); + } + + public void testKnnMatchMatListOfKeyPointMatListOfKeyPointListOfListOfDMatchIntMatBoolean() { + fail("Not yet implemented"); + } + + public void testKnnMatchMatListOfKeyPointMatListOfKeyPointListOfListOfDMatchIntMat() { + fail("Not yet implemented"); + } + + public void testKnnMatchMatListOfKeyPointMatListOfKeyPointListOfListOfDMatchInt() { + fail("Not yet implemented"); + } + + public void testKnnMatchMatListOfKeyPointListOfListOfDMatchIntListOfMatBoolean() { + fail("Not yet implemented"); + } + + public void testKnnMatchMatListOfKeyPointListOfListOfDMatchIntListOfMat() { + fail("Not yet implemented"); + } + + public void testKnnMatchMatListOfKeyPointListOfListOfDMatchInt() { + fail("Not yet implemented"); + } + + public void testMatchMatListOfKeyPointMatListOfKeyPointListOfDMatchMat() { + fail("Not yet implemented"); + } + + public void testMatchMatListOfKeyPointMatListOfKeyPointListOfDMatch() { + fail("Not yet implemented"); + } + + public void testMatchMatListOfKeyPointListOfDMatchListOfMat() { + fail("Not yet implemented"); + } + + public void testMatchMatListOfKeyPointListOfDMatch() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatListOfKeyPointMatListOfKeyPointListOfListOfDMatchFloatMatBoolean() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatListOfKeyPointMatListOfKeyPointListOfListOfDMatchFloatMat() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatListOfKeyPointMatListOfKeyPointListOfListOfDMatchFloat() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatListOfKeyPointListOfListOfDMatchFloatListOfMatBoolean() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatListOfKeyPointListOfListOfDMatchFloatListOfMat() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatListOfKeyPointListOfListOfDMatchFloat() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testTrain() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/FlannBasedDescriptorMatcherTest.java b/modules/java/android_test/src/org/opencv/test/features2d/FlannBasedDescriptorMatcherTest.java index d650595..21485b3 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/FlannBasedDescriptorMatcherTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/FlannBasedDescriptorMatcherTest.java @@ -20,111 +20,123 @@ import java.util.List; public class FlannBasedDescriptorMatcherTest extends OpenCVTestCase { + static final String xmlParamsDefault = "\n" + + "\n" + + "\n" + + " <_>\n" + + " algorithm\n" + + " 23\n" + + " 1\n" + + " <_>\n" + + " trees\n" + + " 4\n" + + " 4\n" + + "\n" + + " <_>\n" + + " checks\n" + + " 4\n" + + " 32\n" + + " <_>\n" + + " eps\n" + + " 5\n" + + " 0.\n" + + " <_>\n" + + " sorted\n" + + " 15\n" + + " 1\n" + + "\n"; + static final String ymlParamsDefault = "%YAML:1.0\n" + + "indexParams:\n" + + " -\n" + + " name: algorithm\n" + + " type: 23\n" + + " value: 1\n" + + " -\n" + + " name: trees\n" + + " type: 4\n" + + " value: 4\n" + + "searchParams:\n" + + " -\n" + + " name: checks\n" + + " type: 4\n" + + " value: 32\n" + + " -\n" + + " name: eps\n" + + " type: 5\n" + + " value: 0.\n" + + " -\n" + + " name: sorted\n" + + " type: 15\n" + + " value: 1\n"; + static final String ymlParamsModified = "%YAML:1.0\n" + + "indexParams:\n" + + " -\n" + + " name: algorithm\n" + + " type: 23\n" + + " value: 6\n"// this line is changed! + + " -\n" + + " name: trees\n" + + " type: 4\n" + + " value: 4\n" + + "searchParams:\n" + + " -\n" + + " name: checks\n" + + " type: 4\n" + + " value: 32\n" + + " -\n" + + " name: eps\n" + + " type: 5\n" + + " value: 0.\n" + + " -\n" + + " name: sorted\n" + + " type: 15\n" + + " value: 1\n"; + DescriptorMatcher matcher; + int matSize; - DMatch[] truth; - - static final String ymlParamsDefault = "%YAML:1.0\n" -+ "indexParams:\n" -+ " -\n" -+ " name: algorithm\n" -+ " type: 23\n" -+ " value: 1\n" -+ " -\n" -+ " name: trees\n" -+ " type: 4\n" -+ " value: 4\n" -+ "searchParams:\n" -+ " -\n" -+ " name: checks\n" -+ " type: 4\n" -+ " value: 32\n" -+ " -\n" -+ " name: eps\n" -+ " type: 5\n" -+ " value: 0.\n" -+ " -\n" -+ " name: sorted\n" -+ " type: 15\n" -+ " value: 1\n"; - - static final String xmlParamsDefault = "\n" -+ "\n" -+ "\n" -+ " <_>\n" -+ " algorithm\n" -+ " 23\n" -+ " 1\n" -+ " <_>\n" -+ " trees\n" -+ " 4\n" -+ " 4\n" -+ "\n" -+ " <_>\n" -+ " checks\n" -+ " 4\n" -+ " 32\n" -+ " <_>\n" -+ " eps\n" -+ " 5\n" -+ " 0.\n" -+ " <_>\n" -+ " sorted\n" -+ " 15\n" -+ " 1\n" -+ "\n"; - static final String ymlParamsModified = "%YAML:1.0\n" -+ "indexParams:\n" -+ " -\n" -+ " name: algorithm\n" -+ " type: 23\n" -+ " value: 6\n"//this line is changed -+ " -\n" -+ " name: trees\n" -+ " type: 4\n" -+ " value: 4\n" -+ "searchParams:\n" -+ " -\n" -+ " name: checks\n" -+ " type: 4\n" -+ " value: 32\n" -+ " -\n" -+ " name: eps\n" -+ " type: 5\n" -+ " value: 0.\n" -+ " -\n" -+ " name: sorted\n" -+ " type: 15\n" -+ " value: 1\n"; - protected void setUp() throws Exception { - matcher = DescriptorMatcher.create(DescriptorMatcher.FLANNBASED); - matSize = 100; + DMatch[] truth; - truth = new DMatch[] { - new DMatch(0, 0, 0, 0.643284f), - new DMatch(1, 1, 0, 0.92945856f), - new DMatch(2, 1, 0, 0.2841479f), - new DMatch(3, 1, 0, 0.9194034f), - new DMatch(4, 1, 0, 0.3006621f) }; + private Mat getBriefQueryDescriptors() { + return getBriefTestDescriptors(getBriefQueryImg()); + } - super.setUp(); + private Mat getBriefQueryImg() { + Mat img = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255)); + Core.line(img, new Point(40, matSize - 40), new Point(matSize - 50, 50), new Scalar(0), 8); + return img; } - private Mat getTrainImg() { - Mat cross = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255)); - Core.line(cross, new Point(20, matSize / 2), new Point(matSize - 21, matSize / 2), new Scalar(100), 2); - Core.line(cross, new Point(matSize / 2, 20), new Point(matSize / 2, matSize - 21), new Scalar(100), 2); + private Mat getBriefTestDescriptors(Mat img) { + List keypoints = new ArrayList(); + Mat descriptors = new Mat(); - return cross; + FeatureDetector detector = FeatureDetector.create(FeatureDetector.FAST); + DescriptorExtractor extractor = DescriptorExtractor.create(DescriptorExtractor.BRIEF); + + detector.detect(img, keypoints); + extractor.compute(img, keypoints, descriptors); + + return descriptors; } - private Mat getQueryImg() { - Mat cross = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255)); - Core.line(cross, new Point(30, matSize / 2), new Point(matSize - 31, matSize / 2), new Scalar(100), 3); - Core.line(cross, new Point(matSize / 2, 30), new Point(matSize / 2, matSize - 31), new Scalar(100), 3); + private Mat getBriefTrainDescriptors() { + return getBriefTestDescriptors(getBriefTrainImg()); + } - return cross; + private Mat getBriefTrainImg() { + Mat img = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255)); + Core.line(img, new Point(40, 40), new Point(matSize - 40, matSize - 40), new Scalar(0), 8); + return img; + } + + private Mat getMaskImg() { + return new Mat(5, 2, CvType.CV_8U, new Scalar(0)) { + { + put(0, 0, 1, 1, 1, 1); + } + }; } private Mat getQueryDescriptors() { @@ -145,6 +157,14 @@ public class FlannBasedDescriptorMatcherTest extends OpenCVTestCase { return descriptors; } + private Mat getQueryImg() { + Mat cross = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255)); + Core.line(cross, new Point(30, matSize / 2), new Point(matSize - 31, matSize / 2), new Scalar(100), 3); + Core.line(cross, new Point(matSize / 2, 30), new Point(matSize / 2, matSize - 31), new Scalar(100), 3); + + return cross; + } + private Mat getTrainDescriptors() { Mat img = getTrainImg(); List keypoints = Arrays.asList(new KeyPoint(50, 50, 16, 0, 20000, 1, -1), new KeyPoint(42, 42, 16, 160, 10000, 1, -1)); @@ -157,45 +177,26 @@ public class FlannBasedDescriptorMatcherTest extends OpenCVTestCase { return descriptors; } - private Mat getMaskImg() { - return new Mat(5, 2, CvType.CV_8U, new Scalar(0)) { - { - put(0,0, 1, 1, 1, 1); - } - }; - } - - private Mat getBriefTrainImg() { - Mat img = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255)); - Core.line(img, new Point(40, 40), new Point(matSize - 40, matSize - 40), new Scalar(0), 8); - return img; - } - - private Mat getBriefQueryImg() { - Mat img = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255)); - Core.line(img, new Point(40, matSize - 40), new Point(matSize - 50, 50), new Scalar(0), 8); - return img; + private Mat getTrainImg() { + Mat cross = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255)); + Core.line(cross, new Point(20, matSize / 2), new Point(matSize - 21, matSize / 2), new Scalar(100), 2); + Core.line(cross, new Point(matSize / 2, 20), new Point(matSize / 2, matSize - 21), new Scalar(100), 2); + + return cross; } - - private Mat getBriefTestDescriptors(Mat img) { - List keypoints = new ArrayList(); - Mat descriptors = new Mat(); - FeatureDetector detector = FeatureDetector.create(FeatureDetector.FAST); - DescriptorExtractor extractor = DescriptorExtractor.create(DescriptorExtractor.BRIEF); + protected void setUp() throws Exception { + matcher = DescriptorMatcher.create(DescriptorMatcher.FLANNBASED); + matSize = 100; - detector.detect(img, keypoints); - extractor.compute(img, keypoints, descriptors); - - return descriptors; - } + truth = new DMatch[] { + new DMatch(0, 0, 0, 0.643284f), + new DMatch(1, 1, 0, 0.92945856f), + new DMatch(2, 1, 0, 0.2841479f), + new DMatch(3, 1, 0, 0.9194034f), + new DMatch(4, 1, 0, 0.3006621f) }; - private Mat getBriefQueryDescriptors() { - return getBriefTestDescriptors(getBriefQueryImg()); - } - - private Mat getBriefTrainDescriptors() { - return getBriefTestDescriptors(getBriefTrainImg()); + super.setUp(); } public void testAdd() { @@ -211,15 +212,6 @@ public class FlannBasedDescriptorMatcherTest extends OpenCVTestCase { assertTrue(matcher.empty()); } - public void testCloneBoolean() { - matcher.add(Arrays.asList(new Mat())); - - DescriptorMatcher cloned = matcher.clone(true); - - assertNotNull(cloned); - assertTrue(cloned.empty()); - } - public void testClone() { Mat train = new Mat(1, 1, CvType.CV_8U, new Scalar(123)); matcher.add(Arrays.asList(train)); @@ -232,6 +224,15 @@ public class FlannBasedDescriptorMatcherTest extends OpenCVTestCase { } } + public void testCloneBoolean() { + matcher.add(Arrays.asList(new Mat())); + + DescriptorMatcher cloned = matcher.clone(true); + + assertNotNull(cloned); + assertTrue(cloned.empty()); + } + public void testCreate() { assertNotNull(matcher); } @@ -255,29 +256,40 @@ public class FlannBasedDescriptorMatcherTest extends OpenCVTestCase { assertFalse(matcher.isMaskSupported()); } - public void testMatchMatMatListOfDMatchMat() { - Mat train = getTrainDescriptors(); - Mat query = getQueryDescriptors(); - Mat mask = getMaskImg(); - List matches = new ArrayList(); - - matcher.match(query, train, matches, mask); + public void testKnnMatchMatListOfListOfDMatchInt() { + fail("Not yet implemented"); + } - assertListDMatchEquals(Arrays.asList(truth), matches, EPS); + public void testKnnMatchMatListOfListOfDMatchIntListOfMat() { + fail("Not yet implemented"); } - public void testMatchMatMatListOfDMatch() { + public void testKnnMatchMatListOfListOfDMatchIntListOfMatBoolean() { + fail("Not yet implemented"); + } + + public void testKnnMatchMatMatListOfListOfDMatchInt() { + fail("Not yet implemented"); + } + + public void testKnnMatchMatMatListOfListOfDMatchIntMat() { + fail("Not yet implemented"); + } + + public void testKnnMatchMatMatListOfListOfDMatchIntMatBoolean() { + fail("Not yet implemented"); + } + + public void testMatchMatListOfDMatch() { Mat train = getTrainDescriptors(); Mat query = getQueryDescriptors(); List matches = new ArrayList(); - - matcher.match(query, train, matches); - - assertListDMatchEquals(Arrays.asList(truth), matches, EPS); + matcher.add(Arrays.asList(train)); + matcher.train(); + + matcher.match(query, matches); -// OpenCVTestRunner.Log("matches found: " + matches.size()); -// for (DMatch m : matches) -// OpenCVTestRunner.Log(m.toString()); + assertListDMatchEquals(Arrays.asList(truth), matches, EPS); } public void testMatchMatListOfDMatchListOfMat() { @@ -293,34 +305,71 @@ public class FlannBasedDescriptorMatcherTest extends OpenCVTestCase { assertListDMatchEquals(Arrays.asList(truth), matches, EPS); } - public void testMatchMatListOfDMatch() { + public void testMatchMatMatListOfDMatch() { Mat train = getTrainDescriptors(); Mat query = getQueryDescriptors(); List matches = new ArrayList(); - matcher.add(Arrays.asList(train)); - matcher.train(); - - matcher.match(query, matches); - + + matcher.match(query, train, matches); + + assertListDMatchEquals(Arrays.asList(truth), matches, EPS); + + // OpenCVTestRunner.Log("matches found: " + matches.size()); + // for (DMatch m : matches) + // OpenCVTestRunner.Log(m.toString()); + } + + public void testMatchMatMatListOfDMatchMat() { + Mat train = getTrainDescriptors(); + Mat query = getQueryDescriptors(); + Mat mask = getMaskImg(); + List matches = new ArrayList(); + + matcher.match(query, train, matches, mask); + assertListDMatchEquals(Arrays.asList(truth), matches, EPS); } + public void testRadiusMatchMatListOfListOfDMatchFloat() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatListOfListOfDMatchFloatListOfMat() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatListOfListOfDMatchFloatListOfMatBoolean() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatMatListOfListOfDMatchFloat() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatMatListOfListOfDMatchFloatMat() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatMatListOfListOfDMatchFloatMatBoolean() { + fail("Not yet implemented"); + } + public void testRead() { String filename = OpenCVTestRunner.getTempFileName("yml"); writeFile(filename, ymlParamsModified); - + matcher.read(filename); - + Mat train = getBriefTrainDescriptors(); Mat query = getBriefQueryDescriptors(); List matches = new ArrayList(); - + matcher.match(query, train, matches); - - assertListDMatchEquals(Arrays.asList(new DMatch (0, 0, 0, 0), - new DMatch (1, 2, 0, 0), - new DMatch (2, 1, 0, 0), - new DMatch (3, 3, 0, 0)), matches, EPS); + + assertListDMatchEquals(Arrays.asList(new DMatch(0, 0, 0, 0), + new DMatch(1, 2, 0, 0), + new DMatch(2, 1, 0, 0), + new DMatch(3, 3, 0, 0)), matches, EPS); } public void testTrain() { @@ -328,7 +377,7 @@ public class FlannBasedDescriptorMatcherTest extends OpenCVTestCase { matcher.add(Arrays.asList(train)); matcher.train(); } - + public void testTrainNoData() { try { matcher.train(); diff --git a/modules/java/android_test/src/org/opencv/test/features2d/GFTTFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/GFTTFeatureDetectorTest.java new file mode 100644 index 0000000..09661c6 --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/GFTTFeatureDetectorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class GFTTFeatureDetectorTest extends TestCase { + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/GridFASTFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/GridFASTFeatureDetectorTest.java new file mode 100644 index 0000000..c4c6959 --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/GridFASTFeatureDetectorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class GridFASTFeatureDetectorTest extends TestCase { + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/GridGFTTFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/GridGFTTFeatureDetectorTest.java new file mode 100644 index 0000000..9181f97 --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/GridGFTTFeatureDetectorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class GridGFTTFeatureDetectorTest extends TestCase { + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/GridHARRISFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/GridHARRISFeatureDetectorTest.java new file mode 100644 index 0000000..86c7677 --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/GridHARRISFeatureDetectorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class GridHARRISFeatureDetectorTest extends TestCase { + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/GridMSERFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/GridMSERFeatureDetectorTest.java new file mode 100644 index 0000000..c761049 --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/GridMSERFeatureDetectorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class GridMSERFeatureDetectorTest extends TestCase { + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/GridORBFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/GridORBFeatureDetectorTest.java new file mode 100644 index 0000000..c987333 --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/GridORBFeatureDetectorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class GridORBFeatureDetectorTest extends TestCase { + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/GridSIFTFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/GridSIFTFeatureDetectorTest.java new file mode 100644 index 0000000..46d2a08 --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/GridSIFTFeatureDetectorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class GridSIFTFeatureDetectorTest extends TestCase { + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/GridSTARFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/GridSTARFeatureDetectorTest.java new file mode 100644 index 0000000..d78dc24 --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/GridSTARFeatureDetectorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class GridSTARFeatureDetectorTest extends TestCase { + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/GridSURFFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/GridSURFFeatureDetectorTest.java new file mode 100644 index 0000000..012d825 --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/GridSURFFeatureDetectorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class GridSURFFeatureDetectorTest extends TestCase { + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/HARRISFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/HARRISFeatureDetectorTest.java new file mode 100644 index 0000000..5e7fd7d --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/HARRISFeatureDetectorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class HARRISFeatureDetectorTest extends TestCase { + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/KeyPointTest.java b/modules/java/android_test/src/org/opencv/test/features2d/KeyPointTest.java index 1087049..4827d1a 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/KeyPointTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/KeyPointTest.java @@ -20,10 +20,6 @@ public class KeyPointTest extends OpenCVTestCase { size = 3.0f; } - public void test_1() { - super.test_1("features2d.KeyPoint"); - } - public void testGet_angle() { fail("Not yet implemented"); } @@ -102,4 +98,8 @@ public class KeyPointTest extends OpenCVTestCase { fail("Not yet implemented"); } + public void testToString() { + fail("Not yet implemented"); + } + } diff --git a/modules/java/android_test/src/org/opencv/test/features2d/MSERFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/MSERFeatureDetectorTest.java new file mode 100644 index 0000000..98ae4d7 --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/MSERFeatureDetectorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class MSERFeatureDetectorTest extends TestCase { + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/ORBDescriptorExtractorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/ORBDescriptorExtractorTest.java index 53e367d..0e46a0d 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/ORBDescriptorExtractorTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/ORBDescriptorExtractorTest.java @@ -34,7 +34,11 @@ public class ORBDescriptorExtractorTest extends OpenCVTestCase { super.setUp(); } - public void testCompute() { + public void testComputeListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testComputeMatListOfKeyPointMat() { KeyPoint point = new KeyPoint(55.775577545166016f, 44.224422454833984f, 16, 9.754629f, 8617.863f, 1, -1); List keypoints = Arrays.asList(point); Mat img = getTestImg(); @@ -72,17 +76,17 @@ public class ORBDescriptorExtractorTest extends OpenCVTestCase { List keypoints = Arrays.asList(point); Mat img = getTestImg(); Mat descriptors = new Mat(); - + String filename = OpenCVTestRunner.getTempFileName("yml"); writeFile(filename, "%YAML:1.0\nscaleFactor: 1.1\nnLevels: 3\nfirstLevel: 0\nedgeThreshold: 31\npatchSize: 31\n"); extractor.read(filename); - + extractor.compute(img, keypoints, descriptors); Mat truth = new Mat(1, 32, CvType.CV_8UC1) { { put(0, 0, 20, 55, 88, 20, 14, 49, 70, 111, 148, 144, 30, 16, 252, 133, 0, 8, 5, 85, 32, 0, 74, 25, 0, - 252, 119, 191, 4, 2, 66, 1, 66, 145); + 252, 119, 191, 4, 2, 66, 1, 66, 145); } }; assertMatEqual(truth, descriptors); diff --git a/modules/java/android_test/src/org/opencv/test/features2d/ORBFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/ORBFeatureDetectorTest.java new file mode 100644 index 0000000..b4c23d8 --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/ORBFeatureDetectorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class ORBFeatureDetectorTest extends TestCase { + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/OneWayGenericDescriptorMatcherTest.java b/modules/java/android_test/src/org/opencv/test/features2d/OneWayGenericDescriptorMatcherTest.java new file mode 100644 index 0000000..f964604 --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/OneWayGenericDescriptorMatcherTest.java @@ -0,0 +1,127 @@ +package org.opencv.test.features2d; + +import org.opencv.test.OpenCVTestCase; + +public class OneWayGenericDescriptorMatcherTest extends OpenCVTestCase { + + public void testAdd() { + fail("Not yet implemented"); + } + + public void testClassifyMatListOfKeyPointMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testClassifyMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testClear() { + fail("Not yet implemented"); + } + + public void testCloneBoolean() { + fail("Not yet implemented"); + } + + public void testClone() { + fail("Not yet implemented"); + } + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testGetTrainImages() { + fail("Not yet implemented"); + } + + public void testGetTrainKeypoints() { + fail("Not yet implemented"); + } + + public void testIsMaskSupported() { + fail("Not yet implemented"); + } + + public void testKnnMatchMatListOfKeyPointMatListOfKeyPointListOfListOfDMatchIntMatBoolean() { + fail("Not yet implemented"); + } + + public void testKnnMatchMatListOfKeyPointMatListOfKeyPointListOfListOfDMatchIntMat() { + fail("Not yet implemented"); + } + + public void testKnnMatchMatListOfKeyPointMatListOfKeyPointListOfListOfDMatchInt() { + fail("Not yet implemented"); + } + + public void testKnnMatchMatListOfKeyPointListOfListOfDMatchIntListOfMatBoolean() { + fail("Not yet implemented"); + } + + public void testKnnMatchMatListOfKeyPointListOfListOfDMatchIntListOfMat() { + fail("Not yet implemented"); + } + + public void testKnnMatchMatListOfKeyPointListOfListOfDMatchInt() { + fail("Not yet implemented"); + } + + public void testMatchMatListOfKeyPointMatListOfKeyPointListOfDMatchMat() { + fail("Not yet implemented"); + } + + public void testMatchMatListOfKeyPointMatListOfKeyPointListOfDMatch() { + fail("Not yet implemented"); + } + + public void testMatchMatListOfKeyPointListOfDMatchListOfMat() { + fail("Not yet implemented"); + } + + public void testMatchMatListOfKeyPointListOfDMatch() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatListOfKeyPointMatListOfKeyPointListOfListOfDMatchFloatMatBoolean() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatListOfKeyPointMatListOfKeyPointListOfListOfDMatchFloatMat() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatListOfKeyPointMatListOfKeyPointListOfListOfDMatchFloat() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatListOfKeyPointListOfListOfDMatchFloatListOfMatBoolean() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatListOfKeyPointListOfListOfDMatchFloatListOfMat() { + fail("Not yet implemented"); + } + + public void testRadiusMatchMatListOfKeyPointListOfListOfDMatchFloat() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testTrain() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/OpponentBRIEFDescriptorExtractorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/OpponentBRIEFDescriptorExtractorTest.java new file mode 100644 index 0000000..b158124 --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/OpponentBRIEFDescriptorExtractorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class OpponentBRIEFDescriptorExtractorTest extends TestCase { + + public void testComputeListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testComputeMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDescriptorSize() { + fail("Not yet implemented"); + } + + public void testDescriptorType() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/OpponentORBDescriptorExtractorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/OpponentORBDescriptorExtractorTest.java new file mode 100644 index 0000000..1ee5432 --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/OpponentORBDescriptorExtractorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class OpponentORBDescriptorExtractorTest extends TestCase { + + public void testComputeListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testComputeMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDescriptorSize() { + fail("Not yet implemented"); + } + + public void testDescriptorType() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/OpponentSIFTDescriptorExtractorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/OpponentSIFTDescriptorExtractorTest.java new file mode 100644 index 0000000..de20c14 --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/OpponentSIFTDescriptorExtractorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class OpponentSIFTDescriptorExtractorTest extends TestCase { + + public void testComputeListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testComputeMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDescriptorSize() { + fail("Not yet implemented"); + } + + public void testDescriptorType() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/OpponentSURFDescriptorExtractorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/OpponentSURFDescriptorExtractorTest.java new file mode 100644 index 0000000..e427128 --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/OpponentSURFDescriptorExtractorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class OpponentSURFDescriptorExtractorTest extends TestCase { + + public void testComputeListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testComputeMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDescriptorSize() { + fail("Not yet implemented"); + } + + public void testDescriptorType() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/PyramidFASTFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/PyramidFASTFeatureDetectorTest.java new file mode 100644 index 0000000..5527940 --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/PyramidFASTFeatureDetectorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class PyramidFASTFeatureDetectorTest extends TestCase { + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/PyramidGFTTFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/PyramidGFTTFeatureDetectorTest.java new file mode 100644 index 0000000..13c45f1 --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/PyramidGFTTFeatureDetectorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class PyramidGFTTFeatureDetectorTest extends TestCase { + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/PyramidHARRISFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/PyramidHARRISFeatureDetectorTest.java new file mode 100644 index 0000000..94ef841 --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/PyramidHARRISFeatureDetectorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class PyramidHARRISFeatureDetectorTest extends TestCase { + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/PyramidMSERFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/PyramidMSERFeatureDetectorTest.java new file mode 100644 index 0000000..c8891f7 --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/PyramidMSERFeatureDetectorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class PyramidMSERFeatureDetectorTest extends TestCase { + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/PyramidORBFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/PyramidORBFeatureDetectorTest.java new file mode 100644 index 0000000..a507e51 --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/PyramidORBFeatureDetectorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class PyramidORBFeatureDetectorTest extends TestCase { + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/PyramidSIFTFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/PyramidSIFTFeatureDetectorTest.java new file mode 100644 index 0000000..27aa5f6 --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/PyramidSIFTFeatureDetectorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class PyramidSIFTFeatureDetectorTest extends TestCase { + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/PyramidSTARFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/PyramidSTARFeatureDetectorTest.java new file mode 100644 index 0000000..ea82636 --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/PyramidSTARFeatureDetectorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class PyramidSTARFeatureDetectorTest extends TestCase { + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/PyramidSURFFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/PyramidSURFFeatureDetectorTest.java new file mode 100644 index 0000000..d212d0e --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/PyramidSURFFeatureDetectorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class PyramidSURFFeatureDetectorTest extends TestCase { + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/SIFTDescriptorExtractorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/SIFTDescriptorExtractorTest.java index c1329ab..b9d720c 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/SIFTDescriptorExtractorTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/SIFTDescriptorExtractorTest.java @@ -17,8 +17,8 @@ public class SIFTDescriptorExtractorTest extends OpenCVTestCase { DescriptorExtractor extractor; KeyPoint keypoint; - Mat truth; int matSize; + Mat truth; private Mat getTestImg() { Mat cross = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255)); @@ -35,7 +35,7 @@ public class SIFTDescriptorExtractorTest extends OpenCVTestCase { matSize = 100; truth = new Mat(1, 128, CvType.CV_32FC1) { { - put(0,0, 123, 0, 0, 1, 123, 0, 0, 1, 123, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + put(0, 0, 123, 0, 0, 1, 123, 0, 0, 1, 123, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 123, 0, 0, 2, 123, 0, 0, 2, 123, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 123, 30, 7, 31, 123, 0, 0, 0, 123, 52, 88, 0, 0, 0, 0, 0, 0, 2, 123, 0, 0, 0, 0, 0, 0, 1, 110, 0, 0, 0, 0, 0, 18, 37, 18, 34, 16, 21, 12, 23, 12, 50, 123, 0, 0, 0, 90, 26, 0, 3, 123, 0, 0, 1, 122, 0, 0, 2, 123, 0, 0, 1, 93, 0); @@ -45,7 +45,11 @@ public class SIFTDescriptorExtractorTest extends OpenCVTestCase { super.setUp(); } - public void testCompute() { + public void testComputeListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testComputeMatListOfKeyPointMat() { List keypoints = Arrays.asList(keypoint); Mat img = getTestImg(); Mat descriptors = new Mat(); @@ -77,7 +81,8 @@ public class SIFTDescriptorExtractorTest extends OpenCVTestCase { Mat descriptors = new Mat(); String filename = OpenCVTestRunner.getTempFileName("yml"); - writeFile(filename, "%YAML:1.0\nmagnification: 3.\nisNormalize: 1\nrecalculateAngles: 1\nnOctaves: 6\nnOctaveLayers: 4\nfirstOctave: -1\nangleMode: 0\n"); + writeFile(filename, + "%YAML:1.0\nmagnification: 3.\nisNormalize: 1\nrecalculateAngles: 1\nnOctaves: 6\nnOctaveLayers: 4\nfirstOctave: -1\nangleMode: 0\n"); extractor.read(filename); diff --git a/modules/java/android_test/src/org/opencv/test/features2d/SIFTFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/SIFTFeatureDetectorTest.java new file mode 100644 index 0000000..dc381ca --- /dev/null +++ b/modules/java/android_test/src/org/opencv/test/features2d/SIFTFeatureDetectorTest.java @@ -0,0 +1,39 @@ +package org.opencv.test.features2d; + +import junit.framework.TestCase; + +public class SIFTFeatureDetectorTest extends TestCase { + + public void testCreate() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPoint() { + fail("Not yet implemented"); + } + + public void testDetectMatListOfKeyPointMat() { + fail("Not yet implemented"); + } + + public void testEmpty() { + fail("Not yet implemented"); + } + + public void testRead() { + fail("Not yet implemented"); + } + + public void testWrite() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/features2d/STARFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/STARFeatureDetectorTest.java index ae4a68a..768bd89 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/STARFeatureDetectorTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/STARFeatureDetectorTest.java @@ -17,8 +17,30 @@ import java.util.List; public class STARFeatureDetectorTest extends OpenCVTestCase { FeatureDetector detector; - KeyPoint[] truth; int matSize; + KeyPoint[] truth; + + private Mat getMaskImg() { + Mat mask = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255)); + Mat right = mask.submat(0, matSize, matSize / 2, matSize); + right.setTo(new Scalar(0)); + return mask; + } + + private Mat getTestImg() { + Scalar color = new Scalar(0); + int center = matSize / 2; + int radius = 6; + int offset = 40; + + Mat img = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255)); + Core.circle(img, new Point(center - offset, center), radius, color, -1); + Core.circle(img, new Point(center + offset, center), radius, color, -1); + Core.circle(img, new Point(center, center - offset), radius, color, -1); + Core.circle(img, new Point(center, center + offset), radius, color, -1); + Core.circle(img, new Point(center, center), radius, color, -1); + return img; + } protected void setUp() throws Exception { detector = FeatureDetector.create(FeatureDetector.STAR); @@ -39,49 +61,35 @@ public class STARFeatureDetectorTest extends OpenCVTestCase { super.setUp(); } - private Mat getTestImg() { - Scalar color = new Scalar(0); - int center = matSize / 2; - int radius = 6; - int offset = 40; - - Mat img = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255)); - Core.circle(img, new Point(center - offset, center), radius, color, -1); - Core.circle(img, new Point(center + offset, center), radius, color, -1); - Core.circle(img, new Point(center, center - offset), radius, color, -1); - Core.circle(img, new Point(center, center + offset), radius, color, -1); - Core.circle(img, new Point(center, center), radius, color, -1); - return img; + public void testCreate() { + assertNotNull(detector); } - private Mat getMaskImg() { - Mat mask = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255)); - Mat right = mask.submat(0, matSize, matSize / 2, matSize); - right.setTo(new Scalar(0)); - return mask; + public void testDetectListOfMatListOfListOfKeyPoint() { + fail("Not yet implemented"); } - public void testCreate() { - assertNotNull(detector); + public void testDetectListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); } - public void testDetectMatListOfKeyPointMat() { + public void testDetectMatListOfKeyPoint() { Mat img = getTestImg(); - Mat mask = getMaskImg(); List keypoints = new ArrayList(); - detector.detect(img, keypoints, mask); + detector.detect(img, keypoints); - assertListKeyPointEquals(Arrays.asList(truth[0], truth[2], truth[5], truth[7]), keypoints, EPS); + assertListKeyPointEquals(Arrays.asList(truth), keypoints, EPS); } - public void testDetectMatListOfKeyPoint() { + public void testDetectMatListOfKeyPointMat() { Mat img = getTestImg(); + Mat mask = getMaskImg(); List keypoints = new ArrayList(); - detector.detect(img, keypoints); + detector.detect(img, keypoints, mask); - assertListKeyPointEquals(Arrays.asList(truth), keypoints, EPS); + assertListKeyPointEquals(Arrays.asList(truth[0], truth[2], truth[5], truth[7]), keypoints, EPS); } public void testEmpty() { @@ -90,17 +98,17 @@ public class STARFeatureDetectorTest extends OpenCVTestCase { public void testRead() { Mat img = getTestImg(); - + List keypoints1 = new ArrayList(); detector.detect(img, keypoints1); - + String filename = OpenCVTestRunner.getTempFileName("yml"); writeFile(filename, "%YAML:1.0\nmaxSize: 45\nresponseThreshold: 150\nlineThresholdProjected: 10\nlineThresholdBinarized: 8\nsuppressNonmaxSize: 5\n"); detector.read(filename); - + List keypoints2 = new ArrayList(); detector.detect(img, keypoints2); - + assertTrue(keypoints2.size() <= keypoints1.size()); } diff --git a/modules/java/android_test/src/org/opencv/test/features2d/SURFDescriptorExtractorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/SURFDescriptorExtractorTest.java index f913580..f057ef0 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/SURFDescriptorExtractorTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/SURFDescriptorExtractorTest.java @@ -34,7 +34,11 @@ public class SURFDescriptorExtractorTest extends OpenCVTestCase { super.setUp(); } - public void testCompute() { + public void testComputeListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); + } + + public void testComputeMatListOfKeyPointMat() { KeyPoint point = new KeyPoint(55.775577545166016f, 44.224422454833984f, 16, 9.754629f, 8617.863f, 1, -1); List keypoints = Arrays.asList(point); Mat img = getTestImg(); diff --git a/modules/java/android_test/src/org/opencv/test/features2d/SURFFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/SURFFeatureDetectorTest.java index c3a983d..03bcd8b 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/SURFFeatureDetectorTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/SURFFeatureDetectorTest.java @@ -17,23 +17,16 @@ import java.util.Comparator; import java.util.List; public class SURFFeatureDetectorTest extends OpenCVTestCase { - + FeatureDetector detector; - KeyPoint[] truth; int matSize; + KeyPoint[] truth; - @Override - protected void setUp() throws Exception { - detector = FeatureDetector.create(FeatureDetector.SURF); - - matSize = 100; - - truth = new KeyPoint[] { new KeyPoint(55.775577545166016f, 44.224422454833984f, 16, 9.754629f, 8617.863f, 1, -1), - new KeyPoint(44.224422454833984f, 44.224422454833984f, 16, 99.75463f, 8617.863f, 1, -1), - new KeyPoint(44.224422454833984f, 55.775577545166016f, 16, 189.7546f, 8617.863f, 1, -1), - new KeyPoint(55.775577545166016f, 55.775577545166016f, 16, 279.75464f, 8617.863f, 1, -1) }; - - super.setUp(); + private Mat getMaskImg() { + Mat mask = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255)); + Mat right = mask.submat(0, matSize, matSize / 2, matSize); + right.setTo(new Scalar(0)); + return mask; } private Mat getTestImg() { @@ -56,37 +49,55 @@ public class SURFFeatureDetectorTest extends OpenCVTestCase { }); } - private Mat getMaskImg() { - Mat mask = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255)); - Mat right = mask.submat(0, matSize, matSize / 2, matSize); - right.setTo(new Scalar(0)); - return mask; + @Override + protected void setUp() throws Exception { + detector = FeatureDetector.create(FeatureDetector.SURF); + + matSize = 100; + + truth = new KeyPoint[] { new KeyPoint(55.775577545166016f, 44.224422454833984f, 16, 9.754629f, 8617.863f, 1, -1), + new KeyPoint(44.224422454833984f, 44.224422454833984f, 16, 99.75463f, 8617.863f, 1, -1), + new KeyPoint(44.224422454833984f, 55.775577545166016f, 16, 189.7546f, 8617.863f, 1, -1), + new KeyPoint(55.775577545166016f, 55.775577545166016f, 16, 279.75464f, 8617.863f, 1, -1) }; + + super.setUp(); } public void testCreate() { assertNotNull(detector); } - public void testDetectMatListOfKeyPointMat() { + public void testDetectListOfMatListOfListOfKeyPoint() { String filename = OpenCVTestRunner.getTempFileName("yml"); writeFile(filename, "%YAML:1.0\nhessianThreshold: 8000.\noctaves: 3\noctaveLayers: 4\nupright: 0\n"); detector.read(filename); - - Mat img = getTestImg(); - Mat mask = getMaskImg(); - List keypoints = new ArrayList(); - detector.detect(img, keypoints, mask); - - order(keypoints); - assertListKeyPointEquals(Arrays.asList(truth[1], truth[2]), keypoints, EPS); + List> keypoints = new ArrayList>(); + Mat cross = getTestImg(); + List crosses = new ArrayList(3); + crosses.add(cross); + crosses.add(cross); + crosses.add(cross); + + detector.detect(crosses, keypoints); + + assertEquals(3, keypoints.size()); + + for (List lkp : keypoints) { + order(lkp); + assertListKeyPointEquals(Arrays.asList(truth), lkp, EPS); + } + } + + public void testDetectListOfMatListOfListOfKeyPointListOfMat() { + fail("Not yet implemented"); } public void testDetectMatListOfKeyPoint() { String filename = OpenCVTestRunner.getTempFileName("yml"); writeFile(filename, "%YAML:1.0\nhessianThreshold: 8000.\noctaves: 3\noctaveLayers: 4\nupright: 0\n"); detector.read(filename); - + List keypoints = new ArrayList(); Mat cross = getTestImg(); @@ -96,27 +107,20 @@ public class SURFFeatureDetectorTest extends OpenCVTestCase { assertListKeyPointEquals(Arrays.asList(truth), keypoints, EPS); } - public void testDetectListOfMatListOfListOfKeyPoint() { + public void testDetectMatListOfKeyPointMat() { String filename = OpenCVTestRunner.getTempFileName("yml"); writeFile(filename, "%YAML:1.0\nhessianThreshold: 8000.\noctaves: 3\noctaveLayers: 4\nupright: 0\n"); detector.read(filename); - - List> keypoints = new ArrayList>(); - Mat cross = getTestImg(); - List crosses = new ArrayList(3); - crosses.add(cross); - crosses.add(cross); - crosses.add(cross); - detector.detect(crosses, keypoints); - - assertEquals(3, keypoints.size()); + Mat img = getTestImg(); + Mat mask = getMaskImg(); + List keypoints = new ArrayList(); - for(List lkp : keypoints) { - order(lkp); - assertListKeyPointEquals(Arrays.asList(truth), lkp, EPS); - } - } + detector.detect(img, keypoints, mask); + + order(keypoints); + assertListKeyPointEquals(Arrays.asList(truth[1], truth[2]), keypoints, EPS); + } public void testEmpty() { assertFalse(detector.empty()); @@ -124,17 +128,17 @@ public class SURFFeatureDetectorTest extends OpenCVTestCase { public void testRead() { Mat cross = getTestImg(); - + List keypoints1 = new ArrayList(); detector.detect(cross, keypoints1); - + String filename = OpenCVTestRunner.getTempFileName("yml"); writeFile(filename, "%YAML:1.0\nhessianThreshold: 8000.\noctaves: 3\noctaveLayers: 4\nupright: 0\n"); detector.read(filename); - + List keypoints2 = new ArrayList(); detector.detect(cross, keypoints2); - + assertTrue(keypoints2.size() <= keypoints1.size()); } diff --git a/modules/java/android_test/src/org/opencv/test/highgui/highguiTest.java b/modules/java/android_test/src/org/opencv/test/highgui/HighguiTest.java similarity index 56% rename from modules/java/android_test/src/org/opencv/test/highgui/highguiTest.java rename to modules/java/android_test/src/org/opencv/test/highgui/HighguiTest.java index b93c677..8e0a08c 100644 --- a/modules/java/android_test/src/org/opencv/test/highgui/highguiTest.java +++ b/modules/java/android_test/src/org/opencv/test/highgui/HighguiTest.java @@ -4,7 +4,19 @@ import org.opencv.highgui.Highgui; import org.opencv.test.OpenCVTestCase; import org.opencv.test.OpenCVTestRunner; -public class highguiTest extends OpenCVTestCase { +public class HighguiTest extends OpenCVTestCase { + + public void testImdecode() { + fail("Not yet implemented"); + } + + public void testImencodeStringMatListOfByte() { + fail("Not yet implemented"); + } + + public void testImencodeStringMatListOfByteListOfInteger() { + fail("Not yet implemented"); + } public void testImreadString() { dst = Highgui.imread(OpenCVTestRunner.LENA_PATH); @@ -22,4 +34,12 @@ public class highguiTest extends OpenCVTestCase { assertTrue(512 == dst.rows()); } + public void testImwriteStringMat() { + fail("Not yet implemented"); + } + + public void testImwriteStringMatListOfInteger() { + fail("Not yet implemented"); + } + } diff --git a/modules/java/android_test/src/org/opencv/test/highgui/VideoCaptureTest.java b/modules/java/android_test/src/org/opencv/test/highgui/VideoCaptureTest.java index b2ec21e..c6901c5 100644 --- a/modules/java/android_test/src/org/opencv/test/highgui/VideoCaptureTest.java +++ b/modules/java/android_test/src/org/opencv/test/highgui/VideoCaptureTest.java @@ -1,5 +1,8 @@ package org.opencv.test.highgui; +import java.util.List; + +import org.opencv.core.Size; import org.opencv.highgui.Highgui; import org.opencv.highgui.VideoCapture; @@ -8,8 +11,8 @@ import org.opencv.test.OpenCVTestCase; public class VideoCaptureTest extends OpenCVTestCase { private VideoCapture capture; - private boolean isSucceed; private boolean isOpened; + private boolean isSucceed; @Override protected void setUp() throws Exception { @@ -20,15 +23,27 @@ public class VideoCaptureTest extends OpenCVTestCase { isOpened = false; } - public void test_1() { - super.test_1("HIGHGUI.VideoCapture"); + public void testGet() { + try + { + capture = new VideoCapture(Highgui.CV_CAP_ANDROID); + double frameWidth = capture.get(Highgui.CV_CAP_PROP_FRAME_WIDTH); + assertTrue(0 != frameWidth); + } finally { + if (capture != null) capture.release(); + } } - public void testGet() { - capture = new VideoCapture(Highgui.CV_CAP_ANDROID); - double frameWidth = capture.get(Highgui.CV_CAP_PROP_FRAME_WIDTH); - capture.release(); - assertTrue(0 != frameWidth); + public void testGetSupportedPreviewSizes() { + try + { + capture = new VideoCapture(Highgui.CV_CAP_ANDROID); + List sizes = capture.getSupportedPreviewSizes(); + assertNotNull(sizes); + assertFalse(sizes.isEmpty()); + } finally { + if (capture != null) capture.release(); + } } public void testGrab() { @@ -38,10 +53,13 @@ public class VideoCaptureTest extends OpenCVTestCase { } public void testGrabFromRealCamera() { - capture = new VideoCapture(Highgui.CV_CAP_ANDROID); - isSucceed = capture.grab(); - capture.release(); - assertTrue(isSucceed); + try { + capture = new VideoCapture(Highgui.CV_CAP_ANDROID); + isSucceed = capture.grab(); + assertTrue(isSucceed); + } finally { + if (capture != null) capture.release(); + } } public void testIsOpened() { @@ -50,76 +68,110 @@ public class VideoCaptureTest extends OpenCVTestCase { } public void testIsOpenedRealCamera() { - capture = new VideoCapture(Highgui.CV_CAP_ANDROID); - isOpened = capture.isOpened(); - capture.release(); - assertTrue(isOpened); + try + { + capture = new VideoCapture(Highgui.CV_CAP_ANDROID); + isOpened = capture.isOpened(); + assertTrue(isOpened); + } finally { + if (capture != null) capture.release(); + } } public void testOpen() { - capture = new VideoCapture(); - capture.open(Highgui.CV_CAP_ANDROID); - isOpened = capture.isOpened(); - capture.release(); - assertTrue(isOpened); + try + { + capture = new VideoCapture(); + capture.open(Highgui.CV_CAP_ANDROID); + isOpened = capture.isOpened(); + assertTrue(isOpened); + } finally { + if (capture != null) capture.release(); + } } public void testRead() { - capture = new VideoCapture(Highgui.CV_CAP_ANDROID); - isSucceed = capture.read(dst); - capture.release(); - assertTrue(isSucceed); - assertFalse(dst.empty()); - assertEquals(3, dst.channels()); + try + { + capture = new VideoCapture(Highgui.CV_CAP_ANDROID); + isSucceed = capture.read(dst); + assertTrue(isSucceed); + assertFalse(dst.empty()); + assertEquals(3, dst.channels()); + } finally { + if (capture != null) capture.release(); + } } public void testRelease() { - capture = new VideoCapture(Highgui.CV_CAP_ANDROID); - capture.release(); - assertFalse(capture.isOpened()); + try + { + capture = new VideoCapture(Highgui.CV_CAP_ANDROID); + capture.release(); + assertFalse(capture.isOpened()); + capture = null; + } finally { + if (capture != null) capture.release(); + } } public void testRetrieveMat() { - capture = new VideoCapture(Highgui.CV_CAP_ANDROID); - capture.grab(); - isSucceed = capture.retrieve(dst); - capture.release(); - assertTrue(isSucceed); - assertFalse(dst.empty()); - assertEquals(3, dst.channels()); + try + { + capture = new VideoCapture(Highgui.CV_CAP_ANDROID); + capture.grab(); + isSucceed = capture.retrieve(dst); + assertTrue(isSucceed); + assertFalse(dst.empty()); + assertEquals(3, dst.channels()); + } finally { + if (capture != null) capture.release(); + } } public void testRetrieveMatInt() { - capture = new VideoCapture(Highgui.CV_CAP_ANDROID); - capture.grab(); - isSucceed = capture.retrieve(dst, 1); - capture.release(); - assertTrue(isSucceed); - assertFalse(dst.empty()); - // OpenCVTestRunner.Log(dst.toString()); - assertEquals(1, dst.channels()); + try + { + capture = new VideoCapture(Highgui.CV_CAP_ANDROID); + capture.grab(); + isSucceed = capture.retrieve(dst, Highgui.CV_CAP_ANDROID_GREY_FRAME); + assertTrue(isSucceed); + assertFalse(dst.empty()); + assertEquals(1, dst.channels()); + } finally { + if (capture != null) capture.release(); + } } public void testSet() { - capture = new VideoCapture(Highgui.CV_CAP_ANDROID); - capture.set(Highgui.CV_CAP_PROP_FRAME_WIDTH, 640.0); - double frameWidth = capture.get(Highgui.CV_CAP_PROP_FRAME_WIDTH); - capture.read(dst); - capture.release(); - assertEquals(640.0, frameWidth); - assertEquals(640, dst.cols()); + try + { + capture = new VideoCapture(Highgui.CV_CAP_ANDROID); + capture.set(Highgui.CV_CAP_PROP_FRAME_WIDTH, 640); + capture.set(Highgui.CV_CAP_PROP_FRAME_HEIGHT, 480); + double frameWidth = capture.get(Highgui.CV_CAP_PROP_FRAME_WIDTH); + capture.read(dst); + assertEquals(640.0, frameWidth); + assertEquals(640, dst.cols()); + } finally { + if (capture != null) capture.release(); + } } public void testVideoCapture() { capture = new VideoCapture(); - assertTrue(null != capture); + assertNotNull(capture); + assertFalse(capture.isOpened()); } public void testVideoCaptureInt() { - capture = new VideoCapture(Highgui.CV_CAP_ANDROID); - assertTrue(null != capture); - isOpened = capture.isOpened(); - capture.release(); - assertTrue(isOpened); + try + { + capture = new VideoCapture(Highgui.CV_CAP_ANDROID); + assertNotNull(capture); + assertTrue(capture.isOpened()); + } finally { + if (capture != null) capture.release(); + } } } diff --git a/modules/java/android_test/src/org/opencv/test/imgproc/imgprocTest.java b/modules/java/android_test/src/org/opencv/test/imgproc/ImgprocTest.java similarity index 97% rename from modules/java/android_test/src/org/opencv/test/imgproc/imgprocTest.java rename to modules/java/android_test/src/org/opencv/test/imgproc/ImgprocTest.java index fa0f2ce..de92d77 100644 --- a/modules/java/android_test/src/org/opencv/test/imgproc/imgprocTest.java +++ b/modules/java/android_test/src/org/opencv/test/imgproc/ImgprocTest.java @@ -15,14 +15,13 @@ import org.opencv.core.TermCriteria; import org.opencv.imgproc.Imgproc; import org.opencv.test.OpenCVTestCase; +public class ImgprocTest extends OpenCVTestCase { -public class imgprocTest extends OpenCVTestCase { - - private Mat gray_64f_2; + Point anchorPoint; private Mat dst64F; - private Mat mask; + private Mat gray_64f_2; private int imgprocSz; - Point anchorPoint; + private Mat mask; Size size; @Override @@ -38,10 +37,6 @@ public class imgprocTest extends OpenCVTestCase { size = new Size(3, 3); } - public void test_1() { - super.test_1("imgproc"); - } - public void testAccumulateMatMat() { Imgproc.accumulate(gray_64f_2, dst64F); truth = new Mat(imgprocSz, imgprocSz, CvType.CV_64F, new Scalar(2)); @@ -481,45 +476,44 @@ public class imgprocTest extends OpenCVTestCase { Mat src = new Mat(imgprocSz, imgprocSz, CvType.CV_32FC1); src.put(0, 0, 1, 2); src.put(1, 0, 2, 1); - int blockSize = 5; - truth = new Mat(imgprocSz, imgprocSz, CvType.CV_32FC1, new Scalar(0)); Imgproc.cornerMinEigenVal(src, dst, blockSize); + + truth = new Mat(imgprocSz, imgprocSz, CvType.CV_32FC1, new Scalar(0)); assertMatEqual(truth, dst, EPS); - Mat truth1 = new Mat(matSize, matSize, CvType.CV_32FC1, new Scalar(0)); Imgproc.cornerMinEigenVal(gray255, dst, blockSize); - assertMatEqual(truth1, dst, EPS); + + truth = new Mat(matSize, matSize, CvType.CV_32FC1, new Scalar(0)); + assertMatEqual(truth, dst, EPS); } public void testCornerMinEigenValMatMatIntInt() { Mat src = Mat.eye(3, 3, CvType.CV_32FC1); - - truth = new Mat(3, 3, CvType.CV_32FC1, new Scalar(0)); int blockSize = 3; int ksize = 5; + Imgproc.cornerMinEigenVal(src, dst, blockSize, ksize); + + truth = new Mat(3, 3, CvType.CV_32FC1, new Scalar(0)); truth.put(0, 0, 0.055555549, 0.027777772, 0.055555549); truth.put(1, 0, 0.027777772, 0.055555549, 0.027777772); truth.put(2, 0, 0.055555549, 0.027777772, 0.055555549); - - Imgproc.cornerMinEigenVal(src, dst, blockSize, ksize); assertMatEqual(truth, dst, EPS); } public void testCornerMinEigenValMatMatIntIntInt() { Mat src = Mat.eye(3, 3, CvType.CV_32FC1); - - truth = new Mat(3, 3, CvType.CV_32FC1, new Scalar(0)); int blockSize = 3; int ksize = 5; + Imgproc.cornerMinEigenVal(src, dst, blockSize, ksize, Imgproc.BORDER_REFLECT); + + truth = new Mat(3, 3, CvType.CV_32FC1, new Scalar(0)); truth.put(0, 0, 0.68055558, 0.92708349, 0.5868057); truth.put(1, 0, 0.92708343, 0.92708343, 0.92708343); truth.put(2, 0, 0.58680564, 0.92708343, 0.68055564); - - Imgproc.cornerMinEigenVal(src, dst, blockSize, ksize, Imgproc.BORDER_REFLECT); assertMatEqual(truth, dst, EPS); } @@ -529,14 +523,14 @@ public class imgprocTest extends OpenCVTestCase { Point truthPosition = new Point(img.cols() / 2, img.rows() / 2); Rect r = new Rect(new Point(0, 0), truthPosition); - Core.rectangle(img, r.tl(), r.br(), new Scalar(0), -1 /*TODO: CV_FILLED*/); + Core.rectangle(img, r.tl(), r.br(), new Scalar(0), -1 /* TODO: CV_FILLED */); List corners = new ArrayList(); corners.add(new Point(truthPosition.x + 1, truthPosition.y + 1)); Size winSize = new Size(2, 2); Size zeroZone = new Size(-1, -1); - TermCriteria criteria = new TermCriteria(2 /*TODO: CV_TERMCRIT_EPS*/, 0, 0.01); + TermCriteria criteria = new TermCriteria(2 /* TODO: CV_TERMCRIT_EPS */, 0, 0.01); Imgproc.cornerSubPix(img, corners, winSize, zeroZone, criteria); assertPointEquals(truthPosition, corners.get(0), weakEPS); @@ -558,6 +552,7 @@ public class imgprocTest extends OpenCVTestCase { assertMatEqual(gray255, dst); Imgproc.dilate(gray1, dst, kernel); + assertMatEqual(gray1, dst); } @@ -565,6 +560,7 @@ public class imgprocTest extends OpenCVTestCase { Mat kernel = new Mat(); Imgproc.dilate(gray255, dst, kernel, anchorPoint); + assertMatEqual(gray255, dst); } @@ -572,6 +568,7 @@ public class imgprocTest extends OpenCVTestCase { Mat kernel = new Mat(); Imgproc.dilate(gray255, dst, kernel, anchorPoint, 10); + assertMatEqual(gray255, dst); } @@ -579,6 +576,7 @@ public class imgprocTest extends OpenCVTestCase { Mat kernel = new Mat(); Imgproc.dilate(gray255, dst, kernel, anchorPoint, 10, Imgproc.BORDER_REFLECT); + assertMatEqual(gray255, dst); } @@ -587,15 +585,17 @@ public class imgprocTest extends OpenCVTestCase { Scalar value = new Scalar(0); Imgproc.dilate(gray255, dst, kernel, anchorPoint, 10, Imgproc.BORDER_REFLECT, value); + assertMatEqual(gray255, dst); } public void testDistanceTransform() { truth = new Mat(matSize, matSize, CvType.CV_32FC1, new Scalar(8192)); Mat dstLables = new Mat(matSize, matSize, CvType.CV_32SC1, new Scalar(0)); - Mat labels = new Mat(); + Imgproc.distanceTransform(gray128, dst, labels, Imgproc.CV_DIST_L2, 3); + assertMatEqual(truth, dst, EPS); assertMatEqual(dstLables, labels); } @@ -606,9 +606,10 @@ public class imgprocTest extends OpenCVTestCase { Core.rectangle(gray0, new Point(1, 2), new Point(7, 8), new Scalar(100)); Imgproc.findContours(gray0, contours, hierarchy, Imgproc.RETR_EXTERNAL, Imgproc.CHAIN_APPROX_SIMPLE); assertTrue(1 == contours.size()); - assertFalse(0 == Core.countNonZero(gray0)); + Imgproc.drawContours(gray0, contours, -1, new Scalar(0)); + assertTrue(0 == Core.countNonZero(gray0)); } @@ -642,7 +643,9 @@ public class imgprocTest extends OpenCVTestCase { public void testErodeMatMatMat() { Mat kernel = new Mat(); + Imgproc.erode(gray128, dst, kernel); + assertMatEqual(gray128, dst); } @@ -651,11 +654,11 @@ public class imgprocTest extends OpenCVTestCase { src.put(0, 0, 1, 4, 8); src.put(1, 0, 2, 0, 1); src.put(2, 0, 3, 4, 6); - - truth = new Mat(3, 3, CvType.CV_8U, new Scalar(0.0)); Mat kernel = new Mat(); Imgproc.erode(src, dst, kernel, anchorPoint); + + truth = new Mat(3, 3, CvType.CV_8U, new Scalar(0.0)); assertMatEqual(truth, dst); } @@ -664,11 +667,11 @@ public class imgprocTest extends OpenCVTestCase { src.put(0, 0, 15, 9, 10); src.put(1, 0, 10, 8, 12); src.put(2, 0, 12, 20, 25); - - truth = new Mat(3, 3, CvType.CV_8U, new Scalar(8.0)); Mat kernel = new Mat(); Imgproc.erode(src, dst, kernel, anchorPoint, 10); + + truth = new Mat(3, 3, CvType.CV_8U, new Scalar(8.0)); assertMatEqual(truth, dst); } @@ -677,11 +680,11 @@ public class imgprocTest extends OpenCVTestCase { src.put(0, 0, 15, 9, 10); src.put(1, 0, 10, 8, 12); src.put(2, 0, 12, 20, 25); - - truth = new Mat(3, 3, CvType.CV_8U, new Scalar(8.0)); Mat kernel = new Mat(); Imgproc.erode(src, dst, kernel, anchorPoint, 10, Imgproc.BORDER_REFLECT); + + truth = new Mat(3, 3, CvType.CV_8U, new Scalar(8.0)); assertMatEqual(truth, dst); } @@ -690,12 +693,12 @@ public class imgprocTest extends OpenCVTestCase { src.put(0, 0, 15, 9, 10); src.put(1, 0, 10, 8, 12); src.put(2, 0, 12, 20, 25); - - truth = new Mat(3, 3, CvType.CV_8U, new Scalar(8.0)); Mat kernel = new Mat(); Scalar sc = new Scalar(3, 3); Imgproc.erode(src, dst, kernel, anchorPoint, 10, Imgproc.BORDER_REFLECT, sc); + + truth = new Mat(3, 3, CvType.CV_8U, new Scalar(8.0)); assertMatEqual(truth, dst); } @@ -703,13 +706,13 @@ public class imgprocTest extends OpenCVTestCase { Mat src = Mat.eye(4, 4, CvType.CV_32F); Mat kernel = new Mat(imgprocSz, imgprocSz, CvType.CV_32F, new Scalar(1.0)); - truth = Mat.eye(4, 4, CvType.CV_32F); + Imgproc.filter2D(src, dst, -1, kernel); + + truth = new Mat(4, 4, CvType.CV_32F); truth.put(0, 0, 2, 2, 1, 0); truth.put(1, 0, 2, 2, 1, 0); truth.put(2, 0, 1, 1, 2, 1); truth.put(3, 0, 0, 0, 1, 2); - - Imgproc.filter2D(src, dst, -1, kernel); assertMatEqual(truth, dst, EPS); } @@ -718,14 +721,20 @@ public class imgprocTest extends OpenCVTestCase { Point point = new Point(0, 0); Imgproc.filter2D(gray128, dst, -1, kernel, point); + assertMatEqual(gray255, dst); } + public void testFilter2DMatMatIntMatPointDouble() { + fail("Not yet implemented"); + } + public void testFilter2DMatMatIntMatPointDoubleInt() { Mat kernel = new Mat(imgprocSz, imgprocSz, CvType.CV_32F, new Scalar(0.0)); Point point = new Point(0, 0); Imgproc.filter2D(gray128, dst, -1, kernel, point, 2.0, Imgproc.BORDER_CONSTANT); + assertMatEqual(gray2, dst); } @@ -735,6 +744,7 @@ public class imgprocTest extends OpenCVTestCase { Mat hierarchy = dst; Imgproc.findContours(img, contours, hierarchy, Imgproc.RETR_EXTERNAL, Imgproc.CHAIN_APPROX_SIMPLE); + // no contours on empty image assertEquals(contours.size(), 0); assertEquals(contours.size(), hierarchy.total()); @@ -743,6 +753,7 @@ public class imgprocTest extends OpenCVTestCase { Core.rectangle(img, new Point(30, 35), new Point(40, 45), new Scalar(200)); Imgproc.findContours(img, contours, hierarchy, Imgproc.RETR_EXTERNAL, Imgproc.CHAIN_APPROX_SIMPLE); + // two contours of two rectangles assertEquals(contours.size(), 2); assertEquals(contours.size(), hierarchy.total()); @@ -767,14 +778,15 @@ public class imgprocTest extends OpenCVTestCase { public void testFitEllipse() { List points = new ArrayList(); - points.add(new Point( 0, 0)); - points.add(new Point(-1, 1)); - points.add(new Point( 1, 1)); - points.add(new Point( 1, -1)); + points.add(new Point(0, 0)); + points.add(new Point(-1, 1)); + points.add(new Point(1, 1)); + points.add(new Point(1, -1)); points.add(new Point(-1, -1)); - RotatedRect rrect = new RotatedRect(); + rrect = Imgproc.fitEllipse(points); + assertEquals(0.0, rrect.center.x); assertEquals(0.0, rrect.center.y); assertEquals(2.53, rrect.size.width, EPS); @@ -789,39 +801,31 @@ public class imgprocTest extends OpenCVTestCase { linePoints.put(0, 0, 0.53196341, 0.84676737, 2.496531, 3.7467217); Imgproc.fitLine(points, dst, Imgproc.CV_DIST_L12, 0, 0.01, 0.01); + assertMatEqual(linePoints, dst, EPS); } public void testFloodFillMatMatPointScalar() { - Mat mask = new Mat(matSize + 2, matSize + 2, CvType.CV_8U); + Mat mask = new Mat(matSize + 2, matSize + 2, CvType.CV_8U, new Scalar(0)); Mat img = gray0; - - img.setTo(new Scalar(0)); - mask.setTo(new Scalar(0)); - Core.circle(mask, new Point(matSize / 2 + 1, matSize / 2 + 1), 3, new Scalar(2)); int retval = Imgproc.floodFill(img, mask, new Point(matSize / 2, matSize / 2), new Scalar(1)); assertEquals(Core.countNonZero(img), retval); - Core.circle(mask, new Point(matSize / 2 + 1, matSize / 2 + 1), 3, new Scalar(0)); - assertEquals(retval + 4 * (matSize + 1), Core.countNonZero(mask)); - assertMatEqual(mask.submat(1, matSize + 1, 1, matSize + 1), img); } public void testFloodFillMatMatPointScalar_WithoutMask() { Mat img = gray0; - Core.circle(img, new Point(matSize / 2, matSize / 2), 3, new Scalar(2)); // TODO: ideally we should pass null instead of "new Mat()" int retval = Imgproc.floodFill(img, new Mat(), new Point(matSize / 2, matSize / 2), new Scalar(1)); Core.circle(img, new Point(matSize / 2, matSize / 2), 3, new Scalar(0)); - assertEquals(Core.countNonZero(img), retval); } @@ -847,16 +851,17 @@ public class imgprocTest extends OpenCVTestCase { Imgproc.GaussianBlur(gray2, dst, size, 1.0); assertMatEqual(gray2, dst); - } public void testGaussianBlurMatMatSizeDoubleDouble() { Imgproc.GaussianBlur(gray2, dst, size, 0.0, 0.0); + assertMatEqual(gray2, dst); } public void testGaussianBlurMatMatSizeDoubleDoubleInt() { Imgproc.GaussianBlur(gray2, dst, size, 1.0, 3.0, Imgproc.BORDER_REFLECT); + assertMatEqual(gray2, dst); } @@ -865,27 +870,24 @@ public class imgprocTest extends OpenCVTestCase { } public void testGetDefaultNewCameraMatrixMat() { - truth = new Mat(); + Mat mtx = Imgproc.getDefaultNewCameraMatrix(gray0); - truth = Imgproc.getDefaultNewCameraMatrix(gray0); - assertTrue(0 == Core.countNonZero(truth)); - assertFalse(truth.empty()); + assertFalse(mtx.empty()); + assertEquals(0, Core.countNonZero(mtx)); } public void testGetDefaultNewCameraMatrixMatSize() { - truth = new Mat(); + Mat mtx = Imgproc.getDefaultNewCameraMatrix(gray0, size); - truth = Imgproc.getDefaultNewCameraMatrix(gray0, size); - assertTrue(0 == Core.countNonZero(truth)); - assertFalse(truth.empty()); + assertFalse(mtx.empty()); + assertEquals(0, Core.countNonZero(mtx)); } public void testGetDefaultNewCameraMatrixMatSizeBoolean() { - truth = new Mat(); + Mat mtx = Imgproc.getDefaultNewCameraMatrix(gray0, size, true); - truth = Imgproc.getDefaultNewCameraMatrix(gray0, size, true); - assertTrue(0 != Core.countNonZero(truth)); - assertFalse(truth.empty()); + assertFalse(mtx.empty()); + assertFalse(0 == Core.countNonZero(mtx)); } public void testGetDerivKernelsMatMatIntIntInt() { @@ -952,6 +954,7 @@ public class imgprocTest extends OpenCVTestCase { truth = new Mat(1, 1, CvType.CV_64FC1, new Scalar(1.0)); dst = Imgproc.getGaussianKernel(1, 0.5); + assertMatEqual(truth, dst, EPS); } @@ -960,15 +963,21 @@ public class imgprocTest extends OpenCVTestCase { truth.put(0, 0, 0.23899426, 0.52201146, 0.23899426); dst = Imgproc.getGaussianKernel(3, 0.8, CvType.CV_32F); + assertMatEqual(truth, dst, EPS); } + public void testGetPerspectiveTransform() { + fail("Not yet implemented"); + } + public void testGetRectSubPixMatSizePointMat() { truth = new Mat(3, 3, CvType.CV_8U, new Scalar(255)); Size size = new Size(3, 3); Point center = new Point(gray255.cols() / 2, gray255.rows() / 2); Imgproc.getRectSubPix(gray255, size, center, dst); + assertMatEqual(truth, dst); } @@ -1009,7 +1018,7 @@ public class imgprocTest extends OpenCVTestCase { assertMatEqual(truth, dst); } - public void testGoodFeaturesToTrackMatMatIntDoubleDouble() { + public void testGoodFeaturesToTrackMatListOfPointIntDoubleDouble() { Mat src = gray0; Core.rectangle(src, new Point(2, 2), new Point(8, 8), new Scalar(100), -1); List lp = new ArrayList(); @@ -1019,7 +1028,7 @@ public class imgprocTest extends OpenCVTestCase { assertEquals(4, lp.size()); } - public void testGoodFeaturesToTrackMatMatIntDoubleDoubleMat() { + public void testGoodFeaturesToTrackMatListOfPointIntDoubleDoubleMat() { Mat src = gray128; Point tl = new Point(2, 2); Point br = new Point(8, 8); @@ -1034,7 +1043,7 @@ public class imgprocTest extends OpenCVTestCase { assertEquals(1, lp.size()); } - public void testGoodFeaturesToTrackMatMatIntDoubleDoubleMatInt() { + public void testGoodFeaturesToTrackMatListOfPointIntDoubleDoubleMatInt() { Mat src = gray0; Core.rectangle(src, new Point(2, 2), new Point(8, 8), new Scalar(100), -1); List lp = new ArrayList(); @@ -1044,7 +1053,7 @@ public class imgprocTest extends OpenCVTestCase { assertEquals(4, lp.size()); } - public void testGoodFeaturesToTrackMatMatIntDoubleDoubleMatIntBoolean() { + public void testGoodFeaturesToTrackMatListOfPointIntDoubleDoubleMatIntBoolean() { Mat src = gray0; Core.rectangle(src, new Point(2, 2), new Point(8, 8), new Scalar(100), -1); List lp = new ArrayList(); @@ -1054,7 +1063,7 @@ public class imgprocTest extends OpenCVTestCase { assertEquals(4, lp.size()); } - public void testGoodFeaturesToTrackMatMatIntDoubleDoubleMatIntBooleanDouble() { + public void testGoodFeaturesToTrackMatListOfPointIntDoubleDoubleMatIntBooleanDouble() { Mat src = gray0; Core.rectangle(src, new Point(2, 2), new Point(8, 8), new Scalar(100), -1); List lp = new ArrayList(); @@ -1418,7 +1427,7 @@ public class imgprocTest extends OpenCVTestCase { points.add(new Point(0, 1)); Point actualCenter = new Point(); - float[] radius = new float[]{347.0f}; + float[] radius = new float[] { 347.0f }; Imgproc.minEnclosingCircle(points, actualCenter, radius); Point truthCenter = new Point(0, 0); @@ -1526,6 +1535,7 @@ public class imgprocTest extends OpenCVTestCase { int ksize = 3; Imgproc.preCornerDetect(src, dst, ksize, Imgproc.BORDER_REFLECT); + assertMatEqual(truth, dst, EPS); } diff --git a/modules/java/android_test/src/org/opencv/test/imgproc/MomentsTest.java b/modules/java/android_test/src/org/opencv/test/imgproc/MomentsTest.java index 363d892..f62071f 100644 --- a/modules/java/android_test/src/org/opencv/test/imgproc/MomentsTest.java +++ b/modules/java/android_test/src/org/opencv/test/imgproc/MomentsTest.java @@ -4,10 +4,6 @@ import org.opencv.test.OpenCVTestCase; public class MomentsTest extends OpenCVTestCase { - protected void setUp() throws Exception { - super.setUp(); - } - public void testGet_m00() { fail("Not yet implemented"); } diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvANN_MLPTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvANN_MLPTest.java index 482faff..709b631 100644 --- a/modules/java/android_test/src/org/opencv/test/ml/CvANN_MLPTest.java +++ b/modules/java/android_test/src/org/opencv/test/ml/CvANN_MLPTest.java @@ -1,71 +1,69 @@ -package org.opencv.test.ml; - -import org.opencv.test.OpenCVTestCase; - -public class CvANN_MLPTest extends OpenCVTestCase { - - protected void setUp() throws Exception { - super.setUp(); - } - - public void testClear() { - fail("Not yet implemented"); - } - - public void testCreateMat() { - fail("Not yet implemented"); - } - - public void testCreateMatInt() { - fail("Not yet implemented"); - } - - public void testCreateMatIntDouble() { - fail("Not yet implemented"); - } - - public void testCreateMatIntDoubleDouble() { - fail("Not yet implemented"); - } - - public void testCvANN_MLP() { - fail("Not yet implemented"); - } - - public void testCvANN_MLPMat() { - fail("Not yet implemented"); - } - - public void testCvANN_MLPMatInt() { - fail("Not yet implemented"); - } - - public void testCvANN_MLPMatIntDouble() { - fail("Not yet implemented"); - } - - public void testCvANN_MLPMatIntDoubleDouble() { - fail("Not yet implemented"); - } - - public void testPredict() { - fail("Not yet implemented"); - } - - public void testTrainMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatMatMatMatCvANN_MLP_TrainParams() { - fail("Not yet implemented"); - } - - public void testTrainMatMatMatMatCvANN_MLP_TrainParamsInt() { - fail("Not yet implemented"); - } - -} +package org.opencv.test.ml; + +import org.opencv.ml.CvANN_MLP; + +import junit.framework.TestCase; + +public class CvANN_MLPTest extends TestCase { + + public void testClear() { + fail("Not yet implemented"); + } + + public void testCreateMat() { + fail("Not yet implemented"); + } + + public void testCreateMatInt() { + fail("Not yet implemented"); + } + + public void testCreateMatIntDouble() { + fail("Not yet implemented"); + } + + public void testCreateMatIntDoubleDouble() { + fail("Not yet implemented"); + } + + public void testCvANN_MLP() { + new CvANN_MLP(); + } + + public void testCvANN_MLPMat() { + fail("Not yet implemented"); + } + + public void testCvANN_MLPMatInt() { + fail("Not yet implemented"); + } + + public void testCvANN_MLPMatIntDouble() { + fail("Not yet implemented"); + } + + public void testCvANN_MLPMatIntDoubleDouble() { + fail("Not yet implemented"); + } + + public void testPredict() { + fail("Not yet implemented"); + } + + public void testTrainMatMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatMatMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatMatMatMatCvANN_MLP_TrainParams() { + fail("Not yet implemented"); + } + + public void testTrainMatMatMatMatCvANN_MLP_TrainParamsInt() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvANN_MLP_TrainParamsTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvANN_MLP_TrainParamsTest.java index ca67b47..dd4a8f3 100644 --- a/modules/java/android_test/src/org/opencv/test/ml/CvANN_MLP_TrainParamsTest.java +++ b/modules/java/android_test/src/org/opencv/test/ml/CvANN_MLP_TrainParamsTest.java @@ -1,75 +1,77 @@ -package org.opencv.test.ml; - -import org.opencv.test.OpenCVTestCase; - -public class CvANN_MLP_TrainParamsTest extends OpenCVTestCase { - - protected void setUp() throws Exception { - super.setUp(); - } - - public void testGet_bp_dw_scale() { - fail("Not yet implemented"); - } - - public void testGet_bp_moment_scale() { - fail("Not yet implemented"); - } - - public void testGet_rp_dw_max() { - fail("Not yet implemented"); - } - - public void testGet_rp_dw_min() { - fail("Not yet implemented"); - } - - public void testGet_rp_dw_minus() { - fail("Not yet implemented"); - } - - public void testGet_rp_dw_plus() { - fail("Not yet implemented"); - } - - public void testGet_rp_dw0() { - fail("Not yet implemented"); - } - - public void testGet_train_method() { - fail("Not yet implemented"); - } - - public void testSet_bp_dw_scale() { - fail("Not yet implemented"); - } - - public void testSet_bp_moment_scale() { - fail("Not yet implemented"); - } - - public void testSet_rp_dw_max() { - fail("Not yet implemented"); - } - - public void testSet_rp_dw_min() { - fail("Not yet implemented"); - } - - public void testSet_rp_dw_minus() { - fail("Not yet implemented"); - } - - public void testSet_rp_dw_plus() { - fail("Not yet implemented"); - } - - public void testSet_rp_dw0() { - fail("Not yet implemented"); - } - - public void testSet_train_method() { - fail("Not yet implemented"); - } - -} +package org.opencv.test.ml; + +import org.opencv.ml.CvANN_MLP_TrainParams; + +import junit.framework.TestCase; + +public class CvANN_MLP_TrainParamsTest extends TestCase { + + public void testCvANN_MLP_TrainParams() { + new CvANN_MLP_TrainParams(); + } + + public void testGet_bp_dw_scale() { + fail("Not yet implemented"); + } + + public void testGet_bp_moment_scale() { + fail("Not yet implemented"); + } + + public void testGet_rp_dw_max() { + fail("Not yet implemented"); + } + + public void testGet_rp_dw_min() { + fail("Not yet implemented"); + } + + public void testGet_rp_dw_minus() { + fail("Not yet implemented"); + } + + public void testGet_rp_dw_plus() { + fail("Not yet implemented"); + } + + public void testGet_rp_dw0() { + fail("Not yet implemented"); + } + + public void testGet_train_method() { + fail("Not yet implemented"); + } + + public void testSet_bp_dw_scale() { + fail("Not yet implemented"); + } + + public void testSet_bp_moment_scale() { + fail("Not yet implemented"); + } + + public void testSet_rp_dw_max() { + fail("Not yet implemented"); + } + + public void testSet_rp_dw_min() { + fail("Not yet implemented"); + } + + public void testSet_rp_dw_minus() { + fail("Not yet implemented"); + } + + public void testSet_rp_dw_plus() { + fail("Not yet implemented"); + } + + public void testSet_rp_dw0() { + fail("Not yet implemented"); + } + + public void testSet_train_method() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvBoostParamsTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvBoostParamsTest.java index 358ec0e..3d815bc 100644 --- a/modules/java/android_test/src/org/opencv/test/ml/CvBoostParamsTest.java +++ b/modules/java/android_test/src/org/opencv/test/ml/CvBoostParamsTest.java @@ -1,43 +1,45 @@ -package org.opencv.test.ml; - -import org.opencv.test.OpenCVTestCase; - -public class CvBoostParamsTest extends OpenCVTestCase { - - protected void setUp() throws Exception { - super.setUp(); - } - - public void testGet_boost_type() { - fail("Not yet implemented"); - } - - public void testGet_split_criteria() { - fail("Not yet implemented"); - } - - public void testGet_weak_count() { - fail("Not yet implemented"); - } - - public void testGet_weight_trim_rate() { - fail("Not yet implemented"); - } - - public void testSet_boost_type() { - fail("Not yet implemented"); - } - - public void testSet_split_criteria() { - fail("Not yet implemented"); - } - - public void testSet_weak_count() { - fail("Not yet implemented"); - } - - public void testSet_weight_trim_rate() { - fail("Not yet implemented"); - } - -} +package org.opencv.test.ml; + +import org.opencv.ml.CvBoostParams; + +import junit.framework.TestCase; + +public class CvBoostParamsTest extends TestCase { + + public void testCvBoostParams() { + new CvBoostParams(); + } + + public void testGet_boost_type() { + fail("Not yet implemented"); + } + + public void testGet_split_criteria() { + fail("Not yet implemented"); + } + + public void testGet_weak_count() { + fail("Not yet implemented"); + } + + public void testGet_weight_trim_rate() { + fail("Not yet implemented"); + } + + public void testSet_boost_type() { + fail("Not yet implemented"); + } + + public void testSet_split_criteria() { + fail("Not yet implemented"); + } + + public void testSet_weak_count() { + fail("Not yet implemented"); + } + + public void testSet_weight_trim_rate() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvBoostTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvBoostTest.java index f525cc4..466d64a 100644 --- a/modules/java/android_test/src/org/opencv/test/ml/CvBoostTest.java +++ b/modules/java/android_test/src/org/opencv/test/ml/CvBoostTest.java @@ -1,95 +1,93 @@ -package org.opencv.test.ml; - -import org.opencv.test.OpenCVTestCase; - -public class CvBoostTest extends OpenCVTestCase { - - protected void setUp() throws Exception { - super.setUp(); - } - - public void testClear() { - fail("Not yet implemented"); - } - - public void testCvBoost() { - fail("Not yet implemented"); - } - - public void testCvBoostMatIntMat() { - fail("Not yet implemented"); - } - - public void testCvBoostMatIntMatMat() { - fail("Not yet implemented"); - } - - public void testCvBoostMatIntMatMatMat() { - fail("Not yet implemented"); - } - - public void testCvBoostMatIntMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testCvBoostMatIntMatMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testCvBoostMatIntMatMatMatMatMatCvBoostParams() { - fail("Not yet implemented"); - } - - public void testPredictMat() { - fail("Not yet implemented"); - } - - public void testPredictMatMat() { - fail("Not yet implemented"); - } - - public void testPredictMatMatRange() { - fail("Not yet implemented"); - } - - public void testPredictMatMatRangeBoolean() { - fail("Not yet implemented"); - } - - public void testPredictMatMatRangeBooleanBoolean() { - fail("Not yet implemented"); - } - - public void testPrune() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMatMatCvBoostParams() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMatMatCvBoostParamsBoolean() { - fail("Not yet implemented"); - } - -} +package org.opencv.test.ml; + +import org.opencv.ml.CvBoost; + +import junit.framework.TestCase; + +public class CvBoostTest extends TestCase { + + public void testClear() { + fail("Not yet implemented"); + } + + public void testCvBoost() { + new CvBoost(); + } + + public void testCvBoostMatIntMat() { + fail("Not yet implemented"); + } + + public void testCvBoostMatIntMatMat() { + fail("Not yet implemented"); + } + + public void testCvBoostMatIntMatMatMat() { + fail("Not yet implemented"); + } + + public void testCvBoostMatIntMatMatMatMat() { + fail("Not yet implemented"); + } + + public void testCvBoostMatIntMatMatMatMatMat() { + fail("Not yet implemented"); + } + + public void testCvBoostMatIntMatMatMatMatMatCvBoostParams() { + fail("Not yet implemented"); + } + + public void testPredictMat() { + fail("Not yet implemented"); + } + + public void testPredictMatMat() { + fail("Not yet implemented"); + } + + public void testPredictMatMatRange() { + fail("Not yet implemented"); + } + + public void testPredictMatMatRangeBoolean() { + fail("Not yet implemented"); + } + + public void testPredictMatMatRangeBooleanBoolean() { + fail("Not yet implemented"); + } + + public void testPrune() { + fail("Not yet implemented"); + } + + public void testTrainMatIntMat() { + fail("Not yet implemented"); + } + + public void testTrainMatIntMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatIntMatMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatIntMatMatMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatIntMatMatMatMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatIntMatMatMatMatMatCvBoostParams() { + fail("Not yet implemented"); + } + + public void testTrainMatIntMatMatMatMatMatCvBoostParamsBoolean() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvDTreeParamsTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvDTreeParamsTest.java index 29a0789..e767aae 100644 --- a/modules/java/android_test/src/org/opencv/test/ml/CvDTreeParamsTest.java +++ b/modules/java/android_test/src/org/opencv/test/ml/CvDTreeParamsTest.java @@ -1,75 +1,77 @@ -package org.opencv.test.ml; - -import org.opencv.test.OpenCVTestCase; - -public class CvDTreeParamsTest extends OpenCVTestCase { - - protected void setUp() throws Exception { - super.setUp(); - } - - public void testGet_cv_folds() { - fail("Not yet implemented"); - } - - public void testGet_max_categories() { - fail("Not yet implemented"); - } - - public void testGet_max_depth() { - fail("Not yet implemented"); - } - - public void testGet_min_sample_count() { - fail("Not yet implemented"); - } - - public void testGet_regression_accuracy() { - fail("Not yet implemented"); - } - - public void testGet_truncate_pruned_tree() { - fail("Not yet implemented"); - } - - public void testGet_use_1se_rule() { - fail("Not yet implemented"); - } - - public void testGet_use_surrogates() { - fail("Not yet implemented"); - } - - public void testSet_cv_folds() { - fail("Not yet implemented"); - } - - public void testSet_max_categories() { - fail("Not yet implemented"); - } - - public void testSet_max_depth() { - fail("Not yet implemented"); - } - - public void testSet_min_sample_count() { - fail("Not yet implemented"); - } - - public void testSet_regression_accuracy() { - fail("Not yet implemented"); - } - - public void testSet_truncate_pruned_tree() { - fail("Not yet implemented"); - } - - public void testSet_use_1se_rule() { - fail("Not yet implemented"); - } - - public void testSet_use_surrogates() { - fail("Not yet implemented"); - } - -} +package org.opencv.test.ml; + +import org.opencv.ml.CvDTreeParams; + +import junit.framework.TestCase; + +public class CvDTreeParamsTest extends TestCase { + + public void testCvDTreeParams() { + new CvDTreeParams(); + } + + public void testGet_cv_folds() { + fail("Not yet implemented"); + } + + public void testGet_max_categories() { + fail("Not yet implemented"); + } + + public void testGet_max_depth() { + fail("Not yet implemented"); + } + + public void testGet_min_sample_count() { + fail("Not yet implemented"); + } + + public void testGet_regression_accuracy() { + fail("Not yet implemented"); + } + + public void testGet_truncate_pruned_tree() { + fail("Not yet implemented"); + } + + public void testGet_use_1se_rule() { + fail("Not yet implemented"); + } + + public void testGet_use_surrogates() { + fail("Not yet implemented"); + } + + public void testSet_cv_folds() { + fail("Not yet implemented"); + } + + public void testSet_max_categories() { + fail("Not yet implemented"); + } + + public void testSet_max_depth() { + fail("Not yet implemented"); + } + + public void testSet_min_sample_count() { + fail("Not yet implemented"); + } + + public void testSet_regression_accuracy() { + fail("Not yet implemented"); + } + + public void testSet_truncate_pruned_tree() { + fail("Not yet implemented"); + } + + public void testSet_use_1se_rule() { + fail("Not yet implemented"); + } + + public void testSet_use_surrogates() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvDTreeTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvDTreeTest.java index 7e35065..f6a5baa 100644 --- a/modules/java/android_test/src/org/opencv/test/ml/CvDTreeTest.java +++ b/modules/java/android_test/src/org/opencv/test/ml/CvDTreeTest.java @@ -1,47 +1,45 @@ -package org.opencv.test.ml; - -import org.opencv.test.OpenCVTestCase; - -public class CvDTreeTest extends OpenCVTestCase { - - protected void setUp() throws Exception { - super.setUp(); - } - - public void testClear() { - fail("Not yet implemented"); - } - - public void testCvDTree() { - fail("Not yet implemented"); - } - - public void testGetVarImportance() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMatMatCvDTreeParams() { - fail("Not yet implemented"); - } - -} +package org.opencv.test.ml; + +import org.opencv.ml.CvDTree; + +import junit.framework.TestCase; + +public class CvDTreeTest extends TestCase { + + public void testClear() { + fail("Not yet implemented"); + } + + public void testCvDTree() { + new CvDTree(); + } + + public void testGetVarImportance() { + fail("Not yet implemented"); + } + + public void testTrainMatIntMat() { + fail("Not yet implemented"); + } + + public void testTrainMatIntMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatIntMatMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatIntMatMatMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatIntMatMatMatMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatIntMatMatMatMatMatCvDTreeParams() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvEMParamsTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvEMParamsTest.java index 0af1c1d..2b2b9f0 100644 --- a/modules/java/android_test/src/org/opencv/test/ml/CvEMParamsTest.java +++ b/modules/java/android_test/src/org/opencv/test/ml/CvEMParamsTest.java @@ -1,35 +1,37 @@ -package org.opencv.test.ml; - -import org.opencv.test.OpenCVTestCase; - -public class CvEMParamsTest extends OpenCVTestCase { - - protected void setUp() throws Exception { - super.setUp(); - } - - public void testGet_cov_mat_type() { - fail("Not yet implemented"); - } - - public void testGet_nclusters() { - fail("Not yet implemented"); - } - - public void testGet_start_step() { - fail("Not yet implemented"); - } - - public void testSet_cov_mat_type() { - fail("Not yet implemented"); - } - - public void testSet_nclusters() { - fail("Not yet implemented"); - } - - public void testSet_start_step() { - fail("Not yet implemented"); - } - -} +package org.opencv.test.ml; + +import org.opencv.ml.CvEMParams; + +import junit.framework.TestCase; + +public class CvEMParamsTest extends TestCase { + + public void testCvEMParams() { + new CvEMParams(); + } + + public void testGet_cov_mat_type() { + fail("Not yet implemented"); + } + + public void testGet_nclusters() { + fail("Not yet implemented"); + } + + public void testGet_start_step() { + fail("Not yet implemented"); + } + + public void testSet_cov_mat_type() { + fail("Not yet implemented"); + } + + public void testSet_nclusters() { + fail("Not yet implemented"); + } + + public void testSet_start_step() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvEMTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvEMTest.java index 9178b95..b649653 100644 --- a/modules/java/android_test/src/org/opencv/test/ml/CvEMTest.java +++ b/modules/java/android_test/src/org/opencv/test/ml/CvEMTest.java @@ -1,87 +1,85 @@ -package org.opencv.test.ml; - -import org.opencv.test.OpenCVTestCase; - -public class CvEMTest extends OpenCVTestCase { - - protected void setUp() throws Exception { - super.setUp(); - } - - public void testCalcLikelihood() { - fail("Not yet implemented"); - } - - public void testClear() { - fail("Not yet implemented"); - } - - public void testCvEM() { - fail("Not yet implemented"); - } - - public void testCvEMMat() { - fail("Not yet implemented"); - } - - public void testCvEMMatMat() { - fail("Not yet implemented"); - } - - public void testCvEMMatMatCvEMParams() { - fail("Not yet implemented"); - } - - public void testGetCovs() { - fail("Not yet implemented"); - } - - public void testGetLikelihood() { - fail("Not yet implemented"); - } - - public void testGetLikelihoodDelta() { - fail("Not yet implemented"); - } - - public void testGetMeans() { - fail("Not yet implemented"); - } - - public void testGetNClusters() { - fail("Not yet implemented"); - } - - public void testGetProbs() { - fail("Not yet implemented"); - } - - public void testGetWeights() { - fail("Not yet implemented"); - } - - public void testPredictMat() { - fail("Not yet implemented"); - } - - public void testPredictMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMat() { - fail("Not yet implemented"); - } - - public void testTrainMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatMatCvEMParams() { - fail("Not yet implemented"); - } - - public void testTrainMatMatCvEMParamsMat() { - fail("Not yet implemented"); - } - -} +package org.opencv.test.ml; + +import org.opencv.ml.CvEM; + +import junit.framework.TestCase; + +public class CvEMTest extends TestCase { + + public void testCalcLikelihood() { + fail("Not yet implemented"); + } + + public void testClear() { + fail("Not yet implemented"); + } + + public void testCvEM() { + new CvEM(); + } + + public void testCvEMMat() { + fail("Not yet implemented"); + } + + public void testCvEMMatMat() { + fail("Not yet implemented"); + } + + public void testCvEMMatMatCvEMParams() { + fail("Not yet implemented"); + } + + public void testGetCovs() { + fail("Not yet implemented"); + } + + public void testGetLikelihood() { + fail("Not yet implemented"); + } + + public void testGetLikelihoodDelta() { + fail("Not yet implemented"); + } + + public void testGetMeans() { + fail("Not yet implemented"); + } + + public void testGetNClusters() { + fail("Not yet implemented"); + } + + public void testGetProbs() { + fail("Not yet implemented"); + } + + public void testGetWeights() { + fail("Not yet implemented"); + } + + public void testPredictMat() { + fail("Not yet implemented"); + } + + public void testPredictMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMat() { + fail("Not yet implemented"); + } + + public void testTrainMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatMatCvEMParams() { + fail("Not yet implemented"); + } + + public void testTrainMatMatCvEMParamsMat() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvERTreesTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvERTreesTest.java index d5515a0..0a59dfe 100644 --- a/modules/java/android_test/src/org/opencv/test/ml/CvERTreesTest.java +++ b/modules/java/android_test/src/org/opencv/test/ml/CvERTreesTest.java @@ -1,39 +1,37 @@ -package org.opencv.test.ml; - -import org.opencv.test.OpenCVTestCase; - -public class CvERTreesTest extends OpenCVTestCase { - - protected void setUp() throws Exception { - super.setUp(); - } - - public void testCvERTrees() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMatMatCvRTParams() { - fail("Not yet implemented"); - } - -} +package org.opencv.test.ml; + +import org.opencv.ml.CvERTrees; + +import junit.framework.TestCase; + +public class CvERTreesTest extends TestCase { + + public void testCvERTrees() { + new CvERTrees(); + } + + public void testTrainMatIntMat() { + fail("Not yet implemented"); + } + + public void testTrainMatIntMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatIntMatMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatIntMatMatMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatIntMatMatMatMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatIntMatMatMatMatMatCvRTParams() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvGBTreesParamsTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvGBTreesParamsTest.java index 0f55384..ca266d1 100644 --- a/modules/java/android_test/src/org/opencv/test/ml/CvGBTreesParamsTest.java +++ b/modules/java/android_test/src/org/opencv/test/ml/CvGBTreesParamsTest.java @@ -1,43 +1,45 @@ -package org.opencv.test.ml; - -import org.opencv.test.OpenCVTestCase; - -public class CvGBTreesParamsTest extends OpenCVTestCase { - - protected void setUp() throws Exception { - super.setUp(); - } - - public void testGet_loss_function_type() { - fail("Not yet implemented"); - } - - public void testGet_shrinkage() { - fail("Not yet implemented"); - } - - public void testGet_subsample_portion() { - fail("Not yet implemented"); - } - - public void testGet_weak_count() { - fail("Not yet implemented"); - } - - public void testSet_loss_function_type() { - fail("Not yet implemented"); - } - - public void testSet_shrinkage() { - fail("Not yet implemented"); - } - - public void testSet_subsample_portion() { - fail("Not yet implemented"); - } - - public void testSet_weak_count() { - fail("Not yet implemented"); - } - -} +package org.opencv.test.ml; + +import org.opencv.ml.CvGBTreesParams; + +import junit.framework.TestCase; + +public class CvGBTreesParamsTest extends TestCase { + + public void testCvGBTreesParams() { + new CvGBTreesParams(); + } + + public void testGet_loss_function_type() { + fail("Not yet implemented"); + } + + public void testGet_shrinkage() { + fail("Not yet implemented"); + } + + public void testGet_subsample_portion() { + fail("Not yet implemented"); + } + + public void testGet_weak_count() { + fail("Not yet implemented"); + } + + public void testSet_loss_function_type() { + fail("Not yet implemented"); + } + + public void testSet_shrinkage() { + fail("Not yet implemented"); + } + + public void testSet_subsample_portion() { + fail("Not yet implemented"); + } + + public void testSet_weak_count() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvGBTreesTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvGBTreesTest.java index 7e34664..2bbb38d 100644 --- a/modules/java/android_test/src/org/opencv/test/ml/CvGBTreesTest.java +++ b/modules/java/android_test/src/org/opencv/test/ml/CvGBTreesTest.java @@ -1,87 +1,85 @@ -package org.opencv.test.ml; - -import org.opencv.test.OpenCVTestCase; - -public class CvGBTreesTest extends OpenCVTestCase { - - protected void setUp() throws Exception { - super.setUp(); - } - - public void testClear() { - fail("Not yet implemented"); - } - - public void testCvGBTrees() { - fail("Not yet implemented"); - } - - public void testCvGBTreesMatIntMat() { - fail("Not yet implemented"); - } - - public void testCvGBTreesMatIntMatMat() { - fail("Not yet implemented"); - } - - public void testCvGBTreesMatIntMatMatMat() { - fail("Not yet implemented"); - } - - public void testCvGBTreesMatIntMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testCvGBTreesMatIntMatMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testCvGBTreesMatIntMatMatMatMatMatCvGBTreesParams() { - fail("Not yet implemented"); - } - - public void testPredictMat() { - fail("Not yet implemented"); - } - - public void testPredictMatMat() { - fail("Not yet implemented"); - } - - public void testPredictMatMatRange() { - fail("Not yet implemented"); - } - - public void testPredictMatMatRangeInt() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMatMatCvGBTreesParams() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMatMatCvGBTreesParamsBoolean() { - fail("Not yet implemented"); - } - -} +package org.opencv.test.ml; + +import org.opencv.ml.CvGBTrees; + +import junit.framework.TestCase; + +public class CvGBTreesTest extends TestCase { + + public void testClear() { + fail("Not yet implemented"); + } + + public void testCvGBTrees() { + new CvGBTrees(); + } + + public void testCvGBTreesMatIntMat() { + fail("Not yet implemented"); + } + + public void testCvGBTreesMatIntMatMat() { + fail("Not yet implemented"); + } + + public void testCvGBTreesMatIntMatMatMat() { + fail("Not yet implemented"); + } + + public void testCvGBTreesMatIntMatMatMatMat() { + fail("Not yet implemented"); + } + + public void testCvGBTreesMatIntMatMatMatMatMat() { + fail("Not yet implemented"); + } + + public void testCvGBTreesMatIntMatMatMatMatMatCvGBTreesParams() { + fail("Not yet implemented"); + } + + public void testPredictMat() { + fail("Not yet implemented"); + } + + public void testPredictMatMat() { + fail("Not yet implemented"); + } + + public void testPredictMatMatRange() { + fail("Not yet implemented"); + } + + public void testPredictMatMatRangeInt() { + fail("Not yet implemented"); + } + + public void testTrainMatIntMat() { + fail("Not yet implemented"); + } + + public void testTrainMatIntMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatIntMatMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatIntMatMatMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatIntMatMatMatMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatIntMatMatMatMatMatCvGBTreesParams() { + fail("Not yet implemented"); + } + + public void testTrainMatIntMatMatMatMatMatCvGBTreesParamsBoolean() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvKNearestTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvKNearestTest.java index 9c21a5c..1f7bd37 100644 --- a/modules/java/android_test/src/org/opencv/test/ml/CvKNearestTest.java +++ b/modules/java/android_test/src/org/opencv/test/ml/CvKNearestTest.java @@ -1,55 +1,53 @@ -package org.opencv.test.ml; - -import org.opencv.test.OpenCVTestCase; - -public class CvKNearestTest extends OpenCVTestCase { - - protected void setUp() throws Exception { - super.setUp(); - } - - public void testCvKNearest() { - fail("Not yet implemented"); - } - - public void testCvKNearestMatMat() { - fail("Not yet implemented"); - } - - public void testCvKNearestMatMatMat() { - fail("Not yet implemented"); - } - - public void testCvKNearestMatMatMatBoolean() { - fail("Not yet implemented"); - } - - public void testCvKNearestMatMatMatBooleanInt() { - fail("Not yet implemented"); - } - - public void testFind_nearest() { - fail("Not yet implemented"); - } - - public void testTrainMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatMatMatBoolean() { - fail("Not yet implemented"); - } - - public void testTrainMatMatMatBooleanInt() { - fail("Not yet implemented"); - } - - public void testTrainMatMatMatBooleanIntBoolean() { - fail("Not yet implemented"); - } - -} +package org.opencv.test.ml; + +import org.opencv.ml.CvKNearest; + +import junit.framework.TestCase; + +public class CvKNearestTest extends TestCase { + + public void testCvKNearest() { + new CvKNearest(); + } + + public void testCvKNearestMatMat() { + fail("Not yet implemented"); + } + + public void testCvKNearestMatMatMat() { + fail("Not yet implemented"); + } + + public void testCvKNearestMatMatMatBoolean() { + fail("Not yet implemented"); + } + + public void testCvKNearestMatMatMatBooleanInt() { + fail("Not yet implemented"); + } + + public void testFind_nearest() { + fail("Not yet implemented"); + } + + public void testTrainMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatMatMatBoolean() { + fail("Not yet implemented"); + } + + public void testTrainMatMatMatBooleanInt() { + fail("Not yet implemented"); + } + + public void testTrainMatMatMatBooleanIntBoolean() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvNormalBayesClassifierTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvNormalBayesClassifierTest.java index 75380cb..d184a79 100644 --- a/modules/java/android_test/src/org/opencv/test/ml/CvNormalBayesClassifierTest.java +++ b/modules/java/android_test/src/org/opencv/test/ml/CvNormalBayesClassifierTest.java @@ -1,55 +1,53 @@ -package org.opencv.test.ml; - -import org.opencv.test.OpenCVTestCase; - -public class CvNormalBayesClassifierTest extends OpenCVTestCase { - - protected void setUp() throws Exception { - super.setUp(); - } - - public void testClear() { - fail("Not yet implemented"); - } - - public void testCvNormalBayesClassifier() { - fail("Not yet implemented"); - } - - public void testCvNormalBayesClassifierMatMat() { - fail("Not yet implemented"); - } - - public void testCvNormalBayesClassifierMatMatMat() { - fail("Not yet implemented"); - } - - public void testCvNormalBayesClassifierMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testPredictMat() { - fail("Not yet implemented"); - } - - public void testPredictMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatMatMatMatBoolean() { - fail("Not yet implemented"); - } - -} +package org.opencv.test.ml; + +import org.opencv.ml.CvNormalBayesClassifier; + +import junit.framework.TestCase; + +public class CvNormalBayesClassifierTest extends TestCase { + + public void testClear() { + fail("Not yet implemented"); + } + + public void testCvNormalBayesClassifier() { + new CvNormalBayesClassifier(); + } + + public void testCvNormalBayesClassifierMatMat() { + fail("Not yet implemented"); + } + + public void testCvNormalBayesClassifierMatMatMat() { + fail("Not yet implemented"); + } + + public void testCvNormalBayesClassifierMatMatMatMat() { + fail("Not yet implemented"); + } + + public void testPredictMat() { + fail("Not yet implemented"); + } + + public void testPredictMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatMatMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatMatMatMatBoolean() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvParamGridTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvParamGridTest.java index b27199b..39334d1 100644 --- a/modules/java/android_test/src/org/opencv/test/ml/CvParamGridTest.java +++ b/modules/java/android_test/src/org/opencv/test/ml/CvParamGridTest.java @@ -1,35 +1,37 @@ -package org.opencv.test.ml; - -import org.opencv.test.OpenCVTestCase; - -public class CvParamGridTest extends OpenCVTestCase { - - protected void setUp() throws Exception { - super.setUp(); - } - - public void testGet_max_val() { - fail("Not yet implemented"); - } - - public void testGet_min_val() { - fail("Not yet implemented"); - } - - public void testGet_step() { - fail("Not yet implemented"); - } - - public void testSet_max_val() { - fail("Not yet implemented"); - } - - public void testSet_min_val() { - fail("Not yet implemented"); - } - - public void testSet_step() { - fail("Not yet implemented"); - } - -} +package org.opencv.test.ml; + +import org.opencv.ml.CvParamGrid; + +import junit.framework.TestCase; + +public class CvParamGridTest extends TestCase { + + public void testCvParamGrid() { + new CvParamGrid(); + } + + public void testGet_max_val() { + fail("Not yet implemented"); + } + + public void testGet_min_val() { + fail("Not yet implemented"); + } + + public void testGet_step() { + fail("Not yet implemented"); + } + + public void testSet_max_val() { + fail("Not yet implemented"); + } + + public void testSet_min_val() { + fail("Not yet implemented"); + } + + public void testSet_step() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvRTParamsTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvRTParamsTest.java index de9e45f..fb12e9a 100644 --- a/modules/java/android_test/src/org/opencv/test/ml/CvRTParamsTest.java +++ b/modules/java/android_test/src/org/opencv/test/ml/CvRTParamsTest.java @@ -1,27 +1,29 @@ -package org.opencv.test.ml; - -import org.opencv.test.OpenCVTestCase; - -public class CvRTParamsTest extends OpenCVTestCase { - - protected void setUp() throws Exception { - super.setUp(); - } - - public void testGet_calc_var_importance() { - fail("Not yet implemented"); - } - - public void testGet_nactive_vars() { - fail("Not yet implemented"); - } - - public void testSet_calc_var_importance() { - fail("Not yet implemented"); - } - - public void testSet_nactive_vars() { - fail("Not yet implemented"); - } - -} +package org.opencv.test.ml; + +import org.opencv.ml.CvRTParams; + +import junit.framework.TestCase; + +public class CvRTParamsTest extends TestCase { + + public void testCvRTParams() { + new CvRTParams(); + } + + public void testGet_calc_var_importance() { + fail("Not yet implemented"); + } + + public void testGet_nactive_vars() { + fail("Not yet implemented"); + } + + public void testSet_calc_var_importance() { + fail("Not yet implemented"); + } + + public void testSet_nactive_vars() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvRTreesTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvRTreesTest.java index 7ea7462..dcb88ef 100644 --- a/modules/java/android_test/src/org/opencv/test/ml/CvRTreesTest.java +++ b/modules/java/android_test/src/org/opencv/test/ml/CvRTreesTest.java @@ -1,63 +1,61 @@ -package org.opencv.test.ml; - -import org.opencv.test.OpenCVTestCase; - -public class CvRTreesTest extends OpenCVTestCase { - - protected void setUp() throws Exception { - super.setUp(); - } - - public void testClear() { - fail("Not yet implemented"); - } - - public void testCvRTrees() { - fail("Not yet implemented"); - } - - public void testGetVarImportance() { - fail("Not yet implemented"); - } - - public void testPredict_probMat() { - fail("Not yet implemented"); - } - - public void testPredict_probMatMat() { - fail("Not yet implemented"); - } - - public void testPredictMat() { - fail("Not yet implemented"); - } - - public void testPredictMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMatMatCvRTParams() { - fail("Not yet implemented"); - } - -} +package org.opencv.test.ml; + +import org.opencv.ml.CvRTrees; + +import junit.framework.TestCase; + +public class CvRTreesTest extends TestCase { + + public void testClear() { + fail("Not yet implemented"); + } + + public void testCvRTrees() { + new CvRTrees(); + } + + public void testGetVarImportance() { + fail("Not yet implemented"); + } + + public void testPredict_probMat() { + fail("Not yet implemented"); + } + + public void testPredict_probMatMat() { + fail("Not yet implemented"); + } + + public void testPredictMat() { + fail("Not yet implemented"); + } + + public void testPredictMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatIntMat() { + fail("Not yet implemented"); + } + + public void testTrainMatIntMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatIntMatMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatIntMatMatMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatIntMatMatMatMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatIntMatMatMatMatMatCvRTParams() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvSVMParamsTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvSVMParamsTest.java index 07ae13e..a1b4c92 100644 --- a/modules/java/android_test/src/org/opencv/test/ml/CvSVMParamsTest.java +++ b/modules/java/android_test/src/org/opencv/test/ml/CvSVMParamsTest.java @@ -1,75 +1,77 @@ -package org.opencv.test.ml; - -import org.opencv.test.OpenCVTestCase; - -public class CvSVMParamsTest extends OpenCVTestCase { - - protected void setUp() throws Exception { - super.setUp(); - } - - public void testGet_C() { - fail("Not yet implemented"); - } - - public void testGet_coef0() { - fail("Not yet implemented"); - } - - public void testGet_degree() { - fail("Not yet implemented"); - } - - public void testGet_gamma() { - fail("Not yet implemented"); - } - - public void testGet_kernel_type() { - fail("Not yet implemented"); - } - - public void testGet_nu() { - fail("Not yet implemented"); - } - - public void testGet_p() { - fail("Not yet implemented"); - } - - public void testGet_svm_type() { - fail("Not yet implemented"); - } - - public void testSet_C() { - fail("Not yet implemented"); - } - - public void testSet_coef0() { - fail("Not yet implemented"); - } - - public void testSet_degree() { - fail("Not yet implemented"); - } - - public void testSet_gamma() { - fail("Not yet implemented"); - } - - public void testSet_kernel_type() { - fail("Not yet implemented"); - } - - public void testSet_nu() { - fail("Not yet implemented"); - } - - public void testSet_p() { - fail("Not yet implemented"); - } - - public void testSet_svm_type() { - fail("Not yet implemented"); - } - -} +package org.opencv.test.ml; + +import org.opencv.ml.CvSVMParams; + +import junit.framework.TestCase; + +public class CvSVMParamsTest extends TestCase { + + public void testCvSVMParams() { + new CvSVMParams(); + } + + public void testGet_C() { + fail("Not yet implemented"); + } + + public void testGet_coef0() { + fail("Not yet implemented"); + } + + public void testGet_degree() { + fail("Not yet implemented"); + } + + public void testGet_gamma() { + fail("Not yet implemented"); + } + + public void testGet_kernel_type() { + fail("Not yet implemented"); + } + + public void testGet_nu() { + fail("Not yet implemented"); + } + + public void testGet_p() { + fail("Not yet implemented"); + } + + public void testGet_svm_type() { + fail("Not yet implemented"); + } + + public void testSet_C() { + fail("Not yet implemented"); + } + + public void testSet_coef0() { + fail("Not yet implemented"); + } + + public void testSet_degree() { + fail("Not yet implemented"); + } + + public void testSet_gamma() { + fail("Not yet implemented"); + } + + public void testSet_kernel_type() { + fail("Not yet implemented"); + } + + public void testSet_nu() { + fail("Not yet implemented"); + } + + public void testSet_p() { + fail("Not yet implemented"); + } + + public void testSet_svm_type() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvSVMTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvSVMTest.java index cb18619..4982ee8 100644 --- a/modules/java/android_test/src/org/opencv/test/ml/CvSVMTest.java +++ b/modules/java/android_test/src/org/opencv/test/ml/CvSVMTest.java @@ -1,103 +1,101 @@ -package org.opencv.test.ml; - -import org.opencv.test.OpenCVTestCase; - -public class CvSVMTest extends OpenCVTestCase { - - protected void setUp() throws Exception { - super.setUp(); - } - - public void testClear() { - fail("Not yet implemented"); - } - - public void testCvSVM() { - fail("Not yet implemented"); - } - - public void testCvSVMMatMat() { - fail("Not yet implemented"); - } - - public void testCvSVMMatMatMat() { - fail("Not yet implemented"); - } - - public void testCvSVMMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testCvSVMMatMatMatMatCvSVMParams() { - fail("Not yet implemented"); - } - - public void testGet_support_vector_count() { - fail("Not yet implemented"); - } - - public void testGet_var_count() { - fail("Not yet implemented"); - } - - public void testPredictMat() { - fail("Not yet implemented"); - } - - public void testPredictMatBoolean() { - fail("Not yet implemented"); - } - - public void testTrain_autoMatMatMatMatCvSVMParams() { - fail("Not yet implemented"); - } - - public void testTrain_autoMatMatMatMatCvSVMParamsInt() { - fail("Not yet implemented"); - } - - public void testTrain_autoMatMatMatMatCvSVMParamsIntCvParamGrid() { - fail("Not yet implemented"); - } - - public void testTrain_autoMatMatMatMatCvSVMParamsIntCvParamGridCvParamGrid() { - fail("Not yet implemented"); - } - - public void testTrain_autoMatMatMatMatCvSVMParamsIntCvParamGridCvParamGridCvParamGrid() { - fail("Not yet implemented"); - } - - public void testTrain_autoMatMatMatMatCvSVMParamsIntCvParamGridCvParamGridCvParamGridCvParamGrid() { - fail("Not yet implemented"); - } - - public void testTrain_autoMatMatMatMatCvSVMParamsIntCvParamGridCvParamGridCvParamGridCvParamGridCvParamGrid() { - fail("Not yet implemented"); - } - - public void testTrain_autoMatMatMatMatCvSVMParamsIntCvParamGridCvParamGridCvParamGridCvParamGridCvParamGridCvParamGrid() { - fail("Not yet implemented"); - } - - public void testTrain_autoMatMatMatMatCvSVMParamsIntCvParamGridCvParamGridCvParamGridCvParamGridCvParamGridCvParamGridBoolean() { - fail("Not yet implemented"); - } - - public void testTrainMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatMatMatMatCvSVMParams() { - fail("Not yet implemented"); - } - -} +package org.opencv.test.ml; + +import org.opencv.ml.CvSVM; + +import junit.framework.TestCase; + +public class CvSVMTest extends TestCase { + + public void testClear() { + fail("Not yet implemented"); + } + + public void testCvSVM() { + new CvSVM(); + } + + public void testCvSVMMatMat() { + fail("Not yet implemented"); + } + + public void testCvSVMMatMatMat() { + fail("Not yet implemented"); + } + + public void testCvSVMMatMatMatMat() { + fail("Not yet implemented"); + } + + public void testCvSVMMatMatMatMatCvSVMParams() { + fail("Not yet implemented"); + } + + public void testGet_support_vector_count() { + fail("Not yet implemented"); + } + + public void testGet_var_count() { + fail("Not yet implemented"); + } + + public void testPredictMat() { + fail("Not yet implemented"); + } + + public void testPredictMatBoolean() { + fail("Not yet implemented"); + } + + public void testTrain_autoMatMatMatMatCvSVMParams() { + fail("Not yet implemented"); + } + + public void testTrain_autoMatMatMatMatCvSVMParamsInt() { + fail("Not yet implemented"); + } + + public void testTrain_autoMatMatMatMatCvSVMParamsIntCvParamGrid() { + fail("Not yet implemented"); + } + + public void testTrain_autoMatMatMatMatCvSVMParamsIntCvParamGridCvParamGrid() { + fail("Not yet implemented"); + } + + public void testTrain_autoMatMatMatMatCvSVMParamsIntCvParamGridCvParamGridCvParamGrid() { + fail("Not yet implemented"); + } + + public void testTrain_autoMatMatMatMatCvSVMParamsIntCvParamGridCvParamGridCvParamGridCvParamGrid() { + fail("Not yet implemented"); + } + + public void testTrain_autoMatMatMatMatCvSVMParamsIntCvParamGridCvParamGridCvParamGridCvParamGridCvParamGrid() { + fail("Not yet implemented"); + } + + public void testTrain_autoMatMatMatMatCvSVMParamsIntCvParamGridCvParamGridCvParamGridCvParamGridCvParamGridCvParamGrid() { + fail("Not yet implemented"); + } + + public void testTrain_autoMatMatMatMatCvSVMParamsIntCvParamGridCvParamGridCvParamGridCvParamGridCvParamGridCvParamGridBoolean() { + fail("Not yet implemented"); + } + + public void testTrainMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatMatMatMat() { + fail("Not yet implemented"); + } + + public void testTrainMatMatMatMatCvSVMParams() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvStatModelTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvStatModelTest.java index 6d537e3..a732bc5 100644 --- a/modules/java/android_test/src/org/opencv/test/ml/CvStatModelTest.java +++ b/modules/java/android_test/src/org/opencv/test/ml/CvStatModelTest.java @@ -1,27 +1,29 @@ -package org.opencv.test.ml; - -import org.opencv.test.OpenCVTestCase; - -public class CvStatModelTest extends OpenCVTestCase { - - protected void setUp() throws Exception { - super.setUp(); - } - - public void testLoadString() { - fail("Not yet implemented"); - } - - public void testLoadStringString() { - fail("Not yet implemented"); - } - - public void testSaveString() { - fail("Not yet implemented"); - } - - public void testSaveStringString() { - fail("Not yet implemented"); - } - -} +package org.opencv.test.ml; + +import org.opencv.ml.CvStatModel; + +import junit.framework.TestCase; + +public class CvStatModelTest extends TestCase { + + public void testCvStatModel() { + new CvStatModel(); + } + + public void testLoadString() { + fail("Not yet implemented"); + } + + public void testLoadStringString() { + fail("Not yet implemented"); + } + + public void testSaveString() { + fail("Not yet implemented"); + } + + public void testSaveStringString() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/objdetect/HOGDescriptorTest.java b/modules/java/android_test/src/org/opencv/test/objdetect/HOGDescriptorTest.java index 05bfb5c..c3b1773 100644 --- a/modules/java/android_test/src/org/opencv/test/objdetect/HOGDescriptorTest.java +++ b/modules/java/android_test/src/org/opencv/test/objdetect/HOGDescriptorTest.java @@ -5,10 +5,6 @@ import org.opencv.test.OpenCVTestCase; public class HOGDescriptorTest extends OpenCVTestCase { - protected void setUp() throws Exception { - super.setUp(); - } - public void testCheckDetectorSize() { fail("Not yet implemented"); } @@ -173,6 +169,10 @@ public class HOGDescriptorTest extends OpenCVTestCase { fail("Not yet implemented"); } + public void testGet_svmDetector() { + fail("Not yet implemented"); + } + public void testGet_winSigma() { fail("Not yet implemented"); } diff --git a/modules/java/android_test/src/org/opencv/test/objdetect/objdetectTest.java b/modules/java/android_test/src/org/opencv/test/objdetect/ObjdetectTest.java similarity index 87% rename from modules/java/android_test/src/org/opencv/test/objdetect/objdetectTest.java rename to modules/java/android_test/src/org/opencv/test/objdetect/ObjdetectTest.java index a9de804..6493687 100644 --- a/modules/java/android_test/src/org/opencv/test/objdetect/objdetectTest.java +++ b/modules/java/android_test/src/org/opencv/test/objdetect/ObjdetectTest.java @@ -6,7 +6,7 @@ import org.opencv.core.Rect; import org.opencv.objdetect.Objdetect; import org.opencv.test.OpenCVTestCase; -public class objdetectTest extends OpenCVTestCase { +public class ObjdetectTest extends OpenCVTestCase { public void testGroupRectanglesListOfRectInt() { Rect r = new Rect(10, 10, 20, 20); @@ -36,6 +36,10 @@ public class objdetectTest extends OpenCVTestCase { assertEquals(2, rects.size()); } + public void testGroupRectanglesListOfRectIntDoubleListOfIntegerListOfDouble() { + fail("Not yet implemented"); + } + public void testGroupRectanglesListOfRectListOfIntegerInt() { fail("Not yet implemented"); } diff --git a/modules/java/android_test/src/org/opencv/test/ConvertersTest.java b/modules/java/android_test/src/org/opencv/test/utils/ConvertersTest.java similarity index 57% rename from modules/java/android_test/src/org/opencv/test/ConvertersTest.java rename to modules/java/android_test/src/org/opencv/test/utils/ConvertersTest.java index 8d7f218..2941818 100644 --- a/modules/java/android_test/src/org/opencv/test/ConvertersTest.java +++ b/modules/java/android_test/src/org/opencv/test/utils/ConvertersTest.java @@ -1,189 +1,294 @@ -package org.opencv.test; - -import java.util.ArrayList; -import java.util.List; - -import org.opencv.utils.Converters; -import org.opencv.core.CvType; -import org.opencv.core.Mat; -import org.opencv.core.Point; -import org.opencv.core.Rect; -import org.opencv.features2d.KeyPoint; - -public class ConvertersTest extends OpenCVTestCase { - - public void testMat_to_vector_float() { - Mat src = new Mat(4, 1, CvType.CV_32FC1); - src.put(0, 0, 2, 4, 3, 9); - List fs = new ArrayList(); - - Converters.Mat_to_vector_float(src, fs); - List truth = new ArrayList(); - truth.add(2.0f); - truth.add(4.0f); - truth.add(3.0f); - truth.add(9.0f); - assertListFloatEquals(truth, fs, EPS); - } - - public void testMat_to_vector_int() { - Mat src = new Mat(4, 1, CvType.CV_32SC1); - src.put(0, 0, 2, 4, 3, 9); - List fs = new ArrayList(); - - Converters.Mat_to_vector_int(src, fs); - List truth = new ArrayList(); - truth.add(2); - truth.add(4); - truth.add(3); - truth.add(9); - assertListIntegerEquals(truth, fs); - } - - public void testMat_to_vector_KeyPoint() { - Mat src = new Mat(1, 1, CvType.CV_64FC(7)); - src.put(0, 0, 2, 4, 3, 9, 10, 12, 7); - List kps = new ArrayList(); - - Converters.Mat_to_vector_KeyPoint(src, kps); - List truth = new ArrayList(); - truth.add(new KeyPoint(2, 4, 3, 9, 10, 12, 7)); - assertListKeyPointEquals(truth, kps, EPS); - } - - public void testMat_to_vector_Mat() { - //Mat src = new Mat(4, 1, CvType.CV_32SC2); - //src.put(0, 0, 2, 2, 3, 3, 4, 4, 5, 5); - // - //List mats = new ArrayList(); - //Converters.Mat_to_vector_Mat(src, mats); - // - //List truth = new ArrayList(); - //truth.add(new Mat(2, 1, CvType.CV_32SC1, Scalar.all(2.0))); - //truth.add(new Mat(2, 1, CvType.CV_32SC1, Scalar.all(3.0))); - //truth.add(new Mat(2, 1, CvType.CV_32SC1, Scalar.all(4.0))); - //truth.add(new Mat(2, 1, CvType.CV_32SC1, Scalar.all(5.0))); - //assertListEqualMat(truth, mats, EPS); - fail("Not yet implemented"); - } - - public void testMat_to_vector_Point() { - Mat src = new Mat(4, 1, CvType.CV_32SC2); - src.put(0, 0, 2, 4, 3, 9, 10, 4, 35, 54); - List points = new ArrayList(); - - Converters.Mat_to_vector_Point(src, points); - List truth = new ArrayList(); - truth.add(new Point(2, 4)); - truth.add(new Point(3, 9)); - truth.add(new Point(10, 4)); - truth.add(new Point(35, 54)); - assertListPointEquals(truth, points, EPS); - } - - public void testMat_to_vector_Rect() { - Mat src = new Mat(2, 1, CvType.CV_32SC4); - src.put(0, 0, 2, 2, 5, 2, 0, 0, 6, 4); - List rectangles = new ArrayList(); - - Converters.Mat_to_vector_Rect(src, rectangles); - List truth = new ArrayList(); - truth.add(new Rect(2, 2, 5, 2)); - truth.add(new Rect(0, 0, 6, 4)); - assertListRectEquals(truth, rectangles); - } - - public void testVector_double_to_Mat() { - List inputVector = new ArrayList(); - inputVector.add(2.0); - inputVector.add(4.0); - inputVector.add(3.0); - inputVector.add(9.0); - - dst = Converters.vector_double_to_Mat(inputVector); - truth = new Mat(4, 1, CvType.CV_64FC1); - truth.put(0, 0, 2, 4, 3, 9); - assertMatEqual(truth, dst, EPS); - } - - public void testVector_float_to_Mat() { - List inputVector = new ArrayList(); - inputVector.add(2.0f); - inputVector.add(4.0f); - inputVector.add(3.0f); - inputVector.add(9.0f); - - dst = Converters.vector_float_to_Mat(inputVector); - truth = new Mat(4, 1, CvType.CV_32FC1); - truth.put(0, 0, 2, 4, 3, 9); - assertMatEqual(truth, dst, EPS); - } - - public void testVector_int_to_Mat() { - List inputVector = new ArrayList(); - inputVector.add(2); - inputVector.add(4); - inputVector.add(3); - inputVector.add(9); - - dst = Converters.vector_int_to_Mat(inputVector); - truth = new Mat(4, 1, CvType.CV_32SC1); - truth.put(0, 0, 2, 4, 3, 9); - assertMatEqual(truth, dst); - } - - public void testVector_Mat_to_Mat() { - //List mats = new ArrayList(); - //mats.add(new Mat(2, 1, CvType.CV_32SC1, Scalar.all(2.0))); - //mats.add(new Mat(2, 1, CvType.CV_32SC1, Scalar.all(2.0))); - //mats.add(new Mat(2, 1, CvType.CV_32SC1, Scalar.all(2.0))); - //mats.add(new Mat(2, 1, CvType.CV_32SC1, Scalar.all(2.0))); - //mats.add(gray0); - //mats.add(gray255); - // - //dst = Converters.vector_Mat_to_Mat(mats); - fail("Not yet implemented"); - } - - public void testVector_Point_to_Mat() { - List points = new ArrayList(); - points.add(new Point(2, 4)); - points.add(new Point(3, 9)); - points.add(new Point(10, 4)); - points.add(new Point(35, 54)); - - dst = Converters.vector_Point_to_Mat(points); - truth = new Mat(4, 1, CvType.CV_32SC2); - truth.put(0, 0, 2, 4, 3, 9, 10, 4, 35, 54); - assertMatEqual(truth, dst); - } - - public void testVector_Rect_to_Mat() { - List rectangles = new ArrayList(); - rectangles.add(new Rect(2, 2, 5, 2)); - rectangles.add(new Rect(0, 0, 6, 4)); - - dst = Converters.vector_Rect_to_Mat(rectangles); - truth = new Mat(2, 1, CvType.CV_32SC4); - truth.put(0, 0, 2, 2, 5, 2, 0, 0, 6, 4); - assertMatEqual(truth, dst); - } - - public void testVector_uchar_to_Mat() { - List bytes = new ArrayList(); - byte value1 = 1; - byte value2 = 2; - byte value3 = 3; - byte value4 = 4; - bytes.add(new Byte(value1)); - bytes.add(new Byte(value2)); - bytes.add(new Byte(value3)); - bytes.add(new Byte(value4)); - - dst = Converters.vector_uchar_to_Mat(bytes); - truth = new Mat(4, 1, CvType.CV_8UC1); - truth.put(0, 0, 1, 2, 3, 4); - assertMatEqual(truth, dst); - } - -} +package org.opencv.test.utils; + +import java.util.ArrayList; +import java.util.List; + +import org.opencv.core.CvType; +import org.opencv.core.Mat; +import org.opencv.core.Point; +import org.opencv.core.Rect; +import org.opencv.features2d.KeyPoint; +import org.opencv.test.OpenCVTestCase; +import org.opencv.utils.Converters; + +public class ConvertersTest extends OpenCVTestCase { + + public void testMat_to_vector_char() { + fail("Not yet implemented"); + } + + public void testMat_to_vector_DMatch() { + fail("Not yet implemented"); + } + + public void testMat_to_vector_float() { + Mat src = new Mat(4, 1, CvType.CV_32FC1); + src.put(0, 0, 2, 4, 3, 9); + List fs = new ArrayList(); + + Converters.Mat_to_vector_float(src, fs); + List truth = new ArrayList(); + truth.add(2.0f); + truth.add(4.0f); + truth.add(3.0f); + truth.add(9.0f); + assertListEquals(truth, fs, EPS); + } + + public void testMat_to_vector_int() { + Mat src = new Mat(4, 1, CvType.CV_32SC1); + src.put(0, 0, 2, 4, 3, 9); + List fs = new ArrayList(); + + Converters.Mat_to_vector_int(src, fs); + List truth = new ArrayList(); + truth.add(2); + truth.add(4); + truth.add(3); + truth.add(9); + assertListEquals(truth, fs); + } + + public void testMat_to_vector_KeyPoint() { + Mat src = new Mat(1, 1, CvType.CV_64FC(7)); + src.put(0, 0, 2, 4, 3, 9, 10, 12, 7); + List kps = new ArrayList(); + + Converters.Mat_to_vector_KeyPoint(src, kps); + List truth = new ArrayList(); + truth.add(new KeyPoint(2, 4, 3, 9, 10, 12, 7)); + assertListKeyPointEquals(truth, kps, EPS); + } + + public void testMat_to_vector_Mat() { + // Mat src = new Mat(4, 1, CvType.CV_32SC2); + // src.put(0, 0, 2, 2, 3, 3, 4, 4, 5, 5); + // + // List mats = new ArrayList(); + // Converters.Mat_to_vector_Mat(src, mats); + // + // List truth = new ArrayList(); + // truth.add(new Mat(2, 1, CvType.CV_32SC1, Scalar.all(2.0))); + // truth.add(new Mat(2, 1, CvType.CV_32SC1, Scalar.all(3.0))); + // truth.add(new Mat(2, 1, CvType.CV_32SC1, Scalar.all(4.0))); + // truth.add(new Mat(2, 1, CvType.CV_32SC1, Scalar.all(5.0))); + // assertListEqualMat(truth, mats, EPS); + fail("Not yet implemented"); + } + + public void testMat_to_vector_Point() { + Mat src = new Mat(4, 1, CvType.CV_32SC2); + src.put(0, 0, 2, 4, 3, 9, 10, 4, 35, 54); + List points = new ArrayList(); + + Converters.Mat_to_vector_Point(src, points); + List truth = new ArrayList(); + truth.add(new Point(2, 4)); + truth.add(new Point(3, 9)); + truth.add(new Point(10, 4)); + truth.add(new Point(35, 54)); + assertListPointEquals(truth, points, EPS); + } + + public void testMat_to_vector_Point2d() { + fail("Not yet implemented"); + } + + public void testMat_to_vector_Point2f() { + fail("Not yet implemented"); + } + + public void testMat_to_vector_Point3() { + fail("Not yet implemented"); + } + + public void testMat_to_vector_Point3d() { + fail("Not yet implemented"); + } + + public void testMat_to_vector_Point3f() { + fail("Not yet implemented"); + } + + public void testMat_to_vector_Point3i() { + fail("Not yet implemented"); + } + + public void testMat_to_vector_Rect() { + Mat src = new Mat(2, 1, CvType.CV_32SC4); + src.put(0, 0, 2, 2, 5, 2, 0, 0, 6, 4); + List rectangles = new ArrayList(); + + Converters.Mat_to_vector_Rect(src, rectangles); + List truth = new ArrayList(); + truth.add(new Rect(2, 2, 5, 2)); + truth.add(new Rect(0, 0, 6, 4)); + assertListRectEquals(truth, rectangles); + } + + public void testMat_to_vector_uchar() { + fail("Not yet implemented"); + } + + public void testMat_to_vector_vector_char() { + fail("Not yet implemented"); + } + + public void testMat_to_vector_vector_DMatch() { + fail("Not yet implemented"); + } + + public void testMat_to_vector_vector_KeyPoint() { + fail("Not yet implemented"); + } + + public void testVector_char_to_Mat() { + fail("Not yet implemented"); + } + + public void testVector_DMatch_to_Mat() { + fail("Not yet implemented"); + } + + public void testVector_double_to_Mat() { + List inputVector = new ArrayList(); + inputVector.add(2.0); + inputVector.add(4.0); + inputVector.add(3.0); + inputVector.add(9.0); + + dst = Converters.vector_double_to_Mat(inputVector); + truth = new Mat(4, 1, CvType.CV_64FC1); + truth.put(0, 0, 2, 4, 3, 9); + assertMatEqual(truth, dst, EPS); + } + + public void testVector_float_to_Mat() { + List inputVector = new ArrayList(); + inputVector.add(2.0f); + inputVector.add(4.0f); + inputVector.add(3.0f); + inputVector.add(9.0f); + + dst = Converters.vector_float_to_Mat(inputVector); + truth = new Mat(4, 1, CvType.CV_32FC1); + truth.put(0, 0, 2, 4, 3, 9); + assertMatEqual(truth, dst, EPS); + } + + public void testVector_int_to_Mat() { + List inputVector = new ArrayList(); + inputVector.add(2); + inputVector.add(4); + inputVector.add(3); + inputVector.add(9); + + dst = Converters.vector_int_to_Mat(inputVector); + truth = new Mat(4, 1, CvType.CV_32SC1); + truth.put(0, 0, 2, 4, 3, 9); + assertMatEqual(truth, dst); + } + + public void testVector_KeyPoint_to_Mat() { + fail("Not yet implemented"); + } + + public void testVector_Mat_to_Mat() { + // List mats = new ArrayList(); + // mats.add(new Mat(2, 1, CvType.CV_32SC1, Scalar.all(2.0))); + // mats.add(new Mat(2, 1, CvType.CV_32SC1, Scalar.all(2.0))); + // mats.add(new Mat(2, 1, CvType.CV_32SC1, Scalar.all(2.0))); + // mats.add(new Mat(2, 1, CvType.CV_32SC1, Scalar.all(2.0))); + // mats.add(gray0); + // mats.add(gray255); + // + // dst = Converters.vector_Mat_to_Mat(mats); + fail("Not yet implemented"); + } + + public void testVector_Point_to_Mat() { + List points = new ArrayList(); + points.add(new Point(2, 4)); + points.add(new Point(3, 9)); + points.add(new Point(10, 4)); + points.add(new Point(35, 54)); + + dst = Converters.vector_Point_to_Mat(points); + truth = new Mat(4, 1, CvType.CV_32SC2); + truth.put(0, 0, 2, 4, 3, 9, 10, 4, 35, 54); + assertMatEqual(truth, dst); + } + + public void testVector_Point_to_MatListOfPoint() { + fail("Not yet implemented"); + } + + public void testVector_Point_to_MatListOfPointInt() { + fail("Not yet implemented"); + } + + public void testVector_Point2d_to_Mat() { + fail("Not yet implemented"); + } + + public void testVector_Point2f_to_Mat() { + fail("Not yet implemented"); + } + + public void testVector_Point3_to_Mat() { + fail("Not yet implemented"); + } + + public void testVector_Point3d_to_Mat() { + fail("Not yet implemented"); + } + + public void testVector_Point3f_to_Mat() { + fail("Not yet implemented"); + } + + public void testVector_Point3i_to_Mat() { + fail("Not yet implemented"); + } + + public void testVector_Rect_to_Mat() { + List rectangles = new ArrayList(); + rectangles.add(new Rect(2, 2, 5, 2)); + rectangles.add(new Rect(0, 0, 6, 4)); + + dst = Converters.vector_Rect_to_Mat(rectangles); + truth = new Mat(2, 1, CvType.CV_32SC4); + truth.put(0, 0, 2, 2, 5, 2, 0, 0, 6, 4); + assertMatEqual(truth, dst); + } + + public void testVector_uchar_to_Mat() { + List bytes = new ArrayList(); + byte value1 = 1; + byte value2 = 2; + byte value3 = 3; + byte value4 = 4; + bytes.add(new Byte(value1)); + bytes.add(new Byte(value2)); + bytes.add(new Byte(value3)); + bytes.add(new Byte(value4)); + + dst = Converters.vector_uchar_to_Mat(bytes); + truth = new Mat(4, 1, CvType.CV_8UC1); + truth.put(0, 0, 1, 2, 3, 4); + assertMatEqual(truth, dst); + } + + public void testVector_vector_char_to_Mat() { + fail("Not yet implemented"); + } + + public void testVector_vector_DMatch_to_Mat() { + fail("Not yet implemented"); + } + + public void testVector_vector_KeyPoint_to_Mat() { + fail("Not yet implemented"); + } + +} diff --git a/modules/java/android_test/src/org/opencv/test/video/BackgroundSubtractorMOGTest.java b/modules/java/android_test/src/org/opencv/test/video/BackgroundSubtractorMOGTest.java index ba7c787..aa9ae03 100644 --- a/modules/java/android_test/src/org/opencv/test/video/BackgroundSubtractorMOGTest.java +++ b/modules/java/android_test/src/org/opencv/test/video/BackgroundSubtractorMOGTest.java @@ -4,8 +4,12 @@ import org.opencv.test.OpenCVTestCase; public class BackgroundSubtractorMOGTest extends OpenCVTestCase { - protected void setUp() throws Exception { - super.setUp(); + public void testApplyMatMat() { + fail("Not yet implemented"); + } + + public void testApplyMatMatDouble() { + fail("Not yet implemented"); } public void testBackgroundSubtractorMOG() { diff --git a/modules/java/android_test/src/org/opencv/test/video/BackgroundSubtractorTest.java b/modules/java/android_test/src/org/opencv/test/video/BackgroundSubtractorTest.java deleted file mode 100644 index 93ba029..0000000 --- a/modules/java/android_test/src/org/opencv/test/video/BackgroundSubtractorTest.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.opencv.test.video; - -import org.opencv.test.OpenCVTestCase; - -public class BackgroundSubtractorTest extends OpenCVTestCase { - - protected void setUp() throws Exception { - super.setUp(); - } - - public void testApplyMatMat() { - fail("Not yet implemented"); - } - - public void testApplyMatMatDouble() { - fail("Not yet implemented"); - } - -} diff --git a/modules/java/android_test/src/org/opencv/test/video/KalmanFilterTest.java b/modules/java/android_test/src/org/opencv/test/video/KalmanFilterTest.java index d3c3aeb..db35a8d 100644 --- a/modules/java/android_test/src/org/opencv/test/video/KalmanFilterTest.java +++ b/modules/java/android_test/src/org/opencv/test/video/KalmanFilterTest.java @@ -5,10 +5,6 @@ import org.opencv.video.KalmanFilter; public class KalmanFilterTest extends OpenCVTestCase { - protected void setUp() throws Exception { - super.setUp(); - } - public void testCorrect() { fail("Not yet implemented"); } diff --git a/modules/java/android_test/src/org/opencv/test/video/videoTest.java b/modules/java/android_test/src/org/opencv/test/video/VideoTest.java similarity index 65% rename from modules/java/android_test/src/org/opencv/test/video/videoTest.java rename to modules/java/android_test/src/org/opencv/test/video/VideoTest.java index 1a844b8..29846f9 100644 --- a/modules/java/android_test/src/org/opencv/test/video/videoTest.java +++ b/modules/java/android_test/src/org/opencv/test/video/VideoTest.java @@ -11,20 +11,20 @@ import org.opencv.test.OpenCVTestCase; import org.opencv.utils.Converters; import org.opencv.video.Video; -public class videoTest extends OpenCVTestCase { +public class VideoTest extends OpenCVTestCase { + + private List err = null; + private int h; + private List nextPts = null; + List prevPts = null; private int shift1; private int shift2; - private int w; - private int h; + private List status = null; private Mat subLena1 = null; private Mat subLena2 = null; - - List prevPts = null; - private List nextPts = null; - private List status = null; - private List err = null; + private int w; @Override protected void setUp() throws Exception { @@ -64,37 +64,37 @@ public class videoTest extends OpenCVTestCase { fail("Not yet implemented"); } - public void testCalcOpticalFlowPyrLKMatMatListOfPointListOfPointListOfByteListOfFloatSizeIntTermCriteriaDoubleIntDouble() { - fail("Not yet implemented"); - } + public void testCalcOpticalFlowPyrLKMatMatListOfPointListOfPointListOfByteListOfFloat() { + Video.calcOpticalFlowPyrLK(subLena1, subLena2, prevPts, nextPts, status, err); + assertEquals(3, Core.countNonZero(Converters.vector_uchar_to_Mat(status))); + } - public void testCalcOpticalFlowPyrLKMatMatListOfPointListOfPointListOfByteListOfFloatSizeIntTermCriteriaDoubleInt() { - fail("Not yet implemented"); - } + public void testCalcOpticalFlowPyrLKMatMatListOfPointListOfPointListOfByteListOfFloatSize() { + Size sz = new Size(3, 3); + Video.calcOpticalFlowPyrLK(subLena1, subLena2, prevPts, nextPts, status, err, sz); + assertEquals(0, Core.countNonZero(Converters.vector_uchar_to_Mat(status))); + } + + public void testCalcOpticalFlowPyrLKMatMatListOfPointListOfPointListOfByteListOfFloatSizeInt() { + fail("Not yet implemented"); + } - public void testCalcOpticalFlowPyrLKMatMatListOfPointListOfPointListOfByteListOfFloatSizeIntTermCriteriaDouble() { - fail("Not yet implemented"); - } + public void testCalcOpticalFlowPyrLKMatMatListOfPointListOfPointListOfByteListOfFloatSizeIntTermCriteria() { + fail("Not yet implemented"); + } - public void testCalcOpticalFlowPyrLKMatMatListOfPointListOfPointListOfByteListOfFloatSizeIntTermCriteria() { - fail("Not yet implemented"); - } + public void testCalcOpticalFlowPyrLKMatMatListOfPointListOfPointListOfByteListOfFloatSizeIntTermCriteriaDouble() { + fail("Not yet implemented"); + } - public void testCalcOpticalFlowPyrLKMatMatListOfPointListOfPointListOfByteListOfFloatSizeInt() { - fail("Not yet implemented"); - } + public void testCalcOpticalFlowPyrLKMatMatListOfPointListOfPointListOfByteListOfFloatSizeIntTermCriteriaDoubleInt() { + fail("Not yet implemented"); + } - public void testCalcOpticalFlowPyrLKMatMatListOfPointListOfPointListOfByteListOfFloatSize() { - Size sz = new Size(3, 3); - Video.calcOpticalFlowPyrLK(subLena1, subLena2, prevPts, nextPts, status, err, sz); - assertEquals(0, Core.countNonZero( Converters.vector_uchar_to_Mat(status) )); - } + public void testCalcOpticalFlowPyrLKMatMatListOfPointListOfPointListOfByteListOfFloatSizeIntTermCriteriaDoubleIntDouble() { + fail("Not yet implemented"); + } - public void testCalcOpticalFlowPyrLKMatMatListOfPointListOfPointListOfByteListOfFloat() { - Video.calcOpticalFlowPyrLK(subLena1, subLena2, prevPts, nextPts, status, err); - assertEquals(3, Core.countNonZero( Converters.vector_uchar_to_Mat(status) )); - } - public void testCamShift() { fail("Not yet implemented"); } diff --git a/modules/java/gen_java.py b/modules/java/gen_java.py index 3ff9ffc..6cdc659 100644 --- a/modules/java/gen_java.py +++ b/modules/java/gen_java.py @@ -471,6 +471,195 @@ JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Core_n_1getTextSize "imshow" : {'j_code' : '', 'jn_code' : '', 'cpp_code' : '' }, "waitKey" : {'j_code' : '', 'jn_code' : '', 'cpp_code' : '' }, }, # Highgui + + 'CvANN_MLP_TrainParams': + { + "CvANN_MLP_TrainParams" : + { + 'j_code' : """ +//javadoc:CvANN_MLP_TrainParams::CvANN_MLP_TrainParams() +public CvANN_MLP_TrainParams() { + nativeObj = n_newObj(); +} + """, + 'jn_code' : 'private static native long n_newObj();', + 'cpp_code' : """ +JNIEXPORT jlong JNICALL Java_org_opencv_ml_CvANN_1MLP_1TrainParams_n_1newObj + (JNIEnv* env, jclass cls) +{ + return (jlong) new CvANN_MLP_TrainParams(); +} + """ + }, + }, + + 'CvBoostParams': + { + "CvBoostParams" : + { + 'j_code' : """ +//javadoc:CvBoostParams::CvBoostParams() +public CvBoostParams() { + nativeObj = n_newObj(); +} + """, + 'jn_code' : 'private static native long n_newObj();', + 'cpp_code' : """ +JNIEXPORT jlong JNICALL Java_org_opencv_ml_CvBoostParams_n_1newObj + (JNIEnv* env, jclass cls) +{ + return (jlong) new CvBoostParams(); +} + """ + }, + }, + + 'CvDTreeParams': + { + "CvDTreeParams" : + { + 'j_code' : """ +//javadoc:CvDTreeParams::CvDTreeParams() +public CvDTreeParams() { + nativeObj = n_newObj(); +} + """, + 'jn_code' : 'private static native long n_newObj();', + 'cpp_code' : """ +JNIEXPORT jlong JNICALL Java_org_opencv_ml_CvDTreeParams_n_1newObj + (JNIEnv* env, jclass cls) +{ + return (jlong) new CvDTreeParams(); +} + """ + }, + }, + + 'CvEMParams': + { + "CvEMParams" : + { + 'j_code' : """ +//javadoc:CvEMParams::CvEMParams() +public CvEMParams() { + nativeObj = n_newObj(); +} + """, + 'jn_code' : 'private static native long n_newObj();', + 'cpp_code' : """ +JNIEXPORT jlong JNICALL Java_org_opencv_ml_CvEMParams_n_1newObj + (JNIEnv* env, jclass cls) +{ + return (jlong) new CvEMParams(); +} + """ + }, + }, + + 'CvGBTreesParams': + { + "CvGBTreesParams" : + { + 'j_code' : """ +//javadoc:CvGBTreesParams::CvGBTreesParams() +public CvGBTreesParams() { + nativeObj = n_newObj(); +} + """, + 'jn_code' : 'private static native long n_newObj();', + 'cpp_code' : """ +JNIEXPORT jlong JNICALL Java_org_opencv_ml_CvGBTreesParams_n_1newObj + (JNIEnv* env, jclass cls) +{ + return (jlong) new CvGBTreesParams(); +} + """ + }, + }, + + 'CvParamGrid': + { + "CvParamGrid" : + { + 'j_code' : """ +//javadoc:CvParamGrid::CvParamGrid() +public CvParamGrid() { + nativeObj = n_newObj(); +} + """, + 'jn_code' : 'private static native long n_newObj();', + 'cpp_code' : """ +JNIEXPORT jlong JNICALL Java_org_opencv_ml_CvParamGrid_n_1newObj + (JNIEnv* env, jclass cls) +{ + return (jlong) new CvParamGrid(); +} + """ + }, + }, + + 'CvRTParams': + { + "CvRTParams" : + { + 'j_code' : """ +//javadoc:CvRTParams::CvRTParams() +public CvRTParams() { + nativeObj = n_newObj(); +} + """, + 'jn_code' : 'private static native long n_newObj();', + 'cpp_code' : """ +JNIEXPORT jlong JNICALL Java_org_opencv_ml_CvRTParams_n_1newObj + (JNIEnv* env, jclass cls) +{ + return (jlong) new CvRTParams(); +} + """ + }, + }, + + 'CvStatModel': + { + "CvStatModel" : + { + 'j_code' : """ +//javadoc:CvStatModel::CvStatModel() +public CvStatModel() { + nativeObj = n_newObj(); +} + """, + 'jn_code' : 'private static native long n_newObj();', + 'cpp_code' : """ +JNIEXPORT jlong JNICALL Java_org_opencv_ml_CvStatModel_n_1newObj + (JNIEnv* env, jclass cls) +{ + return (jlong) new CvStatModel(); +} + """ + }, + }, + + 'CvSVMParams': + { + "CvSVMParams" : + { + 'j_code' : """ +//javadoc:CvSVMParams::CvSVMParams() +public CvSVMParams() { + nativeObj = n_newObj(); +} + """, + 'jn_code' : 'private static native long n_newObj();', + 'cpp_code' : """ +JNIEXPORT jlong JNICALL Java_org_opencv_ml_CvSVMParams_n_1newObj + (JNIEnv* env, jclass cls) +{ + return (jlong) new CvSVMParams(); +} + """ + }, + }, } # { class : { func : {arg_name : ctype} } } @@ -759,6 +948,16 @@ public class %(jc)s { self.add_const(decl) else: # function self.add_func(decl) + + #FIXME: BackgroundSubtractor is merged into BackgroundSubtractorMOG because of inheritance + if "BackgroundSubtractor" in self.classes: + bs = self.classes["BackgroundSubtractor"] + bsmog = self.classes["BackgroundSubtractorMOG"] + for name, mtd in bs.methods.items(): + for fn in mtd.funcs: + fn.classname = "BackgroundSubtractorMOG" + bsmog.methods[name] = mtd; + del self.classes["BackgroundSubtractor"] self.cpp_code = StringIO() self.cpp_code.write(""" @@ -1131,7 +1330,7 @@ JNIEXPORT $rtype JNICALL Java_org_opencv_${module}_${clazz}_$fname """ ).substitute( \ rtype = rtype, \ module = self.module, \ - clazz = clazz, \ + clazz = clazz.replace('_', '_1'), \ fname = (fi.jname + '_' + str(suffix_counter)).replace('_', '_1'), \ args = ", ".join(["%s %s" % (type_dict[a.ctype].get("jni_type"), a.name) for a in jni_args]), \ prologue = "\n ".join(c_prologue), \ -- 2.7.4