提交 3b6a82b5 编写于 作者: A Andrey Kamaev 提交者: OpenCV Buildbot

Merge pull request #769 from apavlenko:fix_2901

......@@ -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}"
......
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<MatOfDMatch> matches = new ArrayList<MatOfDMatch>();
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() {
......
......@@ -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?
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册