From 18b2d6bdbbbcb28dfbf6dad4b9058b909228de25 Mon Sep 17 00:00:00 2001 From: Andrey Pavlenko Date: Fri, 5 Apr 2013 08:50:08 +0400 Subject: [PATCH 1/3] copying '.classpath' and '.project' to build dir, useful for opening in eclipse --- modules/java/android_test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/java/android_test/CMakeLists.txt b/modules/java/android_test/CMakeLists.txt index 06ebf4aa10..41f69e6ca7 100644 --- a/modules/java/android_test/CMakeLists.txt +++ b/modules/java/android_test/CMakeLists.txt @@ -14,7 +14,7 @@ ocv_list_filterout(opencv_test_java_files ".svn") # copy sources out from the build tree set(opencv_test_java_file_deps "") -foreach(f ${opencv_test_java_files} ${ANDROID_MANIFEST_FILE}) +foreach(f ${opencv_test_java_files} ${ANDROID_MANIFEST_FILE} ".classpath" ".project") add_custom_command( OUTPUT "${opencv_test_java_bin_dir}/${f}" COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/${f}" "${opencv_test_java_bin_dir}/${f}" From 09fe5cddf185c641e4b4bbf4c11c1f57771c72d3 Mon Sep 17 00:00:00 2001 From: Andrey Pavlenko Date: Fri, 5 Apr 2013 08:50:24 +0400 Subject: [PATCH 2/3] test for the issue #2901 --- .../BruteForceHammingDescriptorMatcherTest.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 08ff220ede..d09515c760 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 @@ -1,5 +1,6 @@ package org.opencv.test.features2d; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -204,7 +205,17 @@ public class BruteForceHammingDescriptorMatcherTest extends OpenCVTestCase { } public void testRadiusMatchMatListOfListOfDMatchFloat() { - fail("Not yet implemented"); + Mat train = getTrainDescriptors(); + Mat query = getQueryDescriptors(); + ArrayList matches = new ArrayList(); + + matcher.radiusMatch(query, train, matches, 50.f); + + assertEquals(matches.size(), 4); + assertTrue(matches.get(0).empty()); + assertMatEqual(matches.get(1), new MatOfDMatch(truth[1]), EPS); + assertMatEqual(matches.get(2), new MatOfDMatch(truth[2]), EPS); + assertTrue(matches.get(3).empty()); } public void testRadiusMatchMatListOfListOfDMatchFloatListOfMat() { From 4c31c26acf51743c7b54a566768eac069ed332dc Mon Sep 17 00:00:00 2001 From: Andrey Pavlenko Date: Fri, 5 Apr 2013 08:50:37 +0400 Subject: [PATCH 3/3] fix for #2901 (en exception was raised when getting empty MatOfDMatch) --- modules/java/generator/src/java/core+MatOfDMatch.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/java/generator/src/java/core+MatOfDMatch.java b/modules/java/generator/src/java/core+MatOfDMatch.java index 7a3094933c..4a161017d4 100644 --- a/modules/java/generator/src/java/core+MatOfDMatch.java +++ b/modules/java/generator/src/java/core+MatOfDMatch.java @@ -16,8 +16,8 @@ public class MatOfDMatch extends Mat { protected MatOfDMatch(long addr) { super(addr); - if(checkVector(_channels, _depth) < 0 ) - throw new IllegalArgumentException("Incomatible Mat"); + if( !empty() && checkVector(_channels, _depth) < 0 ) + throw new IllegalArgumentException("Incomatible Mat: " + toString()); //FIXME: do we need release() here? } @@ -27,8 +27,8 @@ public class MatOfDMatch extends Mat { public MatOfDMatch(Mat m) { super(m, Range.all()); - if(checkVector(_channels, _depth) < 0 ) - throw new IllegalArgumentException("Incomatible Mat"); + if( !empty() && checkVector(_channels, _depth) < 0 ) + throw new IllegalArgumentException("Incomatible Mat: " + toString()); //FIXME: do we need release() here? }