Modified java wrapping mechanism
This commit is contained in:
@@ -8,7 +8,7 @@ if(IOS OR NOT PYTHON_DEFAULT_AVAILABLE OR NOT ANT_EXECUTABLE OR NOT (JNI_FOUND O
|
||||
endif()
|
||||
|
||||
set(the_description "The java bindings")
|
||||
ocv_add_module(java BINDINGS opencv_core opencv_imgproc OPTIONAL opencv_objdetect opencv_features2d opencv_video opencv_imgcodecs opencv_videoio opencv_calib3d opencv_photo opencv_bioinspired)
|
||||
ocv_add_module(java BINDINGS opencv_core opencv_imgproc)
|
||||
ocv_module_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/generator/src/cpp")
|
||||
|
||||
if(NOT ANDROID)
|
||||
@@ -20,88 +20,168 @@ set(JAVA_INSTALL_ROOT "sdk/java")
|
||||
set(JNI_INSTALL_ROOT "sdk/native")
|
||||
|
||||
# get list of modules to wrap
|
||||
string(REPLACE "opencv_" "" OPENCV_JAVA_MODULES "${OPENCV_MODULE_${the_module}_REQ_DEPS};${OPENCV_MODULE_${the_module}_OPT_DEPS}")
|
||||
foreach(module ${OPENCV_JAVA_MODULES})
|
||||
if(NOT HAVE_opencv_${module})
|
||||
list(REMOVE_ITEM OPENCV_JAVA_MODULES ${module})
|
||||
message(STATUS "Wrapped in java:")
|
||||
set(OPENCV_JAVA_MODULES)
|
||||
foreach(m ${OPENCV_MODULES_BUILD})
|
||||
if (";${OPENCV_MODULE_${m}_WRAPPERS};" MATCHES ";java;" AND HAVE_${m})
|
||||
string(REPLACE "opencv_" "" m ${m})
|
||||
list(APPEND OPENCV_JAVA_MODULES ${m})
|
||||
message(STATUS "\topencv_${m}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
######################################################################################################################################
|
||||
|
||||
# UTILITY: make C headers go first
|
||||
macro(sort_headers_c_cpp __lst)
|
||||
set(__cpp ${${__lst}})
|
||||
ocv_list_filterout(__cpp "\\\\.h$")
|
||||
if(__cpp)
|
||||
list(REMOVE_ITEM ${__lst} ${__cpp})
|
||||
list(APPEND ${__lst} ${__cpp})
|
||||
endif()
|
||||
unset(__cpp)
|
||||
endmacro()
|
||||
|
||||
# UTILITY: force cmake to rerun when files from list have changed
|
||||
macro(add_cmake_dependencies)
|
||||
foreach (f ${ARGN})
|
||||
get_filename_component(f_name "${f}" NAME)
|
||||
configure_file(${f} ${OpenCV_BINARY_DIR}/junk/${f_name}.junk COPYONLY)
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
# UTILITY: glob specific sources and append them to list (type is in H, CPP, JAVA, AIDL)
|
||||
macro(glob_more_specific_sources _type _root _output)
|
||||
unset(_masks)
|
||||
if(${_type} STREQUAL "H")
|
||||
set(_masks "${_root}/src/cpp/*.h" "${root}/src/cpp/*.hpp")
|
||||
elseif(${_type} STREQUAL "CPP")
|
||||
set(_masks "${_root}/src/cpp/*.cpp")
|
||||
elseif(${_type} STREQUAL "JAVA")
|
||||
set(_masks "${_root}/src/java/*.java")
|
||||
elseif(${_type} STREQUAL "AIDL")
|
||||
set(_masks "${_root}/src/java/*.aidl")
|
||||
endif()
|
||||
if (_masks)
|
||||
file(GLOB _result ${_masks})
|
||||
list(APPEND ${_output} ${_result})
|
||||
else()
|
||||
message(WARNING "Bad argument passed to macro: skipped")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# UTILITY: copy common java test files and add them to _deps
|
||||
# copy_common_tests(<source-folder> <destination-folder> <variable-to-store-deps>)
|
||||
macro(copy_common_tests _src_location _dst_location _deps)
|
||||
set(_src ${${_src_location}})
|
||||
set(_dst ${${_dst_location}})
|
||||
file(GLOB_RECURSE _files RELATIVE "${_src}" "${_src}/res/*" "${_src}/src/*")
|
||||
foreach(f ${_files})
|
||||
add_custom_command(
|
||||
OUTPUT "${_dst}/${f}"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy "${_src}/${f}" "${_dst}/${f}"
|
||||
MAIN_DEPENDENCY "${_src}/${f}"
|
||||
COMMENT "Copying ${f}")
|
||||
list(APPEND ${_deps} "${_src}/${f}" "${_dst}/${f}")
|
||||
endforeach()
|
||||
unset(_files)
|
||||
unset(_src)
|
||||
unset(_dst)
|
||||
endmacro()
|
||||
|
||||
# UTILITY: copy all java tests for specific module and add them to _deps
|
||||
# copy_modules_tests(<modules-list> <destination-folder> <variable-to-store-deps>)
|
||||
macro(copy_modules_tests _modules _dst_location _deps)
|
||||
set(_dst ${${_dst_location}})
|
||||
foreach(module ${${_modules}})
|
||||
set(_src "${OPENCV_MODULE_opencv_${module}_LOCATION}/misc/java/test")
|
||||
set(_tree "src/org/opencv/test/${module}")
|
||||
file(GLOB _files RELATIVE "${_src}" "${_src}/*.java")
|
||||
foreach (f ${_files})
|
||||
add_custom_command(
|
||||
OUTPUT "${_dst}/${_tree}/${f}"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy "${_src}/${f}" "${_dst}/${_tree}/${f}"
|
||||
MAIN_DEPENDENCY "${_src}/${f}"
|
||||
COMMENT "Copying ${f}")
|
||||
list(APPEND ${_deps} "${_src}/${f}" "${_dst}/${_tree}/${f}")
|
||||
endforeach()
|
||||
unset(_files)
|
||||
unset(_src)
|
||||
unset(_tree)
|
||||
endforeach()
|
||||
unset(_dst)
|
||||
endmacro()
|
||||
|
||||
######################################################################################################################################
|
||||
|
||||
# scripts
|
||||
set(scripts_gen_java "${CMAKE_CURRENT_SOURCE_DIR}/generator/gen_java.py")
|
||||
set(scripts_hdr_parser "${CMAKE_CURRENT_SOURCE_DIR}/../python/src2/hdr_parser.py")
|
||||
|
||||
# directory to store temporary files generated on first gen_java.py run
|
||||
set(probe_dir "${CMAKE_CURRENT_BINARY_DIR}/gen_java_out")
|
||||
|
||||
# handwritten C/C++ and Java sources
|
||||
file(GLOB handwrittren_h_sources "${CMAKE_CURRENT_SOURCE_DIR}/generator/src/cpp/*.h" "${CMAKE_CURRENT_SOURCE_DIR}/generator/src/cpp/*.hpp")
|
||||
file(GLOB handwrittren_cpp_sources "${CMAKE_CURRENT_SOURCE_DIR}/generator/src/cpp/*.cpp")
|
||||
file(GLOB handwrittren_java_sources "${CMAKE_CURRENT_SOURCE_DIR}/generator/src/java/*.java")
|
||||
file(GLOB handwrittren_aidl_sources "${CMAKE_CURRENT_SOURCE_DIR}/generator/src/java/*.aidl")
|
||||
glob_more_specific_sources(H "${CMAKE_CURRENT_SOURCE_DIR}/generator" handwritten_h_sources)
|
||||
glob_more_specific_sources(CPP "${CMAKE_CURRENT_SOURCE_DIR}/generator" handwritten_cpp_sources)
|
||||
glob_more_specific_sources(JAVA "${CMAKE_CURRENT_SOURCE_DIR}/generator" handwritten_java_sources)
|
||||
glob_more_specific_sources(AIDL "${CMAKE_CURRENT_SOURCE_DIR}/generator" handwritten_aidl_sources)
|
||||
|
||||
# headers of OpenCV modules
|
||||
set(opencv_public_headers "")
|
||||
set(generated_cpp_sources "")
|
||||
set(generated_java_sources "")
|
||||
foreach(module ${OPENCV_JAVA_MODULES})
|
||||
set(module_java_dir "${OPENCV_MODULE_opencv_${module}_LOCATION}/misc/java")
|
||||
set(custom_header_list "${module_java_dir}/filelist")
|
||||
if(EXISTS "${custom_header_list}")
|
||||
file(STRINGS "${custom_header_list}" module_headers)
|
||||
ocv_list_add_prefix(module_headers "${OPENCV_MODULE_opencv_${module}_LOCATION}/")
|
||||
else()
|
||||
set(module_headers "${OPENCV_MODULE_opencv_${module}_HEADERS}")
|
||||
endif()
|
||||
|
||||
if(NOT module_headers)
|
||||
message(WARNING "Module ${module} does not have headers to wrap for java")
|
||||
endif()
|
||||
|
||||
sort_headers_c_cpp(module_headers)
|
||||
|
||||
set(opencv_public_headers_${module} ${module_headers})
|
||||
list(APPEND opencv_public_headers ${module_headers})
|
||||
list(APPEND generated_cpp_sources "${CMAKE_CURRENT_BINARY_DIR}/${module}.cpp")
|
||||
|
||||
include_directories("${module_java_dir}/src/cpp")
|
||||
|
||||
glob_more_specific_sources(H "${module_java_dir}" handwritten_h_sources)
|
||||
glob_more_specific_sources(CPP "${module_java_dir}" handwritten_cpp_sources)
|
||||
glob_more_specific_sources(JAVA "${module_java_dir}" handwritten_java_sources)
|
||||
glob_more_specific_sources(AIDL "${module_java_dir}" handwritten_aidl_sources)
|
||||
|
||||
# first run of gen_java.py (to get list of generated files)
|
||||
file(REMOVE_RECURSE "${probe_dir}")
|
||||
file(MAKE_DIRECTORY "${probe_dir}")
|
||||
execute_process(COMMAND ${PYTHON_DEFAULT_EXECUTABLE} "${scripts_gen_java}" "${scripts_hdr_parser}" ${module} ${opencv_public_headers_${module}}
|
||||
WORKING_DIRECTORY "${probe_dir}"
|
||||
OUTPUT_QUIET ERROR_QUIET)
|
||||
file(GLOB_RECURSE generated_java_sources_${module} RELATIVE "${probe_dir}" "${probe_dir}/*.java")
|
||||
ocv_list_add_prefix(generated_java_sources_${module} "${CMAKE_CURRENT_BINARY_DIR}/")
|
||||
list(APPEND generated_java_sources ${generated_java_sources_${module}})
|
||||
endforeach()
|
||||
|
||||
file(REMOVE_RECURSE "${probe_dir}")
|
||||
|
||||
if(NOT ANDROID)
|
||||
ocv_list_filterout(handwrittren_java_sources "/(engine|android)\\\\+")
|
||||
ocv_list_filterout(handwrittren_aidl_sources "/(engine|android)\\\\+")
|
||||
ocv_list_filterout(handwritten_java_sources "/(engine|android)\\\\+")
|
||||
ocv_list_filterout(handwritten_aidl_sources "/(engine|android)\\\\+")
|
||||
else()
|
||||
file(GLOB_RECURSE handwrittren_lib_project_files_rel RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/android_lib/" "${CMAKE_CURRENT_SOURCE_DIR}/android_lib/*")
|
||||
list(REMOVE_ITEM handwrittren_lib_project_files_rel "${ANDROID_MANIFEST_FILE}")
|
||||
endif()
|
||||
|
||||
# headers of OpenCV modules
|
||||
set(opencv_public_headers "")
|
||||
foreach(module ${OPENCV_JAVA_MODULES})
|
||||
# get list of module headers
|
||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/generator/config/${module}.filelist")
|
||||
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/generator/config/${module}.filelist" module_headers)
|
||||
ocv_list_add_prefix(module_headers "${OPENCV_MODULE_opencv_${module}_LOCATION}/")
|
||||
else()
|
||||
set(module_headers "${OPENCV_MODULE_opencv_${module}_HEADERS}")
|
||||
endif()
|
||||
if(module_headers)
|
||||
# C headers must go first
|
||||
set(module_headers_cpp ${module_headers})
|
||||
ocv_list_filterout(module_headers_cpp "\\\\.h$")
|
||||
if(module_headers_cpp)
|
||||
list(REMOVE_ITEM module_headers ${module_headers_cpp})
|
||||
list(APPEND module_headers ${module_headers_cpp})
|
||||
endif()
|
||||
unset(module_headers_cpp)
|
||||
|
||||
set(opencv_public_headers_${module} ${module_headers})
|
||||
list(APPEND opencv_public_headers ${module_headers})
|
||||
else()
|
||||
list(REMOVE_ITEM OPENCV_JAVA_MODULES ${module})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# generated cpp files
|
||||
set(generated_cpp_sources "")
|
||||
foreach(module ${OPENCV_JAVA_MODULES})
|
||||
list(APPEND generated_cpp_sources "${CMAKE_CURRENT_BINARY_DIR}/${module}.cpp")
|
||||
endforeach()
|
||||
|
||||
# IMPORTANT: add dependencies to cmake (we should rerun cmake if any of these files is modified)
|
||||
configure_file("${scripts_gen_java}" "${OpenCV_BINARY_DIR}/junk/gen_java.junk" COPYONLY)
|
||||
configure_file("${scripts_hdr_parser}" "${OpenCV_BINARY_DIR}/junk/hdr_parser.junk" COPYONLY)
|
||||
foreach(header ${opencv_public_headers})
|
||||
get_filename_component(header_name "${header}" NAME)
|
||||
configure_file("${header}" "${OpenCV_BINARY_DIR}/junk/${header_name}.junk" COPYONLY)
|
||||
endforeach()
|
||||
|
||||
# generated java files
|
||||
set(generated_java_sources "")
|
||||
foreach(module ${OPENCV_JAVA_MODULES})
|
||||
# first run of gen_java.py (to get list of generated files)
|
||||
file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/gen_java_out/")
|
||||
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/gen_java_out")
|
||||
execute_process(COMMAND ${PYTHON_DEFAULT_EXECUTABLE} "${scripts_gen_java}" "${scripts_hdr_parser}" ${module} ${opencv_public_headers_${module}}
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/gen_java_out"
|
||||
OUTPUT_QUIET ERROR_QUIET)
|
||||
unset(generated_java_sources_${module})
|
||||
file(GLOB_RECURSE generated_java_sources_${module} RELATIVE "${CMAKE_CURRENT_BINARY_DIR}/gen_java_out/" "${CMAKE_CURRENT_BINARY_DIR}/gen_java_out/*.java")
|
||||
ocv_list_add_prefix(generated_java_sources_${module} "${CMAKE_CURRENT_BINARY_DIR}/")
|
||||
|
||||
list(APPEND generated_java_sources ${generated_java_sources_${module}})
|
||||
endforeach()
|
||||
add_cmake_dependencies(${scripts_gen_java} ${scripts_hdr_parser} ${opencv_public_headers})
|
||||
|
||||
######################################################################################################################################
|
||||
|
||||
@@ -116,19 +196,20 @@ foreach(module ${OPENCV_JAVA_MODULES})
|
||||
)
|
||||
endforeach()
|
||||
|
||||
# step 2: TODO: generate documentation somewhere
|
||||
|
||||
# step 3: copy files to destination
|
||||
set(step3_input_files ${generated_java_sources} ${handwrittren_java_sources} ${handwrittren_aidl_sources})
|
||||
set(step3_input_files ${generated_java_sources} ${handwritten_java_sources} ${handwritten_aidl_sources})
|
||||
set(copied_files "")
|
||||
foreach(java_file ${step3_input_files})
|
||||
get_filename_component(java_file_name "${java_file}" NAME)
|
||||
string(REPLACE "-jdoc.java" ".java" java_file_name "${java_file_name}")
|
||||
string(REPLACE "+" "/" java_file_name "${java_file_name}")
|
||||
set(output_name "${OpenCV_BINARY_DIR}/src/org/opencv/${java_file_name}")
|
||||
|
||||
add_custom_command(OUTPUT "${output_name}"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy "${java_file}" "${output_name}"
|
||||
MAIN_DEPENDENCY "${java_file}"
|
||||
DEPENDS ${step1_depends} ${generated_java_sources} ${handwrittren_java_sources}
|
||||
DEPENDS ${step1_depends} ${generated_java_sources} ${handwritten_java_sources}
|
||||
COMMENT "Generating src/org/opencv/${java_file_name}"
|
||||
)
|
||||
list(APPEND copied_files "${output_name}")
|
||||
@@ -154,7 +235,7 @@ if(ANDROID)
|
||||
endforeach()
|
||||
|
||||
# library project jni sources (nothing really depends on them so we will not add them to step3_input_files)
|
||||
foreach(jni_file ${handwrittren_cpp_sources} ${handwrittren_h_sources} ${generated_cpp_sources})
|
||||
foreach(jni_file ${handwritten_cpp_sources} ${handwritten_h_sources} ${generated_cpp_sources})
|
||||
get_filename_component(jni_file_name "${jni_file}" NAME)
|
||||
add_custom_command(OUTPUT "${OpenCV_BINARY_DIR}/jni/${jni_file_name}"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy "${jni_file}" "${OpenCV_BINARY_DIR}/jni/${jni_file_name}"
|
||||
@@ -250,7 +331,7 @@ endif(ANDROID)
|
||||
# workarounding lack of `__attribute__ ((visibility("default")))` in jni_md.h/JNIEXPORT
|
||||
string(REPLACE "-fvisibility=hidden" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
|
||||
ocv_add_library(${the_module} SHARED ${handwrittren_h_sources} ${handwrittren_cpp_sources} ${generated_cpp_sources}
|
||||
ocv_add_library(${the_module} SHARED ${handwritten_h_sources} ${handwritten_cpp_sources} ${generated_cpp_sources}
|
||||
${copied_files}
|
||||
"${JAR_FILE}" "${JAR_FILE}.dephelper")
|
||||
|
||||
@@ -332,6 +413,6 @@ if(BUILD_TESTS)
|
||||
if(ANDROID)
|
||||
add_subdirectory(android_test)
|
||||
else()
|
||||
add_subdirectory(test)
|
||||
add_subdirectory(pure_test)
|
||||
endif()
|
||||
endif()
|
||||
|
@@ -1,34 +1,30 @@
|
||||
# list of modules covered with tests
|
||||
set(tested_modules opencv_calib3d opencv_core opencv_features2d opencv_highgui opencv_imgproc opencv_objdetect opencv_photo opencv_video)
|
||||
|
||||
# opencv_ml is broken
|
||||
#list(APPEND tested_modules opencv_ml)
|
||||
|
||||
ocv_check_dependencies(opencv_java ${tested_modules})
|
||||
|
||||
if(NOT OCV_DEPENDENCIES_FOUND OR NOT ANT_EXECUTABLE OR NOT ANDROID_EXECUTABLE OR NOT ANDROID_TOOLS_Pkg_Revision GREATER 13)
|
||||
if(NOT ANT_EXECUTABLE OR NOT ANDROID_EXECUTABLE OR NOT ANDROID_TOOLS_Pkg_Revision GREATER 13)
|
||||
return()
|
||||
endif()
|
||||
|
||||
project(opencv_test_java)
|
||||
|
||||
set(opencv_test_java_bin_dir "${CMAKE_CURRENT_BINARY_DIR}/.build")
|
||||
set(test_dir "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
set(test_common_dir "${CMAKE_CURRENT_SOURCE_DIR}/../common_test")
|
||||
|
||||
# get project sources
|
||||
file(GLOB_RECURSE opencv_test_java_files RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/res/*" "${CMAKE_CURRENT_SOURCE_DIR}/src/*")
|
||||
ocv_list_filterout(opencv_test_java_files ".svn")
|
||||
# opencv_ml is broken
|
||||
ocv_list_filterout(opencv_test_java_files "/ml/")
|
||||
|
||||
# copy sources out from the build tree
|
||||
set(opencv_test_java_file_deps "")
|
||||
foreach(f ${opencv_test_java_files} ${ANDROID_MANIFEST_FILE} ".classpath" ".project")
|
||||
|
||||
# 1. gather and copy common test files (resources, utils, etc.)
|
||||
copy_common_tests(test_common_dir opencv_test_java_bin_dir opencv_test_java_file_deps)
|
||||
|
||||
# 2. gather and copy tests from each module
|
||||
copy_modules_tests(OPENCV_JAVA_MODULES opencv_test_java_bin_dir opencv_test_java_file_deps)
|
||||
|
||||
# 3. gather and copy specific files for Android
|
||||
file(GLOB_RECURSE test_files RELATIVE "${test_dir}" "${test_dir}/res/*" "${test_dir}/src/*")
|
||||
foreach(f ${test_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}"
|
||||
MAIN_DEPENDENCY "${CMAKE_CURRENT_SOURCE_DIR}/${f}"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy "${test_dir}/${f}" "${opencv_test_java_bin_dir}/${f}"
|
||||
MAIN_DEPENDENCY "${test_dir}/${f}"
|
||||
COMMENT "Copying ${f}")
|
||||
list(APPEND opencv_test_java_file_deps "${CMAKE_CURRENT_SOURCE_DIR}/${f}" "${opencv_test_java_bin_dir}/${f}")
|
||||
list(APPEND opencv_test_java_file_deps "${test_dir}/${f}" "${opencv_test_java_bin_dir}/${f}")
|
||||
endforeach()
|
||||
|
||||
# fix Android project
|
||||
|
@@ -1,603 +0,0 @@
|
||||
package org.opencv.test.calib3d;
|
||||
|
||||
import org.opencv.calib3d.Calib3d;
|
||||
import org.opencv.core.Core;
|
||||
import org.opencv.core.CvType;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.MatOfDouble;
|
||||
import org.opencv.core.MatOfPoint2f;
|
||||
import org.opencv.core.MatOfPoint3f;
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.Scalar;
|
||||
import org.opencv.core.Size;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
import org.opencv.imgproc.Imgproc;
|
||||
|
||||
public class Calib3dTest extends OpenCVTestCase {
|
||||
|
||||
public void testCalibrateCameraListOfMatListOfMatSizeMatMatListOfMatListOfMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testCalibrateCameraListOfMatListOfMatSizeMatMatListOfMatListOfMatInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testCalibrationMatrixValues() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testComposeRTMatMatMatMatMatMat() {
|
||||
Mat rvec1 = new Mat(3, 1, CvType.CV_32F);
|
||||
rvec1.put(0, 0, 0.5302828, 0.19925919, 0.40105945);
|
||||
Mat tvec1 = new Mat(3, 1, CvType.CV_32F);
|
||||
tvec1.put(0, 0, 0.81438506, 0.43713298, 0.2487897);
|
||||
Mat rvec2 = new Mat(3, 1, CvType.CV_32F);
|
||||
rvec2.put(0, 0, 0.77310503, 0.76209372, 0.30779448);
|
||||
Mat tvec2 = new Mat(3, 1, CvType.CV_32F);
|
||||
tvec2.put(0, 0, 0.70243168, 0.4784472, 0.79219002);
|
||||
|
||||
Mat rvec3 = new Mat();
|
||||
Mat tvec3 = new Mat();
|
||||
|
||||
Mat outRvec = new Mat(3, 1, CvType.CV_32F);
|
||||
outRvec.put(0, 0, 1.418641, 0.88665926, 0.56020796);
|
||||
Mat outTvec = new Mat(3, 1, CvType.CV_32F);
|
||||
outTvec.put(0, 0, 1.4560841, 1.0680628, 0.81598103);
|
||||
|
||||
Calib3d.composeRT(rvec1, tvec1, rvec2, tvec2, rvec3, tvec3);
|
||||
|
||||
assertMatEqual(outRvec, rvec3, EPS);
|
||||
assertMatEqual(outTvec, tvec3, EPS);
|
||||
}
|
||||
|
||||
public void testComposeRTMatMatMatMatMatMatMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testComposeRTMatMatMatMatMatMatMatMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testComposeRTMatMatMatMatMatMatMatMatMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testComposeRTMatMatMatMatMatMatMatMatMatMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testComposeRTMatMatMatMatMatMatMatMatMatMatMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testComposeRTMatMatMatMatMatMatMatMatMatMatMatMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testComposeRTMatMatMatMatMatMatMatMatMatMatMatMatMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testComposeRTMatMatMatMatMatMatMatMatMatMatMatMatMatMat() {
|
||||
fail("Not yet implemented");
|
||||
// Mat dr3dr1;
|
||||
// Mat dr3dt1;
|
||||
// Mat dr3dr2;
|
||||
// Mat dr3dt2;
|
||||
// Mat dt3dr1;
|
||||
// Mat dt3dt1;
|
||||
// Mat dt3dr2;
|
||||
// Mat dt3dt2;
|
||||
// , dr3dr1, dr3dt1, dr3dr2, dr3dt2, dt3dr1, dt3dt1, dt3dr2, dt3dt2);
|
||||
// [0.97031879, -0.091774099, 0.38594806;
|
||||
// 0.15181915, 0.98091727, -0.44186208;
|
||||
// -0.39509675, 0.43839464, 0.93872648]
|
||||
// [0, 0, 0;
|
||||
// 0, 0, 0;
|
||||
// 0, 0, 0]
|
||||
// [1.0117353, 0.16348237, -0.083180845;
|
||||
// -0.1980398, 1.006078, 0.30299222;
|
||||
// 0.075766489, -0.32784501, 1.0163091]
|
||||
// [0, 0, 0;
|
||||
// 0, 0, 0;
|
||||
// 0, 0, 0]
|
||||
// [0, 0, 0;
|
||||
// 0, 0, 0;
|
||||
// 0, 0, 0]
|
||||
// [0.69658804, 0.018115902, 0.7172426;
|
||||
// 0.51114357, 0.68899536, -0.51382649;
|
||||
// -0.50348526, 0.72453934, 0.47068608]
|
||||
// [0.18536358, -0.20515044, -0.48834875;
|
||||
// -0.25120571, 0.29043972, 0.60573936;
|
||||
// 0.35370794, -0.69923931, 0.45781645]
|
||||
// [1, 0, 0;
|
||||
// 0, 1, 0;
|
||||
// 0, 0, 1]
|
||||
}
|
||||
|
||||
public void testConvertPointsFromHomogeneous() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testConvertPointsToHomogeneous() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDecomposeProjectionMatrixMatMatMatMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDecomposeProjectionMatrixMatMatMatMatMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDecomposeProjectionMatrixMatMatMatMatMatMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDecomposeProjectionMatrixMatMatMatMatMatMatMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDecomposeProjectionMatrixMatMatMatMatMatMatMatMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDrawChessboardCorners() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testEstimateAffine3DMatMatMatMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testEstimateAffine3DMatMatMatMatDouble() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testEstimateAffine3DMatMatMatMatDoubleDouble() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testFilterSpecklesMatDoubleIntDouble() {
|
||||
gray_16s_1024.copyTo(dst);
|
||||
Point center = new Point(gray_16s_1024.rows() / 2., gray_16s_1024.cols() / 2.);
|
||||
Imgproc.circle(dst, center, 1, Scalar.all(4096));
|
||||
|
||||
assertMatNotEqual(gray_16s_1024, dst);
|
||||
Calib3d.filterSpeckles(dst, 1024.0, 100, 0.);
|
||||
assertMatEqual(gray_16s_1024, dst);
|
||||
}
|
||||
|
||||
public void testFilterSpecklesMatDoubleIntDoubleMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testFindChessboardCornersMatSizeMat() {
|
||||
Size patternSize = new Size(9, 6);
|
||||
MatOfPoint2f corners = new MatOfPoint2f();
|
||||
Calib3d.findChessboardCorners(grayChess, patternSize, corners);
|
||||
assertTrue(!corners.empty());
|
||||
}
|
||||
|
||||
public void testFindChessboardCornersMatSizeMatInt() {
|
||||
Size patternSize = new Size(9, 6);
|
||||
MatOfPoint2f corners = new MatOfPoint2f();
|
||||
Calib3d.findChessboardCorners(grayChess, patternSize, corners, Calib3d.CALIB_CB_ADAPTIVE_THRESH + Calib3d.CALIB_CB_NORMALIZE_IMAGE
|
||||
+ Calib3d.CALIB_CB_FAST_CHECK);
|
||||
assertTrue(!corners.empty());
|
||||
}
|
||||
|
||||
public void testFindCirclesGridMatSizeMat() {
|
||||
int size = 300;
|
||||
Mat img = new Mat(size, size, CvType.CV_8U);
|
||||
img.setTo(new Scalar(255));
|
||||
Mat centers = new Mat();
|
||||
|
||||
assertFalse(Calib3d.findCirclesGrid(img, new Size(5, 5), centers));
|
||||
|
||||
for (int i = 0; i < 5; i++)
|
||||
for (int j = 0; j < 5; j++) {
|
||||
Point pt = new Point(size * (2 * i + 1) / 10, size * (2 * j + 1) / 10);
|
||||
Imgproc.circle(img, pt, 10, new Scalar(0), -1);
|
||||
}
|
||||
|
||||
assertTrue(Calib3d.findCirclesGrid(img, new Size(5, 5), centers));
|
||||
|
||||
assertEquals(25, centers.rows());
|
||||
assertEquals(1, centers.cols());
|
||||
assertEquals(CvType.CV_32FC2, centers.type());
|
||||
}
|
||||
|
||||
public void testFindCirclesGridMatSizeMatInt() {
|
||||
int size = 300;
|
||||
Mat img = new Mat(size, size, CvType.CV_8U);
|
||||
img.setTo(new Scalar(255));
|
||||
Mat centers = new Mat();
|
||||
|
||||
assertFalse(Calib3d.findCirclesGrid(img, new Size(3, 5), centers, Calib3d.CALIB_CB_CLUSTERING
|
||||
| Calib3d.CALIB_CB_ASYMMETRIC_GRID));
|
||||
|
||||
int step = size * 2 / 15;
|
||||
int offsetx = size / 6;
|
||||
int offsety = (size - 4 * step) / 2;
|
||||
for (int i = 0; i < 3; i++)
|
||||
for (int j = 0; j < 5; j++) {
|
||||
Point pt = new Point(offsetx + (2 * i + j % 2) * step, offsety + step * j);
|
||||
Imgproc.circle(img, pt, 10, new Scalar(0), -1);
|
||||
}
|
||||
|
||||
assertTrue(Calib3d.findCirclesGrid(img, new Size(3, 5), centers, Calib3d.CALIB_CB_CLUSTERING
|
||||
| Calib3d.CALIB_CB_ASYMMETRIC_GRID));
|
||||
|
||||
assertEquals(15, centers.rows());
|
||||
assertEquals(1, centers.cols());
|
||||
assertEquals(CvType.CV_32FC2, centers.type());
|
||||
}
|
||||
|
||||
public void testFindFundamentalMatListOfPointListOfPoint() {
|
||||
int minFundamentalMatPoints = 8;
|
||||
|
||||
MatOfPoint2f pts = new MatOfPoint2f();
|
||||
pts.alloc(minFundamentalMatPoints);
|
||||
|
||||
for (int i = 0; i < minFundamentalMatPoints; i++) {
|
||||
double x = Math.random() * 100 - 50;
|
||||
double y = Math.random() * 100 - 50;
|
||||
pts.put(i, 0, x, y); //add(new Point(x, y));
|
||||
}
|
||||
|
||||
Mat fm = Calib3d.findFundamentalMat(pts, pts);
|
||||
|
||||
truth = new Mat(3, 3, CvType.CV_64F);
|
||||
truth.put(0, 0, 0, -0.577, 0.288, 0.577, 0, 0.288, -0.288, -0.288, 0);
|
||||
assertMatEqual(truth, fm, EPS);
|
||||
}
|
||||
|
||||
public void testFindFundamentalMatListOfPointListOfPointInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testFindFundamentalMatListOfPointListOfPointIntDouble() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testFindFundamentalMatListOfPointListOfPointIntDoubleDouble() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testFindFundamentalMatListOfPointListOfPointIntDoubleDoubleMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testFindHomographyListOfPointListOfPoint() {
|
||||
final int NUM = 20;
|
||||
|
||||
MatOfPoint2f originalPoints = new MatOfPoint2f();
|
||||
originalPoints.alloc(NUM);
|
||||
MatOfPoint2f transformedPoints = new MatOfPoint2f();
|
||||
transformedPoints.alloc(NUM);
|
||||
|
||||
for (int i = 0; i < NUM; i++) {
|
||||
double x = Math.random() * 100 - 50;
|
||||
double y = Math.random() * 100 - 50;
|
||||
originalPoints.put(i, 0, x, y);
|
||||
transformedPoints.put(i, 0, y, x);
|
||||
}
|
||||
|
||||
Mat hmg = Calib3d.findHomography(originalPoints, transformedPoints);
|
||||
|
||||
truth = new Mat(3, 3, CvType.CV_64F);
|
||||
truth.put(0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1);
|
||||
|
||||
assertMatEqual(truth, hmg, EPS);
|
||||
}
|
||||
|
||||
public void testFindHomographyListOfPointListOfPointInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testFindHomographyListOfPointListOfPointIntDouble() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testFindHomographyListOfPointListOfPointIntDoubleMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGetOptimalNewCameraMatrixMatMatSizeDouble() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGetOptimalNewCameraMatrixMatMatSizeDoubleSize() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGetOptimalNewCameraMatrixMatMatSizeDoubleSizeRect() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGetOptimalNewCameraMatrixMatMatSizeDoubleSizeRectBoolean() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGetValidDisparityROI() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testInitCameraMatrix2DListOfMatListOfMatSize() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testInitCameraMatrix2DListOfMatListOfMatSizeDouble() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testMatMulDeriv() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testProjectPointsMatMatMatMatMatMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testProjectPointsMatMatMatMatMatMatMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testProjectPointsMatMatMatMatMatMatMatDouble() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testRectify3Collinear() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testReprojectImageTo3DMatMatMat() {
|
||||
Mat transformMatrix = new Mat(4, 4, CvType.CV_64F);
|
||||
transformMatrix.put(0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
|
||||
|
||||
Mat disparity = new Mat(matSize, matSize, CvType.CV_32F);
|
||||
|
||||
float[] disp = new float[matSize * matSize];
|
||||
for (int i = 0; i < matSize; i++)
|
||||
for (int j = 0; j < matSize; j++)
|
||||
disp[i * matSize + j] = i - j;
|
||||
disparity.put(0, 0, disp);
|
||||
|
||||
Mat _3dPoints = new Mat();
|
||||
|
||||
Calib3d.reprojectImageTo3D(disparity, _3dPoints, transformMatrix);
|
||||
|
||||
assertEquals(CvType.CV_32FC3, _3dPoints.type());
|
||||
assertEquals(matSize, _3dPoints.rows());
|
||||
assertEquals(matSize, _3dPoints.cols());
|
||||
|
||||
truth = new Mat(matSize, matSize, CvType.CV_32FC3);
|
||||
|
||||
float[] _truth = new float[matSize * matSize * 3];
|
||||
for (int i = 0; i < matSize; i++)
|
||||
for (int j = 0; j < matSize; j++) {
|
||||
_truth[(i * matSize + j) * 3 + 0] = i;
|
||||
_truth[(i * matSize + j) * 3 + 1] = j;
|
||||
_truth[(i * matSize + j) * 3 + 2] = i - j;
|
||||
}
|
||||
truth.put(0, 0, _truth);
|
||||
|
||||
assertMatEqual(truth, _3dPoints, EPS);
|
||||
}
|
||||
|
||||
public void testReprojectImageTo3DMatMatMatBoolean() {
|
||||
Mat transformMatrix = new Mat(4, 4, CvType.CV_64F);
|
||||
transformMatrix.put(0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
|
||||
|
||||
Mat disparity = new Mat(matSize, matSize, CvType.CV_32F);
|
||||
|
||||
float[] disp = new float[matSize * matSize];
|
||||
for (int i = 0; i < matSize; i++)
|
||||
for (int j = 0; j < matSize; j++)
|
||||
disp[i * matSize + j] = i - j;
|
||||
disp[0] = -Float.MAX_VALUE;
|
||||
disparity.put(0, 0, disp);
|
||||
|
||||
Mat _3dPoints = new Mat();
|
||||
|
||||
Calib3d.reprojectImageTo3D(disparity, _3dPoints, transformMatrix, true);
|
||||
|
||||
assertEquals(CvType.CV_32FC3, _3dPoints.type());
|
||||
assertEquals(matSize, _3dPoints.rows());
|
||||
assertEquals(matSize, _3dPoints.cols());
|
||||
|
||||
truth = new Mat(matSize, matSize, CvType.CV_32FC3);
|
||||
|
||||
float[] _truth = new float[matSize * matSize * 3];
|
||||
for (int i = 0; i < matSize; i++)
|
||||
for (int j = 0; j < matSize; j++) {
|
||||
_truth[(i * matSize + j) * 3 + 0] = i;
|
||||
_truth[(i * matSize + j) * 3 + 1] = j;
|
||||
_truth[(i * matSize + j) * 3 + 2] = i - j;
|
||||
}
|
||||
_truth[2] = 10000;
|
||||
truth.put(0, 0, _truth);
|
||||
|
||||
assertMatEqual(truth, _3dPoints, EPS);
|
||||
}
|
||||
|
||||
public void testReprojectImageTo3DMatMatMatBooleanInt() {
|
||||
Mat transformMatrix = new Mat(4, 4, CvType.CV_64F);
|
||||
transformMatrix.put(0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
|
||||
|
||||
Mat disparity = new Mat(matSize, matSize, CvType.CV_32F);
|
||||
|
||||
float[] disp = new float[matSize * matSize];
|
||||
for (int i = 0; i < matSize; i++)
|
||||
for (int j = 0; j < matSize; j++)
|
||||
disp[i * matSize + j] = i - j;
|
||||
disparity.put(0, 0, disp);
|
||||
|
||||
Mat _3dPoints = new Mat();
|
||||
|
||||
Calib3d.reprojectImageTo3D(disparity, _3dPoints, transformMatrix, false, CvType.CV_16S);
|
||||
|
||||
assertEquals(CvType.CV_16SC3, _3dPoints.type());
|
||||
assertEquals(matSize, _3dPoints.rows());
|
||||
assertEquals(matSize, _3dPoints.cols());
|
||||
|
||||
truth = new Mat(matSize, matSize, CvType.CV_16SC3);
|
||||
|
||||
short[] _truth = new short[matSize * matSize * 3];
|
||||
for (short i = 0; i < matSize; i++)
|
||||
for (short j = 0; j < matSize; j++) {
|
||||
_truth[(i * matSize + j) * 3 + 0] = i;
|
||||
_truth[(i * matSize + j) * 3 + 1] = j;
|
||||
_truth[(i * matSize + j) * 3 + 2] = (short) (i - j);
|
||||
}
|
||||
truth.put(0, 0, _truth);
|
||||
|
||||
assertMatEqual(truth, _3dPoints, EPS);
|
||||
}
|
||||
|
||||
public void testRodriguesMatMat() {
|
||||
Mat r = new Mat(3, 1, CvType.CV_32F);
|
||||
Mat R = new Mat(3, 3, CvType.CV_32F);
|
||||
|
||||
r.put(0, 0, Math.PI, 0, 0);
|
||||
|
||||
Calib3d.Rodrigues(r, R);
|
||||
|
||||
truth = new Mat(3, 3, CvType.CV_32F);
|
||||
truth.put(0, 0, 1, 0, 0, 0, -1, 0, 0, 0, -1);
|
||||
assertMatEqual(truth, R, EPS);
|
||||
|
||||
Mat r2 = new Mat();
|
||||
Calib3d.Rodrigues(R, r2);
|
||||
|
||||
assertMatEqual(r, r2, EPS);
|
||||
}
|
||||
|
||||
public void testRodriguesMatMatMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testRQDecomp3x3MatMatMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testRQDecomp3x3MatMatMatMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testRQDecomp3x3MatMatMatMatMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testRQDecomp3x3MatMatMatMatMatMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSolvePnPListOfPoint3ListOfPointMatMatMatMat() {
|
||||
Mat intrinsics = Mat.eye(3, 3, CvType.CV_32F);
|
||||
intrinsics.put(0, 0, 400);
|
||||
intrinsics.put(1, 1, 400);
|
||||
intrinsics.put(0, 2, 640 / 2);
|
||||
intrinsics.put(1, 2, 480 / 2);
|
||||
|
||||
final int minPnpPointsNum = 4;
|
||||
|
||||
MatOfPoint3f points3d = new MatOfPoint3f();
|
||||
points3d.alloc(minPnpPointsNum);
|
||||
MatOfPoint2f points2d = new MatOfPoint2f();
|
||||
points2d.alloc(minPnpPointsNum);
|
||||
|
||||
for (int i = 0; i < minPnpPointsNum; i++) {
|
||||
double x = Math.random() * 100 - 50;
|
||||
double y = Math.random() * 100 - 50;
|
||||
points2d.put(i, 0, x, y); //add(new Point(x, y));
|
||||
points3d.put(i, 0, 0, y, x); // add(new Point3(0, y, x));
|
||||
}
|
||||
|
||||
Mat rvec = new Mat();
|
||||
Mat tvec = new Mat();
|
||||
Calib3d.solvePnP(points3d, points2d, intrinsics, new MatOfDouble(), rvec, tvec);
|
||||
|
||||
Mat truth_rvec = new Mat(3, 1, CvType.CV_64F);
|
||||
truth_rvec.put(0, 0, 0, Math.PI / 2, 0);
|
||||
|
||||
Mat truth_tvec = new Mat(3, 1, CvType.CV_64F);
|
||||
truth_tvec.put(0, 0, -320, -240, 400);
|
||||
|
||||
assertMatEqual(truth_rvec, rvec, EPS);
|
||||
assertMatEqual(truth_tvec, tvec, EPS);
|
||||
}
|
||||
|
||||
public void testSolvePnPListOfPoint3ListOfPointMatMatMatMatBoolean() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSolvePnPRansacListOfPoint3ListOfPointMatMatMatMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSolvePnPRansacListOfPoint3ListOfPointMatMatMatMatBoolean() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSolvePnPRansacListOfPoint3ListOfPointMatMatMatMatBooleanInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSolvePnPRansacListOfPoint3ListOfPointMatMatMatMatBooleanIntFloat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSolvePnPRansacListOfPoint3ListOfPointMatMatMatMatBooleanIntFloatInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSolvePnPRansacListOfPoint3ListOfPointMatMatMatMatBooleanIntFloatIntMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testStereoCalibrateListOfMatListOfMatListOfMatMatMatMatMatSizeMatMatMatMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testStereoCalibrateListOfMatListOfMatListOfMatMatMatMatMatSizeMatMatMatMatTermCriteria() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testStereoCalibrateListOfMatListOfMatListOfMatMatMatMatMatSizeMatMatMatMatTermCriteriaInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testStereoRectifyUncalibratedMatMatMatSizeMatMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testStereoRectifyUncalibratedMatMatMatSizeMatMatDouble() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testValidateDisparityMatMatIntInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testValidateDisparityMatMatIntIntInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testComputeCorrespondEpilines()
|
||||
{
|
||||
Mat fundamental = new Mat(3, 3, CvType.CV_64F);
|
||||
fundamental.put(0, 0, 0, -0.577, 0.288, 0.577, 0, 0.288, -0.288, -0.288, 0);
|
||||
MatOfPoint2f left = new MatOfPoint2f();
|
||||
left.alloc(1);
|
||||
left.put(0, 0, 2, 3); //add(new Point(x, y));
|
||||
Mat lines = new Mat();
|
||||
Mat truth = new Mat(1, 1, CvType.CV_32FC3);
|
||||
truth.put(0, 0, -0.70735186, 0.70686162, -0.70588124);
|
||||
Calib3d.computeCorrespondEpilines(left, 1, fundamental, lines);
|
||||
assertMatEqual(truth, lines, EPS);
|
||||
}
|
||||
}
|
@@ -1,31 +0,0 @@
|
||||
package org.opencv.test.calib3d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class StereoBMTest extends OpenCVTestCase {
|
||||
|
||||
public void testComputeMatMatMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testComputeMatMatMatInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testStereoBM() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testStereoBMInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testStereoBMIntInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testStereoBMIntIntInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
}
|
@@ -1,139 +0,0 @@
|
||||
package org.opencv.test.calib3d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class StereoSGBMTest extends OpenCVTestCase {
|
||||
|
||||
public void testCompute() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_disp12MaxDiff() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_fullDP() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_minDisparity() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_numberOfDisparities() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_P1() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_P2() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_preFilterCap() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_SADWindowSize() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_speckleRange() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_speckleWindowSize() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_uniquenessRatio() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_disp12MaxDiff() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_fullDP() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_minDisparity() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_numberOfDisparities() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_P1() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_P2() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_preFilterCap() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_SADWindowSize() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_speckleRange() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_speckleWindowSize() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_uniquenessRatio() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testStereoSGBM() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testStereoSGBMIntIntInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testStereoSGBMIntIntIntInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testStereoSGBMIntIntIntIntInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testStereoSGBMIntIntIntIntIntInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testStereoSGBMIntIntIntIntIntIntInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testStereoSGBMIntIntIntIntIntIntIntInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testStereoSGBMIntIntIntIntIntIntIntIntInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testStereoSGBMIntIntIntIntIntIntIntIntIntInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testStereoSGBMIntIntIntIntIntIntIntIntIntIntBoolean() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@@ -1,63 +0,0 @@
|
||||
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)));
|
||||
}
|
||||
|
||||
}
|
@@ -1,44 +0,0 @@
|
||||
package org.opencv.test.core;
|
||||
|
||||
import org.opencv.core.DMatch;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
public class DMatchTest extends TestCase {
|
||||
public void testDMatch() {
|
||||
new DMatch();
|
||||
}
|
||||
|
||||
public void testDMatchIntIntFloat() {
|
||||
DMatch dm1 = new DMatch(1, 4, 4.0f);
|
||||
|
||||
assertEquals(1, dm1.queryIdx);
|
||||
assertEquals(4, dm1.trainIdx);
|
||||
assertEquals(4.0f, dm1.distance);
|
||||
}
|
||||
|
||||
public void testDMatchIntIntIntFloat() {
|
||||
DMatch dm2 = new DMatch(2, 6, -1, 8.0f);
|
||||
|
||||
assertEquals(2, dm2.queryIdx);
|
||||
assertEquals(6, dm2.trainIdx);
|
||||
assertEquals(-1, dm2.imgIdx);
|
||||
assertEquals(8.0f, dm2.distance);
|
||||
}
|
||||
|
||||
public void testLessThan() {
|
||||
DMatch dm1 = new DMatch(1, 4, 4.0f);
|
||||
DMatch dm2 = new DMatch(2, 6, -1, 8.0f);
|
||||
assertTrue(dm1.lessThan(dm2));
|
||||
}
|
||||
|
||||
public void testToString() {
|
||||
DMatch dm2 = new DMatch(2, 6, -1, 8.0f);
|
||||
|
||||
String actual = dm2.toString();
|
||||
|
||||
String expected = "DMatch [queryIdx=2, trainIdx=6, imgIdx=-1, distance=8.0]";
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
}
|
@@ -1,71 +0,0 @@
|
||||
package org.opencv.test.core;
|
||||
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.KeyPoint;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class KeyPointTest extends OpenCVTestCase {
|
||||
|
||||
private float angle;
|
||||
private int classId;
|
||||
private KeyPoint keyPoint;
|
||||
private int octave;
|
||||
private float response;
|
||||
private float size;
|
||||
private float x;
|
||||
private float y;
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
keyPoint = null;
|
||||
x = 1.0f;
|
||||
y = 2.0f;
|
||||
size = 3.0f;
|
||||
angle = 30.0f;
|
||||
response = 2.0f;
|
||||
octave = 1;
|
||||
classId = 1;
|
||||
}
|
||||
|
||||
public void testKeyPoint() {
|
||||
keyPoint = new KeyPoint();
|
||||
assertPointEquals(new Point(0, 0), keyPoint.pt, EPS);
|
||||
}
|
||||
|
||||
public void testKeyPointFloatFloatFloat() {
|
||||
keyPoint = new KeyPoint(x, y, size);
|
||||
assertPointEquals(new Point(1, 2), keyPoint.pt, EPS);
|
||||
}
|
||||
|
||||
public void testKeyPointFloatFloatFloatFloat() {
|
||||
keyPoint = new KeyPoint(x, y, size, 10.0f);
|
||||
assertEquals(10.0f, keyPoint.angle);
|
||||
}
|
||||
|
||||
public void testKeyPointFloatFloatFloatFloatFloat() {
|
||||
keyPoint = new KeyPoint(x, y, size, 1.0f, 1.0f);
|
||||
assertEquals(1.0f, keyPoint.response);
|
||||
}
|
||||
|
||||
public void testKeyPointFloatFloatFloatFloatFloatInt() {
|
||||
keyPoint = new KeyPoint(x, y, size, 1.0f, 1.0f, 1);
|
||||
assertEquals(1, keyPoint.octave);
|
||||
}
|
||||
|
||||
public void testKeyPointFloatFloatFloatFloatFloatIntInt() {
|
||||
keyPoint = new KeyPoint(x, y, size, 1.0f, 1.0f, 1, 1);
|
||||
assertEquals(1, keyPoint.class_id);
|
||||
}
|
||||
|
||||
public void testToString() {
|
||||
keyPoint = new KeyPoint(x, y, size, angle, response, octave, classId);
|
||||
|
||||
String actual = keyPoint.toString();
|
||||
|
||||
String expected = "KeyPoint [pt={1.0, 2.0}, size=3.0, angle=30.0, response=2.0, octave=1, class_id=1]";
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@@ -1,107 +0,0 @@
|
||||
package org.opencv.test.core;
|
||||
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.Point3;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class Point3Test extends OpenCVTestCase {
|
||||
|
||||
private Point3 p1;
|
||||
private Point3 p2;
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
p1 = new Point3(2, 2, 2);
|
||||
p2 = new Point3(1, 1, 1);
|
||||
}
|
||||
|
||||
public void testClone() {
|
||||
Point3 truth = new Point3(1, 1, 1);
|
||||
p1 = truth.clone();
|
||||
assertEquals(truth, p1);
|
||||
}
|
||||
|
||||
public void testCross() {
|
||||
Point3 dstPoint = p1.cross(p2);
|
||||
Point3 truth = new Point3(0, 0, 0);
|
||||
assertEquals(truth, dstPoint);
|
||||
}
|
||||
|
||||
public void testDot() {
|
||||
double result = p1.dot(p2);
|
||||
assertEquals(6.0, result);
|
||||
}
|
||||
|
||||
public void testEqualsObject() {
|
||||
boolean flag = p1.equals(p1);
|
||||
assertTrue(flag);
|
||||
|
||||
flag = p1.equals(p2);
|
||||
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);
|
||||
assertTrue(0 == p1.z);
|
||||
}
|
||||
|
||||
public void testPoint3DoubleArray() {
|
||||
double[] vals = { 1, 2, 3 };
|
||||
p1 = new Point3(vals);
|
||||
|
||||
assertTrue(1 == p1.x);
|
||||
assertTrue(2 == p1.y);
|
||||
assertTrue(3 == p1.z);
|
||||
}
|
||||
|
||||
public void testPoint3DoubleDoubleDouble() {
|
||||
p1 = new Point3(1, 2, 3);
|
||||
|
||||
assertEquals(1., p1.x);
|
||||
assertEquals(2., p1.y);
|
||||
assertEquals(3., p1.z);
|
||||
}
|
||||
|
||||
public void testPoint3Point() {
|
||||
Point p = new Point(2, 3);
|
||||
p1 = new Point3(p);
|
||||
|
||||
assertEquals(2., p1.x);
|
||||
assertEquals(3., p1.y);
|
||||
assertEquals(0., p1.z);
|
||||
}
|
||||
|
||||
public void testSet() {
|
||||
double[] vals1 = {};
|
||||
p1.set(vals1);
|
||||
|
||||
assertEquals(0., p1.x);
|
||||
assertEquals(0., p1.y);
|
||||
assertEquals(0., p1.z);
|
||||
|
||||
double[] vals2 = { 3, 6, 10 };
|
||||
p1.set(vals2);
|
||||
|
||||
assertEquals(3., p1.x);
|
||||
assertEquals(6., p1.y);
|
||||
assertEquals(10., p1.z);
|
||||
}
|
||||
|
||||
public void testToString() {
|
||||
String actual = p1.toString();
|
||||
String expected = "{2.0, 2.0, 2.0}";
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -1,93 +0,0 @@
|
||||
package org.opencv.test.core;
|
||||
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.Rect;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class PointTest extends OpenCVTestCase {
|
||||
|
||||
private Point p1;
|
||||
private Point p2;
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
p1 = new Point(2, 2);
|
||||
p2 = new Point(1, 1);
|
||||
}
|
||||
|
||||
public void testClone() {
|
||||
Point truth = new Point(1, 1);
|
||||
Point dstPoint = truth.clone();
|
||||
assertEquals(truth, dstPoint);
|
||||
}
|
||||
|
||||
public void testDot() {
|
||||
double result = p1.dot(p2);
|
||||
assertEquals(4.0, result);
|
||||
}
|
||||
|
||||
public void testEqualsObject() {
|
||||
boolean flag = p1.equals(p1);
|
||||
assertTrue(flag);
|
||||
|
||||
flag = p1.equals(p2);
|
||||
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));
|
||||
|
||||
Point p2 = new Point(3, 3);
|
||||
assertFalse(p2.inside(rect));
|
||||
}
|
||||
|
||||
public void testPoint() {
|
||||
Point p = new Point();
|
||||
|
||||
assertNotNull(p);
|
||||
assertEquals(0.0, p.x);
|
||||
assertEquals(0.0, p.y);
|
||||
}
|
||||
|
||||
public void testPointDoubleArray() {
|
||||
double[] vals = { 2, 4 };
|
||||
Point p = new Point(vals);
|
||||
|
||||
assertEquals(2.0, p.x);
|
||||
assertEquals(4.0, p.y);
|
||||
}
|
||||
|
||||
public void testPointDoubleDouble() {
|
||||
p1 = new Point(7, 5);
|
||||
|
||||
assertNotNull(p1);
|
||||
assertEquals(7.0, p1.x);
|
||||
assertEquals(5.0, p1.y);
|
||||
}
|
||||
|
||||
public void testSet() {
|
||||
double[] vals1 = {};
|
||||
p1.set(vals1);
|
||||
assertEquals(0.0, p1.x);
|
||||
assertEquals(0.0, p1.y);
|
||||
|
||||
double[] vals2 = { 6, 10 };
|
||||
p2.set(vals2);
|
||||
assertEquals(6.0, p2.x);
|
||||
assertEquals(10.0, p2.y);
|
||||
}
|
||||
|
||||
public void testToString() {
|
||||
String actual = p1.toString();
|
||||
String expected = "{2.0, 2.0}";
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
}
|
@@ -1,113 +0,0 @@
|
||||
package org.opencv.test.core;
|
||||
|
||||
import org.opencv.core.Range;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class RangeTest extends OpenCVTestCase {
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
public void testAll() {
|
||||
range = Range.all();
|
||||
assertEquals(Integer.MIN_VALUE, range.start);
|
||||
assertEquals(Integer.MAX_VALUE, range.end);
|
||||
}
|
||||
|
||||
public void testClone() {
|
||||
Range dstRange = new Range();
|
||||
dstRange = r1.clone();
|
||||
assertEquals(r1, dstRange);
|
||||
}
|
||||
|
||||
public void testEmpty() {
|
||||
boolean flag;
|
||||
|
||||
flag = r1.empty();
|
||||
assertFalse(flag);
|
||||
|
||||
flag = r2.empty();
|
||||
assertTrue(flag);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
public void testRange() {
|
||||
range = new Range();
|
||||
|
||||
assertNotNull(range);
|
||||
assertEquals(0, range.start);
|
||||
assertEquals(0, range.end);
|
||||
}
|
||||
|
||||
public void testRangeDoubleArray() {
|
||||
double[] vals = { 2, 4 };
|
||||
Range r = new Range(vals);
|
||||
|
||||
assertTrue(2 == r.start);
|
||||
assertTrue(4 == r.end);
|
||||
}
|
||||
|
||||
public void testRangeIntInt() {
|
||||
r1 = new Range(12, 13);
|
||||
|
||||
assertNotNull(r1);
|
||||
assertEquals(12, r1.start);
|
||||
assertEquals(13, r1.end);
|
||||
}
|
||||
|
||||
public void testSet() {
|
||||
double[] vals1 = {};
|
||||
r1.set(vals1);
|
||||
assertEquals(0, r1.start);
|
||||
assertEquals(0, r1.end);
|
||||
|
||||
double[] vals2 = { 6, 10 };
|
||||
r2.set(vals2);
|
||||
assertEquals(6, r2.start);
|
||||
assertEquals(10, r2.end);
|
||||
}
|
||||
|
||||
public void testShift() {
|
||||
int delta = 1;
|
||||
range = range.shift(delta);
|
||||
assertEquals(r2, range);
|
||||
}
|
||||
|
||||
public void testSize() {
|
||||
assertEquals(10, r1.size());
|
||||
|
||||
assertEquals(0, r2.size());
|
||||
}
|
||||
|
||||
public void testToString() {
|
||||
String actual = r1.toString();
|
||||
String expected = "[1, 11)";
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
}
|
@@ -1,163 +0,0 @@
|
||||
package org.opencv.test.core;
|
||||
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.Rect;
|
||||
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);
|
||||
}
|
||||
|
||||
public void testArea() {
|
||||
double area;
|
||||
area = rect.area();
|
||||
assertEquals(100.0, area);
|
||||
}
|
||||
|
||||
public void testBr() {
|
||||
Point p_br = new Point();
|
||||
p_br = rect.br();
|
||||
Point truth = new Point(10, 10);
|
||||
assertEquals(truth, p_br);
|
||||
}
|
||||
|
||||
public void testClone() {
|
||||
r = rect.clone();
|
||||
assertEquals(rect, r);
|
||||
}
|
||||
|
||||
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);
|
||||
Point p_br = new Point(10, 0);
|
||||
Point p_tl = new Point(0, 10);
|
||||
Point p_tr = new Point(10, 10);
|
||||
|
||||
assertTrue(rect.contains(p_inner));
|
||||
assertTrue(rect.contains(p_bl));
|
||||
|
||||
assertFalse(rect.contains(p_outer));
|
||||
assertFalse(rect.contains(p_br));
|
||||
assertFalse(rect.contains(p_tl));
|
||||
assertFalse(rect.contains(p_tr));
|
||||
}
|
||||
|
||||
public void testEqualsObject() {
|
||||
boolean flag;
|
||||
flag = rect.equals(r);
|
||||
assertFalse(flag);
|
||||
|
||||
r = rect.clone();
|
||||
flag = rect.equals(r);
|
||||
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);
|
||||
assertEquals(0, r.height);
|
||||
}
|
||||
|
||||
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);
|
||||
assertEquals(2, r.height);
|
||||
}
|
||||
|
||||
public void testRectIntIntIntInt() {
|
||||
r = new Rect(1, 3, 5, 2);
|
||||
|
||||
assertNotNull(rect);
|
||||
assertEquals(0, rect.x);
|
||||
assertEquals(0, rect.y);
|
||||
assertEquals(10, rect.width);
|
||||
assertEquals(10, rect.height);
|
||||
}
|
||||
|
||||
public void testRectPointPoint() {
|
||||
Point p1 = new Point(4, 4);
|
||||
Point p2 = new Point(2, 3);
|
||||
|
||||
r = new Rect(p1, p2);
|
||||
assertNotNull(r);
|
||||
assertEquals(2, r.x);
|
||||
assertEquals(3, r.y);
|
||||
assertEquals(2, r.width);
|
||||
assertEquals(1, r.height);
|
||||
}
|
||||
|
||||
public void testRectPointSize() {
|
||||
Point p1 = new Point(4, 4);
|
||||
Size sz = new Size(3, 1);
|
||||
r = new Rect(p1, sz);
|
||||
|
||||
assertEquals(4, r.x);
|
||||
assertEquals(4, r.y);
|
||||
assertEquals(3, r.width);
|
||||
assertEquals(1, r.height);
|
||||
}
|
||||
|
||||
public void testSet() {
|
||||
double[] vals1 = {};
|
||||
Rect r1 = new Rect(vals1);
|
||||
|
||||
assertEquals(0, r1.x);
|
||||
assertEquals(0, r1.y);
|
||||
assertEquals(0, r1.width);
|
||||
assertEquals(0, r1.height);
|
||||
|
||||
double[] vals2 = { 2, 2, 10, 5 };
|
||||
r = new Rect(vals2);
|
||||
|
||||
assertEquals(2, r.x);
|
||||
assertEquals(2, r.y);
|
||||
assertEquals(10, r.width);
|
||||
assertEquals(5, r.height);
|
||||
}
|
||||
|
||||
public void testSize() {
|
||||
Size s1 = new Size(0, 0);
|
||||
assertEquals(s1, r.size());
|
||||
|
||||
Size s2 = new Size(10, 10);
|
||||
assertEquals(s2, rect.size());
|
||||
}
|
||||
|
||||
public void testTl() {
|
||||
Point p_tl = new Point();
|
||||
p_tl = rect.tl();
|
||||
Point truth = new Point(0, 0);
|
||||
assertEquals(truth, p_tl);
|
||||
}
|
||||
|
||||
public void testToString() {
|
||||
String actual = rect.toString();
|
||||
String expected = "{0, 0, 10x10}";
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
}
|
@@ -1,191 +0,0 @@
|
||||
package org.opencv.test.core;
|
||||
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.Rect;
|
||||
import org.opencv.core.RotatedRect;
|
||||
import org.opencv.core.Size;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class RotatedRectTest extends OpenCVTestCase {
|
||||
|
||||
private double angle;
|
||||
private Point center;
|
||||
private Size size;
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
center = new Point(matSize / 2, matSize / 2);
|
||||
size = new Size(matSize / 4, matSize / 2);
|
||||
angle = 40;
|
||||
}
|
||||
|
||||
public void testBoundingRect() {
|
||||
size = new Size(matSize / 2, matSize / 2);
|
||||
assertEquals(size.height, size.width);
|
||||
double length = size.height;
|
||||
|
||||
angle = 45;
|
||||
RotatedRect rr = new RotatedRect(center, size, angle);
|
||||
|
||||
Rect r = rr.boundingRect();
|
||||
double halfDiagonal = length * Math.sqrt(2) / 2;
|
||||
|
||||
assertTrue((r.x == Math.floor(center.x - halfDiagonal)) && (r.y == Math.floor(center.y - halfDiagonal)));
|
||||
|
||||
assertTrue((r.br().x >= Math.ceil(center.x + halfDiagonal)) && (r.br().y >= Math.ceil(center.y + halfDiagonal)));
|
||||
|
||||
assertTrue((r.br().x - Math.ceil(center.x + halfDiagonal)) <= 1 && (r.br().y - Math.ceil(center.y + halfDiagonal)) <= 1);
|
||||
}
|
||||
|
||||
public void testClone() {
|
||||
RotatedRect rrect = new RotatedRect(center, size, angle);
|
||||
RotatedRect clone = rrect.clone();
|
||||
|
||||
assertTrue(clone != null);
|
||||
assertTrue(rrect.center.equals(clone.center));
|
||||
assertTrue(rrect.size.equals(clone.size));
|
||||
assertTrue(rrect.angle == clone.angle);
|
||||
}
|
||||
|
||||
public void testEqualsObject() {
|
||||
Point center2 = new Point(matSize / 3, matSize / 1.5);
|
||||
Size size2 = new Size(matSize / 2, matSize / 4);
|
||||
double angle2 = 0;
|
||||
|
||||
RotatedRect rrect1 = new RotatedRect(center, size, angle);
|
||||
RotatedRect rrect2 = new RotatedRect(center2, size2, angle2);
|
||||
RotatedRect rrect3 = rrect1;
|
||||
RotatedRect clone1 = rrect1.clone();
|
||||
RotatedRect clone2 = rrect2.clone();
|
||||
|
||||
assertTrue(rrect1.equals(rrect3));
|
||||
assertTrue(!rrect1.equals(rrect2));
|
||||
|
||||
assertTrue(rrect2.equals(clone2));
|
||||
clone2.angle = 10;
|
||||
assertTrue(!rrect2.equals(clone2));
|
||||
|
||||
assertTrue(rrect1.equals(clone1));
|
||||
|
||||
clone1.center.x += 1;
|
||||
assertTrue(!rrect1.equals(clone1));
|
||||
|
||||
clone1.center.x -= 1;
|
||||
assertTrue(rrect1.equals(clone1));
|
||||
|
||||
clone1.size.width += 1;
|
||||
assertTrue(!rrect1.equals(clone1));
|
||||
|
||||
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);
|
||||
|
||||
Point p[] = new Point[4];
|
||||
rrect.points(p);
|
||||
|
||||
boolean is_p0_irrational = (100 * p[0].x != (int) (100 * p[0].x)) && (100 * p[0].y != (int) (100 * p[0].y));
|
||||
boolean is_p1_irrational = (100 * p[1].x != (int) (100 * p[1].x)) && (100 * p[1].y != (int) (100 * p[1].y));
|
||||
boolean is_p2_irrational = (100 * p[2].x != (int) (100 * p[2].x)) && (100 * p[2].y != (int) (100 * p[2].y));
|
||||
boolean is_p3_irrational = (100 * p[3].x != (int) (100 * p[3].x)) && (100 * p[3].y != (int) (100 * p[3].y));
|
||||
|
||||
assertTrue(is_p0_irrational && is_p1_irrational && is_p2_irrational && is_p3_irrational);
|
||||
|
||||
assertTrue("Symmetric points 0 and 2",
|
||||
Math.abs((p[0].x + p[2].x) / 2 - center.x) + Math.abs((p[0].y + p[2].y) / 2 - center.y) < EPS);
|
||||
|
||||
assertTrue("Symmetric points 1 and 3",
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
public void testRotatedRect() {
|
||||
RotatedRect rr = new RotatedRect();
|
||||
|
||||
assertTrue(rr != null);
|
||||
assertTrue(rr.center != null);
|
||||
assertTrue(rr.size != null);
|
||||
assertTrue(rr.angle == 0.0);
|
||||
}
|
||||
|
||||
public void testRotatedRectDoubleArray() {
|
||||
double[] vals = { 1.5, 2.6, 3.7, 4.2, 5.1 };
|
||||
RotatedRect rr = new RotatedRect(vals);
|
||||
|
||||
assertNotNull(rr);
|
||||
assertEquals(1.5, rr.center.x);
|
||||
assertEquals(2.6, rr.center.y);
|
||||
assertEquals(3.7, rr.size.width);
|
||||
assertEquals(4.2, rr.size.height);
|
||||
assertEquals(5.1, rr.angle);
|
||||
}
|
||||
|
||||
public void testRotatedRectPointSizeDouble() {
|
||||
RotatedRect rr = new RotatedRect(center, size, 40);
|
||||
|
||||
assertTrue(rr != null);
|
||||
assertTrue(rr.center != null);
|
||||
assertTrue(rr.size != null);
|
||||
assertTrue(rr.angle == 40.0);
|
||||
}
|
||||
|
||||
public void testSet() {
|
||||
double[] vals1 = {};
|
||||
RotatedRect r1 = new RotatedRect(center, size, 40);
|
||||
|
||||
r1.set(vals1);
|
||||
|
||||
assertEquals(0., r1.angle);
|
||||
assertPointEquals(new Point(0, 0), r1.center, EPS);
|
||||
assertSizeEquals(new Size(0, 0), r1.size, EPS);
|
||||
|
||||
double[] vals2 = { 1, 2, 3, 4, 5 };
|
||||
RotatedRect r2 = new RotatedRect(center, size, 40);
|
||||
|
||||
r2.set(vals2);
|
||||
|
||||
assertEquals(5., r2.angle);
|
||||
assertPointEquals(new Point(1, 2), r2.center, EPS);
|
||||
assertSizeEquals(new Size(3, 4), r2.size, EPS);
|
||||
}
|
||||
|
||||
public void testToString() {
|
||||
String actual = new RotatedRect(new Point(1, 2), new Size(10, 12), 4.5).toString();
|
||||
String expected = "{ {1.0, 2.0} 10x12 * 4.5 }";
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
}
|
@@ -1,110 +0,0 @@
|
||||
package org.opencv.test.core;
|
||||
|
||||
import org.opencv.core.Scalar;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class ScalarTest extends OpenCVTestCase {
|
||||
|
||||
private Scalar dstScalar;
|
||||
private Scalar s1;
|
||||
private Scalar s2;
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
s1 = new Scalar(1.0);
|
||||
s2 = Scalar.all(1.0);
|
||||
dstScalar = null;
|
||||
}
|
||||
|
||||
public void testAll() {
|
||||
dstScalar = Scalar.all(2.0);
|
||||
Scalar truth = new Scalar(2.0, 2.0, 2.0, 2.0);
|
||||
assertEquals(truth, dstScalar);
|
||||
}
|
||||
|
||||
public void testClone() {
|
||||
dstScalar = s2.clone();
|
||||
assertEquals(s2, dstScalar);
|
||||
}
|
||||
|
||||
public void testConj() {
|
||||
dstScalar = s2.conj();
|
||||
Scalar truth = new Scalar(1, -1, -1, -1);
|
||||
assertEquals(truth, dstScalar);
|
||||
}
|
||||
|
||||
public void testEqualsObject() {
|
||||
dstScalar = s2.clone();
|
||||
assertTrue(s2.equals(dstScalar));
|
||||
|
||||
assertFalse(s2.equals(s1));
|
||||
}
|
||||
|
||||
public void testHashCode() {
|
||||
assertEquals(s2.hashCode(), s2.hashCode());
|
||||
}
|
||||
|
||||
public void testIsReal() {
|
||||
assertTrue(s1.isReal());
|
||||
|
||||
assertFalse(s2.isReal());
|
||||
}
|
||||
|
||||
public void testMulScalar() {
|
||||
dstScalar = s2.mul(s1);
|
||||
assertEquals(s1, dstScalar);
|
||||
}
|
||||
|
||||
public void testMulScalarDouble() {
|
||||
double multiplier = 2.0;
|
||||
dstScalar = s2.mul(s1, multiplier);
|
||||
Scalar truth = new Scalar(2);
|
||||
assertEquals(truth, dstScalar);
|
||||
}
|
||||
|
||||
public void testScalarDouble() {
|
||||
Scalar truth = new Scalar(1);
|
||||
assertEquals(truth, s1);
|
||||
}
|
||||
|
||||
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);
|
||||
assertEquals(truth, dstScalar);
|
||||
}
|
||||
|
||||
public void testScalarDoubleDouble() {
|
||||
dstScalar = new Scalar(2, 5);
|
||||
Scalar truth = new Scalar(2.0, 5.0, 0.0, 0.0);
|
||||
assertEquals(truth, dstScalar);
|
||||
}
|
||||
|
||||
public void testScalarDoubleDoubleDouble() {
|
||||
dstScalar = new Scalar(2.0, 5.0, 5.0);
|
||||
Scalar truth = new Scalar(2.0, 5.0, 5.0, 0.0);
|
||||
assertEquals(truth, dstScalar);
|
||||
}
|
||||
|
||||
public void testScalarDoubleDoubleDoubleDouble() {
|
||||
dstScalar = new Scalar(2.0, 5.0, 5.0, 9.0);
|
||||
Scalar truth = new Scalar(2.0, 5.0, 5.0, 9.0);
|
||||
assertEquals(truth, dstScalar);
|
||||
}
|
||||
|
||||
public void testSet() {
|
||||
double[] vals = { 1.0, 1.0, 1.0, 1.0 };
|
||||
s1.set(vals);
|
||||
assertEquals(s2, s1);
|
||||
}
|
||||
|
||||
public void testToString() {
|
||||
String actual = s2.toString();
|
||||
String expected = "[1.0, 1.0, 1.0, 1.0]";
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
}
|
@@ -1,93 +0,0 @@
|
||||
package org.opencv.test.core;
|
||||
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.Size;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class SizeTest extends OpenCVTestCase {
|
||||
|
||||
Size dstSize;
|
||||
Size sz1;
|
||||
Size sz2;
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
sz1 = new Size(10.0, 10.0);
|
||||
sz2 = new Size(-1, -1);
|
||||
dstSize = null;
|
||||
}
|
||||
|
||||
public void testArea() {
|
||||
double area = sz1.area();
|
||||
assertEquals(100.0, area);
|
||||
}
|
||||
|
||||
public void testClone() {
|
||||
dstSize = sz1.clone();
|
||||
assertEquals(sz1, dstSize);
|
||||
}
|
||||
|
||||
public void testEqualsObject() {
|
||||
assertFalse(sz1.equals(sz2));
|
||||
|
||||
sz2 = sz1.clone();
|
||||
assertTrue(sz1.equals(sz2));
|
||||
}
|
||||
|
||||
public void testHashCode() {
|
||||
assertEquals(sz1.hashCode(), sz1.hashCode());
|
||||
}
|
||||
|
||||
public void testSet() {
|
||||
double[] vals1 = {};
|
||||
sz2.set(vals1);
|
||||
assertEquals(0., sz2.width);
|
||||
assertEquals(0., sz2.height);
|
||||
|
||||
double[] vals2 = { 9, 12 };
|
||||
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);
|
||||
}
|
||||
|
||||
public void testSizeDoubleArray() {
|
||||
double[] vals = { 10, 20 };
|
||||
sz2 = new Size(vals);
|
||||
|
||||
assertEquals(10., sz2.width);
|
||||
assertEquals(20., sz2.height);
|
||||
}
|
||||
|
||||
public void testSizeDoubleDouble() {
|
||||
assertNotNull(sz1);
|
||||
|
||||
assertEquals(10.0, sz1.width);
|
||||
assertEquals(10.0, sz1.height);
|
||||
}
|
||||
|
||||
public void testSizePoint() {
|
||||
Point p = new Point(2, 4);
|
||||
sz1 = new Size(p);
|
||||
|
||||
assertNotNull(sz1);
|
||||
assertEquals(2.0, sz1.width);
|
||||
assertEquals(4.0, sz1.height);
|
||||
}
|
||||
|
||||
public void testToString() {
|
||||
String actual = sz1.toString();
|
||||
String expected = "10x10";
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
}
|
@@ -1,86 +0,0 @@
|
||||
package org.opencv.test.core;
|
||||
|
||||
import org.opencv.core.TermCriteria;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class TermCriteriaTest extends OpenCVTestCase {
|
||||
|
||||
private TermCriteria tc1;
|
||||
private TermCriteria tc2;
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
tc1 = new TermCriteria();
|
||||
tc2 = new TermCriteria(2, 4, EPS);
|
||||
}
|
||||
|
||||
public void testClone() {
|
||||
tc1 = tc2.clone();
|
||||
assertEquals(tc2, tc1);
|
||||
}
|
||||
|
||||
public void testEqualsObject() {
|
||||
assertFalse(tc2.equals(tc1));
|
||||
|
||||
tc1 = tc2.clone();
|
||||
assertTrue(tc2.equals(tc1));
|
||||
}
|
||||
|
||||
public void testHashCode() {
|
||||
assertEquals(tc2.hashCode(), tc2.hashCode());
|
||||
}
|
||||
|
||||
public void testSet() {
|
||||
double[] vals1 = {};
|
||||
tc1.set(vals1);
|
||||
|
||||
assertEquals(0, tc1.type);
|
||||
assertEquals(0, tc1.maxCount);
|
||||
assertEquals(0.0, tc1.epsilon);
|
||||
|
||||
double[] vals2 = { 9, 8, 0.002 };
|
||||
tc2.set(vals2);
|
||||
|
||||
assertEquals(9, tc2.type);
|
||||
assertEquals(8, tc2.maxCount);
|
||||
assertEquals(0.002, tc2.epsilon);
|
||||
}
|
||||
|
||||
public void testTermCriteria() {
|
||||
tc1 = new TermCriteria();
|
||||
|
||||
assertNotNull(tc1);
|
||||
assertEquals(0, tc1.type);
|
||||
assertEquals(0, tc1.maxCount);
|
||||
assertEquals(0.0, tc1.epsilon);
|
||||
}
|
||||
|
||||
public void testTermCriteriaDoubleArray() {
|
||||
double[] vals = { 3, 2, 0.007 };
|
||||
tc1 = new TermCriteria(vals);
|
||||
|
||||
assertEquals(3, tc1.type);
|
||||
assertEquals(2, tc1.maxCount);
|
||||
assertEquals(0.007, tc1.epsilon);
|
||||
}
|
||||
|
||||
public void testTermCriteriaIntIntDouble() {
|
||||
tc1 = new TermCriteria(2, 4, EPS);
|
||||
|
||||
assertNotNull(tc2);
|
||||
assertEquals(2, tc2.type);
|
||||
assertEquals(4, tc2.maxCount);
|
||||
assertEquals(EPS, tc2.epsilon);
|
||||
}
|
||||
|
||||
public void testToString() {
|
||||
String actual = tc2.toString();
|
||||
double eps = EPS;
|
||||
String expected = "{ type: 2, maxCount: 4, epsilon: " + eps + "}";
|
||||
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
}
|
@@ -1,102 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.core.Core;
|
||||
import org.opencv.core.CvType;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.MatOfKeyPoint;
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.Scalar;
|
||||
import org.opencv.features2d.DescriptorExtractor;
|
||||
import org.opencv.core.KeyPoint;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
import org.opencv.test.OpenCVTestRunner;
|
||||
import org.opencv.imgproc.Imgproc;
|
||||
|
||||
public class BRIEFDescriptorExtractorTest extends OpenCVTestCase {
|
||||
|
||||
DescriptorExtractor extractor;
|
||||
int matSize;
|
||||
|
||||
private Mat getTestImg() {
|
||||
Mat cross = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255));
|
||||
Imgproc.line(cross, new Point(20, matSize / 2), new Point(matSize - 21, matSize / 2), new Scalar(100), 2);
|
||||
Imgproc.line(cross, new Point(matSize / 2, 20), new Point(matSize / 2, matSize - 21), new Scalar(100), 2);
|
||||
|
||||
return cross;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
extractor = DescriptorExtractor.create(DescriptorExtractor.BRIEF);
|
||||
matSize = 100;
|
||||
}
|
||||
|
||||
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);
|
||||
MatOfKeyPoint keypoints = new MatOfKeyPoint(point);
|
||||
Mat img = getTestImg();
|
||||
Mat descriptors = new Mat();
|
||||
|
||||
extractor.compute(img, keypoints, descriptors);
|
||||
|
||||
Mat truth = new Mat(1, 32, CvType.CV_8UC1) {
|
||||
{
|
||||
put(0, 0, 96, 0, 76, 24, 47, 182, 68, 137,
|
||||
149, 195, 67, 16, 187, 224, 74, 8,
|
||||
82, 169, 87, 70, 44, 4, 192, 56,
|
||||
13, 128, 44, 106, 146, 72, 194, 245);
|
||||
}
|
||||
};
|
||||
|
||||
assertMatEqual(truth, descriptors);
|
||||
}
|
||||
|
||||
public void testCreate() {
|
||||
assertNotNull(extractor);
|
||||
}
|
||||
|
||||
public void testDescriptorSize() {
|
||||
assertEquals(32, extractor.descriptorSize());
|
||||
}
|
||||
|
||||
public void testDescriptorType() {
|
||||
assertEquals(CvType.CV_8U, extractor.descriptorType());
|
||||
}
|
||||
|
||||
public void testEmpty() {
|
||||
assertFalse(extractor.empty());
|
||||
}
|
||||
|
||||
public void testRead() {
|
||||
String filename = OpenCVTestRunner.getTempFileName("yml");
|
||||
writeFile(filename, "%YAML:1.0\ndescriptorSize: 64\n");
|
||||
|
||||
extractor.read(filename);
|
||||
|
||||
assertEquals(64, extractor.descriptorSize());
|
||||
}
|
||||
|
||||
public void testWrite() {
|
||||
String filename = OpenCVTestRunner.getTempFileName("xml");
|
||||
|
||||
extractor.write(filename);
|
||||
|
||||
String truth = "<?xml version=\"1.0\"?>\n<opencv_storage>\n<descriptorSize>32</descriptorSize>\n</opencv_storage>\n";
|
||||
assertEquals(truth, readFile(filename));
|
||||
}
|
||||
|
||||
public void testWriteYml() {
|
||||
String filename = OpenCVTestRunner.getTempFileName("yml");
|
||||
|
||||
extractor.write(filename);
|
||||
|
||||
String truth = "%YAML:1.0\ndescriptorSize: 32\n";
|
||||
assertEquals(truth, readFile(filename));
|
||||
}
|
||||
|
||||
}
|
@@ -1,295 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.opencv.core.Core;
|
||||
import org.opencv.core.CvType;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.MatOfDMatch;
|
||||
import org.opencv.core.MatOfKeyPoint;
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.Scalar;
|
||||
import org.opencv.core.DMatch;
|
||||
import org.opencv.features2d.DescriptorExtractor;
|
||||
import org.opencv.features2d.DescriptorMatcher;
|
||||
import org.opencv.features2d.FeatureDetector;
|
||||
import org.opencv.core.KeyPoint;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
import org.opencv.test.OpenCVTestRunner;
|
||||
import org.opencv.imgproc.Imgproc;
|
||||
|
||||
public class BruteForceDescriptorMatcherTest extends OpenCVTestCase {
|
||||
|
||||
DescriptorMatcher matcher;
|
||||
int matSize;
|
||||
DMatch[] truth;
|
||||
|
||||
private Mat getMaskImg() {
|
||||
return new Mat(5, 2, CvType.CV_8U, new Scalar(0)) {
|
||||
{
|
||||
put(0, 0, 1, 1, 1, 1);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private Mat getQueryDescriptors() {
|
||||
Mat img = getQueryImg();
|
||||
MatOfKeyPoint keypoints = new MatOfKeyPoint();
|
||||
Mat descriptors = new Mat();
|
||||
|
||||
FeatureDetector detector = FeatureDetector.create(FeatureDetector.SURF);
|
||||
DescriptorExtractor extractor = DescriptorExtractor.create(DescriptorExtractor.SURF);
|
||||
|
||||
String filename = OpenCVTestRunner.getTempFileName("yml");
|
||||
writeFile(filename, "%YAML:1.0\nhessianThreshold: 8000.\noctaves: 3\noctaveLayers: 4\nupright: 0\n");
|
||||
detector.read(filename);
|
||||
|
||||
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));
|
||||
Imgproc.line(cross, new Point(30, matSize / 2), new Point(matSize - 31, matSize / 2), new Scalar(100), 3);
|
||||
Imgproc.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();
|
||||
MatOfKeyPoint keypoints = new MatOfKeyPoint(new KeyPoint(50, 50, 16, 0, 20000, 1, -1), new KeyPoint(42, 42, 16, 160, 10000, 1, -1));
|
||||
Mat descriptors = new Mat();
|
||||
|
||||
DescriptorExtractor extractor = DescriptorExtractor.create(DescriptorExtractor.SURF);
|
||||
|
||||
extractor.compute(img, keypoints, descriptors);
|
||||
|
||||
return descriptors;
|
||||
}
|
||||
|
||||
private Mat getTrainImg() {
|
||||
Mat cross = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255));
|
||||
Imgproc.line(cross, new Point(20, matSize / 2), new Point(matSize - 21, matSize / 2), new Scalar(100), 2);
|
||||
Imgproc.line(cross, new Point(matSize / 2, 20), new Point(matSize / 2, matSize - 21), new Scalar(100), 2);
|
||||
|
||||
return cross;
|
||||
}
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE);
|
||||
matSize = 100;
|
||||
|
||||
truth = new DMatch[] {
|
||||
new DMatch(0, 0, 0, 0.6211397f),
|
||||
new DMatch(1, 1, 0, 0.9177120f),
|
||||
new DMatch(2, 1, 0, 0.3112163f),
|
||||
new DMatch(3, 1, 0, 0.2925074f),
|
||||
new DMatch(4, 1, 0, 0.9309178f)
|
||||
};
|
||||
}
|
||||
|
||||
public void testAdd() {
|
||||
matcher.add(Arrays.asList(new Mat()));
|
||||
assertFalse(matcher.empty());
|
||||
}
|
||||
|
||||
public void testClear() {
|
||||
matcher.add(Arrays.asList(new Mat()));
|
||||
|
||||
matcher.clear();
|
||||
|
||||
assertTrue(matcher.empty());
|
||||
}
|
||||
|
||||
public void testClone() {
|
||||
Mat train = new Mat(1, 1, CvType.CV_8U, new Scalar(123));
|
||||
Mat truth = train.clone();
|
||||
matcher.add(Arrays.asList(train));
|
||||
|
||||
DescriptorMatcher cloned = matcher.clone();
|
||||
|
||||
assertNotNull(cloned);
|
||||
|
||||
List<Mat> descriptors = cloned.getTrainDescriptors();
|
||||
assertEquals(1, descriptors.size());
|
||||
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);
|
||||
}
|
||||
|
||||
public void testEmpty() {
|
||||
assertTrue(matcher.empty());
|
||||
}
|
||||
|
||||
public void testGetTrainDescriptors() {
|
||||
Mat train = new Mat(1, 1, CvType.CV_8U, new Scalar(123));
|
||||
Mat truth = train.clone();
|
||||
matcher.add(Arrays.asList(train));
|
||||
|
||||
List<Mat> descriptors = matcher.getTrainDescriptors();
|
||||
|
||||
assertEquals(1, descriptors.size());
|
||||
assertMatEqual(truth, descriptors.get(0));
|
||||
}
|
||||
|
||||
public void testIsMaskSupported() {
|
||||
assertTrue(matcher.isMaskSupported());
|
||||
}
|
||||
|
||||
public void testKnnMatchMatListOfListOfDMatchInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testKnnMatchMatListOfListOfDMatchIntListOfMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testKnnMatchMatListOfListOfDMatchIntListOfMatBoolean() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testKnnMatchMatMatListOfListOfDMatchInt() {
|
||||
final int k = 3;
|
||||
Mat train = getTrainDescriptors();
|
||||
Mat query = getQueryDescriptors();
|
||||
List<MatOfDMatch> matches = new ArrayList<MatOfDMatch>();
|
||||
matcher.knnMatch(query, train, matches, k);
|
||||
/*
|
||||
Log.d("knnMatch", "train = " + train);
|
||||
Log.d("knnMatch", "query = " + query);
|
||||
|
||||
matcher.add(train);
|
||||
matcher.knnMatch(query, matches, k);
|
||||
*/
|
||||
assertEquals(query.rows(), matches.size());
|
||||
for(int i = 0; i<matches.size(); i++)
|
||||
{
|
||||
MatOfDMatch vdm = matches.get(i);
|
||||
//Log.d("knn", "vdm["+i+"]="+vdm.dump());
|
||||
assertTrue(Math.min(k, train.rows()) >= vdm.total());
|
||||
for(DMatch dm : vdm.toArray())
|
||||
{
|
||||
assertEquals(dm.queryIdx, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void testKnnMatchMatMatListOfListOfDMatchIntMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testKnnMatchMatMatListOfListOfDMatchIntMatBoolean() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testMatchMatListOfDMatch() {
|
||||
Mat train = getTrainDescriptors();
|
||||
Mat query = getQueryDescriptors();
|
||||
MatOfDMatch matches = new MatOfDMatch();
|
||||
matcher.add(Arrays.asList(train));
|
||||
|
||||
matcher.match(query, matches);
|
||||
|
||||
assertArrayDMatchEquals(truth, matches.toArray(), EPS);
|
||||
}
|
||||
|
||||
public void testMatchMatListOfDMatchListOfMat() {
|
||||
Mat train = getTrainDescriptors();
|
||||
Mat query = getQueryDescriptors();
|
||||
Mat mask = getMaskImg();
|
||||
MatOfDMatch matches = new MatOfDMatch();
|
||||
matcher.add(Arrays.asList(train));
|
||||
|
||||
matcher.match(query, matches, Arrays.asList(mask));
|
||||
|
||||
assertListDMatchEquals(Arrays.asList(truth[0], truth[1]), matches.toList(), EPS);
|
||||
}
|
||||
|
||||
public void testMatchMatMatListOfDMatch() {
|
||||
Mat train = getTrainDescriptors();
|
||||
Mat query = getQueryDescriptors();
|
||||
MatOfDMatch matches = new MatOfDMatch();
|
||||
|
||||
matcher.match(query, train, matches);
|
||||
|
||||
assertArrayDMatchEquals(truth, matches.toArray(), 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();
|
||||
MatOfDMatch matches = new MatOfDMatch();
|
||||
|
||||
matcher.match(query, train, matches, mask);
|
||||
|
||||
assertListDMatchEquals(Arrays.asList(truth[0], truth[1]), matches.toList(), 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");
|
||||
|
||||
matcher.read(filename);
|
||||
assertTrue(true);// BruteforceMatcher has no settings
|
||||
}
|
||||
|
||||
public void testTrain() {
|
||||
matcher.train();// BruteforceMatcher does not need to train
|
||||
}
|
||||
|
||||
public void testWrite() {
|
||||
String filename = OpenCVTestRunner.getTempFileName("yml");
|
||||
|
||||
matcher.write(filename);
|
||||
|
||||
String truth = "%YAML:1.0\n";
|
||||
assertEquals(truth, readFile(filename));
|
||||
}
|
||||
|
||||
}
|
@@ -1,263 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.opencv.core.Core;
|
||||
import org.opencv.core.CvType;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.MatOfDMatch;
|
||||
import org.opencv.core.MatOfKeyPoint;
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.Scalar;
|
||||
import org.opencv.core.DMatch;
|
||||
import org.opencv.features2d.DescriptorExtractor;
|
||||
import org.opencv.features2d.DescriptorMatcher;
|
||||
import org.opencv.features2d.FeatureDetector;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
import org.opencv.test.OpenCVTestRunner;
|
||||
import org.opencv.imgproc.Imgproc;
|
||||
|
||||
public class BruteForceHammingDescriptorMatcherTest extends OpenCVTestCase {
|
||||
|
||||
DescriptorMatcher matcher;
|
||||
int matSize;
|
||||
DMatch[] truth;
|
||||
|
||||
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 getQueryDescriptors() {
|
||||
return getTestDescriptors(getQueryImg());
|
||||
}
|
||||
|
||||
private Mat getQueryImg() {
|
||||
Mat img = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255));
|
||||
Imgproc.line(img, new Point(40, matSize - 40), new Point(matSize - 50, 50), new Scalar(0), 8);
|
||||
return img;
|
||||
}
|
||||
|
||||
private Mat getTestDescriptors(Mat img) {
|
||||
MatOfKeyPoint keypoints = new MatOfKeyPoint();
|
||||
Mat descriptors = new Mat();
|
||||
|
||||
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 getTrainDescriptors() {
|
||||
return getTestDescriptors(getTrainImg());
|
||||
}
|
||||
|
||||
private Mat getTrainImg() {
|
||||
Mat img = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255));
|
||||
Imgproc.line(img, new Point(40, 40), new Point(matSize - 40, matSize - 40), new Scalar(0), 8);
|
||||
return img;
|
||||
}
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
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) };
|
||||
}
|
||||
|
||||
public void testAdd() {
|
||||
matcher.add(Arrays.asList(new Mat()));
|
||||
assertFalse(matcher.empty());
|
||||
}
|
||||
|
||||
public void testClear() {
|
||||
matcher.add(Arrays.asList(new Mat()));
|
||||
|
||||
matcher.clear();
|
||||
|
||||
assertTrue(matcher.empty());
|
||||
}
|
||||
|
||||
public void testClone() {
|
||||
Mat train = new Mat(1, 1, CvType.CV_8U, new Scalar(123));
|
||||
Mat truth = train.clone();
|
||||
matcher.add(Arrays.asList(train));
|
||||
|
||||
DescriptorMatcher cloned = matcher.clone();
|
||||
|
||||
assertNotNull(cloned);
|
||||
|
||||
List<Mat> descriptors = cloned.getTrainDescriptors();
|
||||
assertEquals(1, descriptors.size());
|
||||
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);
|
||||
}
|
||||
|
||||
public void testEmpty() {
|
||||
assertTrue(matcher.empty());
|
||||
}
|
||||
|
||||
public void testGetTrainDescriptors() {
|
||||
Mat train = new Mat(1, 1, CvType.CV_8U, new Scalar(123));
|
||||
Mat truth = train.clone();
|
||||
matcher.add(Arrays.asList(train));
|
||||
|
||||
List<Mat> descriptors = matcher.getTrainDescriptors();
|
||||
|
||||
assertEquals(1, descriptors.size());
|
||||
assertMatEqual(truth, descriptors.get(0));
|
||||
}
|
||||
|
||||
public void testIsMaskSupported() {
|
||||
assertTrue(matcher.isMaskSupported());
|
||||
}
|
||||
|
||||
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();
|
||||
MatOfDMatch matches = new MatOfDMatch();
|
||||
matcher.add(Arrays.asList(train));
|
||||
|
||||
matcher.match(query, matches);
|
||||
|
||||
assertListDMatchEquals(Arrays.asList(truth), matches.toList(), EPS);
|
||||
}
|
||||
|
||||
public void testMatchMatListOfDMatchListOfMat() {
|
||||
Mat train = getTrainDescriptors();
|
||||
Mat query = getQueryDescriptors();
|
||||
Mat mask = getMaskImg();
|
||||
MatOfDMatch matches = new MatOfDMatch();
|
||||
matcher.add(Arrays.asList(train));
|
||||
|
||||
matcher.match(query, matches, Arrays.asList(mask));
|
||||
|
||||
assertListDMatchEquals(Arrays.asList(truth[0], truth[1]), matches.toList(), EPS);
|
||||
}
|
||||
|
||||
public void testMatchMatMatListOfDMatch() {
|
||||
Mat train = getTrainDescriptors();
|
||||
Mat query = getQueryDescriptors();
|
||||
MatOfDMatch matches = new MatOfDMatch();
|
||||
|
||||
matcher.match(query, train, matches);
|
||||
|
||||
assertListDMatchEquals(Arrays.asList(truth), matches.toList(), EPS);
|
||||
}
|
||||
|
||||
public void testMatchMatMatListOfDMatchMat() {
|
||||
Mat train = getTrainDescriptors();
|
||||
Mat query = getQueryDescriptors();
|
||||
Mat mask = getMaskImg();
|
||||
MatOfDMatch matches = new MatOfDMatch();
|
||||
|
||||
matcher.match(query, train, matches, mask);
|
||||
|
||||
assertListDMatchEquals(Arrays.asList(truth[0], truth[1]), matches.toList(), EPS);
|
||||
}
|
||||
|
||||
public void testRadiusMatchMatListOfListOfDMatchFloat() {
|
||||
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() {
|
||||
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");
|
||||
|
||||
matcher.read(filename);
|
||||
assertTrue(true);// BruteforceMatcher has no settings
|
||||
}
|
||||
|
||||
public void testTrain() {
|
||||
matcher.train();// BruteforceMatcher does not need to train
|
||||
}
|
||||
|
||||
public void testWrite() {
|
||||
String filename = OpenCVTestRunner.getTempFileName("yml");
|
||||
|
||||
matcher.write(filename);
|
||||
|
||||
String truth = "%YAML:1.0\n";
|
||||
assertEquals(truth, readFile(filename));
|
||||
}
|
||||
|
||||
}
|
@@ -1,258 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.opencv.core.Core;
|
||||
import org.opencv.core.CvType;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.MatOfDMatch;
|
||||
import org.opencv.core.MatOfKeyPoint;
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.Scalar;
|
||||
import org.opencv.core.DMatch;
|
||||
import org.opencv.features2d.DescriptorExtractor;
|
||||
import org.opencv.features2d.DescriptorMatcher;
|
||||
import org.opencv.features2d.FeatureDetector;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
import org.opencv.test.OpenCVTestRunner;
|
||||
import org.opencv.imgproc.Imgproc;
|
||||
|
||||
public class BruteForceHammingLUTDescriptorMatcherTest extends OpenCVTestCase {
|
||||
|
||||
DescriptorMatcher matcher;
|
||||
int matSize;
|
||||
DMatch[] truth;
|
||||
|
||||
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 getQueryDescriptors() {
|
||||
return getTestDescriptors(getQueryImg());
|
||||
}
|
||||
|
||||
private Mat getQueryImg() {
|
||||
Mat img = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255));
|
||||
Imgproc.line(img, new Point(40, matSize - 40), new Point(matSize - 50, 50), new Scalar(0), 8);
|
||||
return img;
|
||||
}
|
||||
|
||||
private Mat getTestDescriptors(Mat img) {
|
||||
MatOfKeyPoint keypoints = new MatOfKeyPoint();
|
||||
Mat descriptors = new Mat();
|
||||
|
||||
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 getTrainDescriptors() {
|
||||
return getTestDescriptors(getTrainImg());
|
||||
}
|
||||
|
||||
private Mat getTrainImg() {
|
||||
Mat img = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255));
|
||||
Imgproc.line(img, new Point(40, 40), new Point(matSize - 40, matSize - 40), new Scalar(0), 8);
|
||||
return img;
|
||||
}
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
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) };
|
||||
}
|
||||
|
||||
public void testAdd() {
|
||||
matcher.add(Arrays.asList(new Mat()));
|
||||
assertFalse(matcher.empty());
|
||||
}
|
||||
|
||||
public void testClear() {
|
||||
matcher.add(Arrays.asList(new Mat()));
|
||||
|
||||
matcher.clear();
|
||||
|
||||
assertTrue(matcher.empty());
|
||||
}
|
||||
|
||||
public void testClone() {
|
||||
Mat train = new Mat(1, 1, CvType.CV_8U, new Scalar(123));
|
||||
Mat truth = train.clone();
|
||||
matcher.add(Arrays.asList(train));
|
||||
|
||||
DescriptorMatcher cloned = matcher.clone();
|
||||
|
||||
assertNotNull(cloned);
|
||||
|
||||
List<Mat> descriptors = cloned.getTrainDescriptors();
|
||||
assertEquals(1, descriptors.size());
|
||||
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);
|
||||
}
|
||||
|
||||
public void testEmpty() {
|
||||
assertTrue(matcher.empty());
|
||||
}
|
||||
|
||||
public void testGetTrainDescriptors() {
|
||||
Mat train = new Mat(1, 1, CvType.CV_8U, new Scalar(123));
|
||||
Mat truth = train.clone();
|
||||
matcher.add(Arrays.asList(train));
|
||||
|
||||
List<Mat> descriptors = matcher.getTrainDescriptors();
|
||||
|
||||
assertEquals(1, descriptors.size());
|
||||
assertMatEqual(truth, descriptors.get(0));
|
||||
}
|
||||
|
||||
public void testIsMaskSupported() {
|
||||
assertTrue(matcher.isMaskSupported());
|
||||
}
|
||||
|
||||
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();
|
||||
MatOfDMatch matches = new MatOfDMatch();
|
||||
matcher.add(Arrays.asList(train));
|
||||
|
||||
matcher.match(query, matches);
|
||||
|
||||
assertArrayDMatchEquals(truth, matches.toArray(), EPS);
|
||||
}
|
||||
|
||||
public void testMatchMatListOfDMatchListOfMat() {
|
||||
Mat train = getTrainDescriptors();
|
||||
Mat query = getQueryDescriptors();
|
||||
Mat mask = getMaskImg();
|
||||
MatOfDMatch matches = new MatOfDMatch();
|
||||
matcher.add(Arrays.asList(train));
|
||||
|
||||
matcher.match(query, matches, Arrays.asList(mask));
|
||||
|
||||
assertListDMatchEquals(Arrays.asList(truth[0], truth[1]), matches.toList(), EPS);
|
||||
}
|
||||
|
||||
public void testMatchMatMatListOfDMatch() {
|
||||
Mat train = getTrainDescriptors();
|
||||
Mat query = getQueryDescriptors();
|
||||
MatOfDMatch matches = new MatOfDMatch();
|
||||
|
||||
matcher.match(query, train, matches);
|
||||
|
||||
/*
|
||||
OpenCVTestRunner.Log("matches found: " + matches.size());
|
||||
for (DMatch m : matches.toArray())
|
||||
OpenCVTestRunner.Log(m.toString());
|
||||
*/
|
||||
|
||||
assertArrayDMatchEquals(truth, matches.toArray(), EPS);
|
||||
}
|
||||
|
||||
public void testMatchMatMatListOfDMatchMat() {
|
||||
Mat train = getTrainDescriptors();
|
||||
Mat query = getQueryDescriptors();
|
||||
Mat mask = getMaskImg();
|
||||
MatOfDMatch matches = new MatOfDMatch();
|
||||
|
||||
matcher.match(query, train, matches, mask);
|
||||
|
||||
assertListDMatchEquals(Arrays.asList(truth[0], truth[1]), matches.toList(), 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");
|
||||
|
||||
matcher.read(filename);
|
||||
assertTrue(true);// BruteforceMatcher has no settings
|
||||
}
|
||||
|
||||
public void testTrain() {
|
||||
matcher.train();// BruteforceMatcher does not need to train
|
||||
}
|
||||
|
||||
public void testWrite() {
|
||||
String filename = OpenCVTestRunner.getTempFileName("yml");
|
||||
|
||||
matcher.write(filename);
|
||||
|
||||
String truth = "%YAML:1.0\n";
|
||||
assertEquals(truth, readFile(filename));
|
||||
}
|
||||
|
||||
}
|
@@ -1,269 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.opencv.core.Core;
|
||||
import org.opencv.core.CvType;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.MatOfDMatch;
|
||||
import org.opencv.core.MatOfKeyPoint;
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.Scalar;
|
||||
import org.opencv.core.DMatch;
|
||||
import org.opencv.features2d.DescriptorExtractor;
|
||||
import org.opencv.features2d.DescriptorMatcher;
|
||||
import org.opencv.features2d.FeatureDetector;
|
||||
import org.opencv.core.KeyPoint;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
import org.opencv.test.OpenCVTestRunner;
|
||||
import org.opencv.imgproc.Imgproc;
|
||||
|
||||
public class BruteForceL1DescriptorMatcherTest extends OpenCVTestCase {
|
||||
|
||||
DescriptorMatcher matcher;
|
||||
int matSize;
|
||||
DMatch[] truth;
|
||||
|
||||
private Mat getMaskImg() {
|
||||
return new Mat(5, 2, CvType.CV_8U, new Scalar(0)) {
|
||||
{
|
||||
put(0, 0, 1, 1, 1, 1);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private Mat getQueryDescriptors() {
|
||||
Mat img = getQueryImg();
|
||||
MatOfKeyPoint keypoints = new MatOfKeyPoint();
|
||||
Mat descriptors = new Mat();
|
||||
|
||||
FeatureDetector detector = FeatureDetector.create(FeatureDetector.SURF);
|
||||
DescriptorExtractor extractor = DescriptorExtractor.create(DescriptorExtractor.SURF);
|
||||
|
||||
String filename = OpenCVTestRunner.getTempFileName("yml");
|
||||
//writeFile(filename, "%YAML:1.0\nhessianThreshold: 8000.\noctaves: 3\noctaveLayers: 4\nupright: 0\n");
|
||||
writeFile(filename, "%YAML:1.0\nname: \"Feature2D.SURF\"\nextended: 1\nhessianThreshold: 8000.\nnOctaveLayers: 2\nnOctaves: 3\nupright: 0\n");
|
||||
detector.read(filename);
|
||||
|
||||
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));
|
||||
Imgproc.line(cross, new Point(30, matSize / 2), new Point(matSize - 31, matSize / 2), new Scalar(100), 3);
|
||||
Imgproc.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();
|
||||
MatOfKeyPoint keypoints = new MatOfKeyPoint(new KeyPoint(50, 50, 16, 0, 20000, 1, -1), new KeyPoint(42, 42, 16, 160, 10000, 1, -1));
|
||||
Mat descriptors = new Mat();
|
||||
|
||||
DescriptorExtractor extractor = DescriptorExtractor.create(DescriptorExtractor.SURF);
|
||||
|
||||
extractor.compute(img, keypoints, descriptors);
|
||||
|
||||
return descriptors;
|
||||
}
|
||||
|
||||
private Mat getTrainImg() {
|
||||
Mat cross = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255));
|
||||
Imgproc.line(cross, new Point(20, matSize / 2), new Point(matSize - 21, matSize / 2), new Scalar(100), 2);
|
||||
Imgproc.line(cross, new Point(matSize / 2, 20), new Point(matSize / 2, matSize - 21), new Scalar(100), 2);
|
||||
|
||||
return cross;
|
||||
}
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE_L1);
|
||||
matSize = 100;
|
||||
|
||||
truth = new DMatch[] {
|
||||
new DMatch(0, 0, 0, 3.0975165f),
|
||||
new DMatch(1, 1, 0, 3.5680308f),
|
||||
new DMatch(2, 1, 0, 1.3722466f),
|
||||
new DMatch(3, 1, 0, 1.3041023f),
|
||||
new DMatch(4, 1, 0, 3.5970376f)
|
||||
};
|
||||
}
|
||||
|
||||
public void testAdd() {
|
||||
matcher.add(Arrays.asList(new Mat()));
|
||||
assertFalse(matcher.empty());
|
||||
}
|
||||
|
||||
public void testClear() {
|
||||
matcher.add(Arrays.asList(new Mat()));
|
||||
|
||||
matcher.clear();
|
||||
|
||||
assertTrue(matcher.empty());
|
||||
}
|
||||
|
||||
public void testClone() {
|
||||
Mat train = new Mat(1, 1, CvType.CV_8U, new Scalar(123));
|
||||
Mat truth = train.clone();
|
||||
matcher.add(Arrays.asList(train));
|
||||
|
||||
DescriptorMatcher cloned = matcher.clone();
|
||||
|
||||
assertNotNull(cloned);
|
||||
|
||||
List<Mat> descriptors = cloned.getTrainDescriptors();
|
||||
assertEquals(1, descriptors.size());
|
||||
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);
|
||||
}
|
||||
|
||||
public void testEmpty() {
|
||||
assertTrue(matcher.empty());
|
||||
}
|
||||
|
||||
public void testGetTrainDescriptors() {
|
||||
Mat train = new Mat(1, 1, CvType.CV_8U, new Scalar(123));
|
||||
Mat truth = train.clone();
|
||||
matcher.add(Arrays.asList(train));
|
||||
|
||||
List<Mat> descriptors = matcher.getTrainDescriptors();
|
||||
|
||||
assertEquals(1, descriptors.size());
|
||||
assertMatEqual(truth, descriptors.get(0));
|
||||
}
|
||||
|
||||
public void testIsMaskSupported() {
|
||||
assertTrue(matcher.isMaskSupported());
|
||||
}
|
||||
|
||||
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();
|
||||
MatOfDMatch matches = new MatOfDMatch();
|
||||
matcher.add(Arrays.asList(train));
|
||||
|
||||
matcher.match(query, matches);
|
||||
|
||||
assertArrayDMatchEquals(truth, matches.toArray(), EPS);
|
||||
}
|
||||
|
||||
public void testMatchMatListOfDMatchListOfMat() {
|
||||
Mat train = getTrainDescriptors();
|
||||
Mat query = getQueryDescriptors();
|
||||
Mat mask = getMaskImg();
|
||||
MatOfDMatch matches = new MatOfDMatch();
|
||||
matcher.add(Arrays.asList(train));
|
||||
|
||||
matcher.match(query, matches, Arrays.asList(mask));
|
||||
|
||||
assertListDMatchEquals(Arrays.asList(truth[0], truth[1]), matches.toList(), EPS);
|
||||
}
|
||||
|
||||
public void testMatchMatMatListOfDMatch() {
|
||||
Mat train = getTrainDescriptors();
|
||||
Mat query = getQueryDescriptors();
|
||||
MatOfDMatch matches = new MatOfDMatch();
|
||||
|
||||
matcher.match(query, train, matches);
|
||||
|
||||
assertArrayDMatchEquals(truth, matches.toArray(), EPS);
|
||||
}
|
||||
|
||||
public void testMatchMatMatListOfDMatchMat() {
|
||||
Mat train = getTrainDescriptors();
|
||||
Mat query = getQueryDescriptors();
|
||||
Mat mask = getMaskImg();
|
||||
MatOfDMatch matches = new MatOfDMatch();
|
||||
|
||||
matcher.match(query, train, matches, mask);
|
||||
|
||||
assertListDMatchEquals(Arrays.asList(truth[0], truth[1]), matches.toList(), 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");
|
||||
|
||||
matcher.read(filename);
|
||||
assertTrue(true);// BruteforceMatcher has no settings
|
||||
}
|
||||
|
||||
public void testTrain() {
|
||||
matcher.train();// BruteforceMatcher does not need to train
|
||||
}
|
||||
|
||||
public void testWrite() {
|
||||
String filename = OpenCVTestRunner.getTempFileName("yml");
|
||||
|
||||
matcher.write(filename);
|
||||
|
||||
String truth = "%YAML:1.0\n";
|
||||
assertEquals(truth, readFile(filename));
|
||||
}
|
||||
|
||||
}
|
@@ -1,281 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.opencv.core.Core;
|
||||
import org.opencv.core.CvType;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.MatOfDMatch;
|
||||
import org.opencv.core.MatOfKeyPoint;
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.Scalar;
|
||||
import org.opencv.core.DMatch;
|
||||
import org.opencv.features2d.DescriptorExtractor;
|
||||
import org.opencv.features2d.DescriptorMatcher;
|
||||
import org.opencv.features2d.FeatureDetector;
|
||||
import org.opencv.core.KeyPoint;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
import org.opencv.test.OpenCVTestRunner;
|
||||
import org.opencv.imgproc.Imgproc;
|
||||
|
||||
public class BruteForceSL2DescriptorMatcherTest extends OpenCVTestCase {
|
||||
|
||||
DescriptorMatcher matcher;
|
||||
int matSize;
|
||||
DMatch[] truth;
|
||||
|
||||
private Mat getMaskImg() {
|
||||
return new Mat(5, 2, CvType.CV_8U, new Scalar(0)) {
|
||||
{
|
||||
put(0, 0, 1, 1, 1, 1);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
private float sqr(float val){
|
||||
return val * val;
|
||||
}
|
||||
*/
|
||||
|
||||
private Mat getQueryDescriptors() {
|
||||
Mat img = getQueryImg();
|
||||
MatOfKeyPoint keypoints = new MatOfKeyPoint();
|
||||
Mat descriptors = new Mat();
|
||||
|
||||
FeatureDetector detector = FeatureDetector.create(FeatureDetector.SURF);
|
||||
DescriptorExtractor extractor = DescriptorExtractor.create(DescriptorExtractor.SURF);
|
||||
|
||||
String filename = OpenCVTestRunner.getTempFileName("yml");
|
||||
writeFile(filename, "%YAML:1.0\nhessianThreshold: 8000.\noctaves: 3\noctaveLayers: 4\nupright: 0\n");
|
||||
detector.read(filename);
|
||||
|
||||
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));
|
||||
Imgproc.line(cross, new Point(30, matSize / 2), new Point(matSize - 31, matSize / 2), new Scalar(100), 3);
|
||||
Imgproc.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();
|
||||
MatOfKeyPoint keypoints = new MatOfKeyPoint(new KeyPoint(50, 50, 16, 0, 20000, 1, -1), new KeyPoint(42, 42, 16, 160, 10000, 1, -1));
|
||||
Mat descriptors = new Mat();
|
||||
|
||||
DescriptorExtractor extractor = DescriptorExtractor.create(DescriptorExtractor.SURF);
|
||||
|
||||
extractor.compute(img, keypoints, descriptors);
|
||||
|
||||
return descriptors;
|
||||
}
|
||||
|
||||
private Mat getTrainImg() {
|
||||
Mat cross = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255));
|
||||
Imgproc.line(cross, new Point(20, matSize / 2), new Point(matSize - 21, matSize / 2), new Scalar(100), 2);
|
||||
Imgproc.line(cross, new Point(matSize / 2, 20), new Point(matSize / 2, matSize - 21), new Scalar(100), 2);
|
||||
|
||||
return cross;
|
||||
}
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE_SL2);
|
||||
matSize = 100;
|
||||
|
||||
truth = new DMatch[] {
|
||||
new DMatch(0, 0, 0, 0.3858146f),
|
||||
new DMatch(1, 1, 0, 0.8421953f),
|
||||
new DMatch(2, 1, 0, 0.0968556f),
|
||||
new DMatch(3, 1, 0, 0.0855606f),
|
||||
new DMatch(4, 1, 0, 0.8666080f)
|
||||
};
|
||||
}
|
||||
|
||||
public void testAdd() {
|
||||
matcher.add(Arrays.asList(new Mat()));
|
||||
assertFalse(matcher.empty());
|
||||
}
|
||||
|
||||
public void testClear() {
|
||||
matcher.add(Arrays.asList(new Mat()));
|
||||
|
||||
matcher.clear();
|
||||
|
||||
assertTrue(matcher.empty());
|
||||
}
|
||||
|
||||
public void testClone() {
|
||||
Mat train = new Mat(1, 1, CvType.CV_8U, new Scalar(123));
|
||||
Mat truth = train.clone();
|
||||
matcher.add(Arrays.asList(train));
|
||||
|
||||
DescriptorMatcher cloned = matcher.clone();
|
||||
|
||||
assertNotNull(cloned);
|
||||
|
||||
List<Mat> descriptors = cloned.getTrainDescriptors();
|
||||
assertEquals(1, descriptors.size());
|
||||
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);
|
||||
}
|
||||
|
||||
public void testEmpty() {
|
||||
assertTrue(matcher.empty());
|
||||
}
|
||||
|
||||
public void testGetTrainDescriptors() {
|
||||
Mat train = new Mat(1, 1, CvType.CV_8U, new Scalar(123));
|
||||
Mat truth = train.clone();
|
||||
matcher.add(Arrays.asList(train));
|
||||
|
||||
List<Mat> descriptors = matcher.getTrainDescriptors();
|
||||
|
||||
assertEquals(1, descriptors.size());
|
||||
assertMatEqual(truth, descriptors.get(0));
|
||||
}
|
||||
|
||||
public void testIsMaskSupported() {
|
||||
assertTrue(matcher.isMaskSupported());
|
||||
}
|
||||
|
||||
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();
|
||||
MatOfDMatch matches = new MatOfDMatch();
|
||||
matcher.add(Arrays.asList(train));
|
||||
|
||||
matcher.match(query, matches);
|
||||
OpenCVTestRunner.Log(matches);
|
||||
OpenCVTestRunner.Log(matches);
|
||||
OpenCVTestRunner.Log(matches);
|
||||
|
||||
assertArrayDMatchEquals(truth, matches.toArray(), EPS);
|
||||
}
|
||||
|
||||
public void testMatchMatListOfDMatchListOfMat() {
|
||||
Mat train = getTrainDescriptors();
|
||||
Mat query = getQueryDescriptors();
|
||||
Mat mask = getMaskImg();
|
||||
MatOfDMatch matches = new MatOfDMatch();
|
||||
matcher.add(Arrays.asList(train));
|
||||
|
||||
matcher.match(query, matches, Arrays.asList(mask));
|
||||
|
||||
assertListDMatchEquals(Arrays.asList(truth[0], truth[1]), matches.toList(), EPS);
|
||||
}
|
||||
|
||||
public void testMatchMatMatListOfDMatch() {
|
||||
Mat train = getTrainDescriptors();
|
||||
Mat query = getQueryDescriptors();
|
||||
MatOfDMatch matches = new MatOfDMatch();
|
||||
|
||||
matcher.match(query, train, matches);
|
||||
|
||||
assertArrayDMatchEquals(truth, matches.toArray(), 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();
|
||||
MatOfDMatch matches = new MatOfDMatch();
|
||||
|
||||
matcher.match(query, train, matches, mask);
|
||||
|
||||
assertListDMatchEquals(Arrays.asList(truth[0], truth[1]), matches.toList(), 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");
|
||||
|
||||
matcher.read(filename);
|
||||
assertTrue(true);// BruteforceMatcher has no settings
|
||||
}
|
||||
|
||||
public void testTrain() {
|
||||
matcher.train();// BruteforceMatcher does not need to train
|
||||
}
|
||||
|
||||
public void testWrite() {
|
||||
String filename = OpenCVTestRunner.getTempFileName("yml");
|
||||
|
||||
matcher.write(filename);
|
||||
|
||||
String truth = "%YAML:1.0\n";
|
||||
assertEquals(truth, readFile(filename));
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class DENSEFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class DynamicDENSEFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class DynamicFASTFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class DynamicGFTTFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class DynamicHARRISFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class DynamicMSERFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class DynamicORBFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class DynamicSIFTFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class DynamicSIMPLEBLOBFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class DynamicSTARFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class DynamicSURFFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,146 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.opencv.core.Core;
|
||||
import org.opencv.core.CvType;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.MatOfKeyPoint;
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.Scalar;
|
||||
import org.opencv.features2d.FeatureDetector;
|
||||
import org.opencv.core.KeyPoint;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
import org.opencv.test.OpenCVTestRunner;
|
||||
import org.opencv.imgproc.Imgproc;
|
||||
|
||||
public class FASTFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
FeatureDetector detector;
|
||||
KeyPoint[] truth;
|
||||
|
||||
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() {
|
||||
Mat img = new Mat(100, 100, CvType.CV_8U, new Scalar(255));
|
||||
Imgproc.line(img, new Point(30, 30), new Point(70, 70), new Scalar(0), 8);
|
||||
return img;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
detector = FeatureDetector.create(FeatureDetector.FAST);
|
||||
truth = new KeyPoint[] { new KeyPoint(32, 27, 7, -1, 254, 0, -1), new KeyPoint(27, 32, 7, -1, 254, 0, -1), new KeyPoint(73, 68, 7, -1, 254, 0, -1),
|
||||
new KeyPoint(68, 73, 7, -1, 254, 0, -1) };
|
||||
}
|
||||
|
||||
public void testCreate() {
|
||||
assertNotNull(detector);
|
||||
}
|
||||
|
||||
public void testDetectListOfMatListOfListOfKeyPoint() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMatListOfKeyPoint() {
|
||||
Mat img = getTestImg();
|
||||
MatOfKeyPoint keypoints = new MatOfKeyPoint();
|
||||
|
||||
detector.detect(img, keypoints);
|
||||
|
||||
assertListKeyPointEquals(Arrays.asList(truth), keypoints.toList(), EPS);
|
||||
|
||||
// OpenCVTestRunner.Log("points found: " + keypoints.size());
|
||||
// for (KeyPoint kp : keypoints)
|
||||
// OpenCVTestRunner.Log(kp.toString());
|
||||
}
|
||||
|
||||
public void testDetectMatListOfKeyPointMat() {
|
||||
Mat img = getTestImg();
|
||||
Mat mask = getMaskImg();
|
||||
MatOfKeyPoint keypoints = new MatOfKeyPoint();
|
||||
|
||||
detector.detect(img, keypoints, mask);
|
||||
|
||||
assertListKeyPointEquals(Arrays.asList(truth[0], truth[1]), keypoints.toList(), EPS);
|
||||
}
|
||||
|
||||
public void testEmpty() {
|
||||
assertFalse(detector.empty());
|
||||
}
|
||||
|
||||
public void testRead() {
|
||||
String filename = OpenCVTestRunner.getTempFileName("yml");
|
||||
|
||||
writeFile(filename, "%YAML:1.0\nthreshold: 130\nnonmaxSuppression: 1\n");
|
||||
detector.read(filename);
|
||||
|
||||
MatOfKeyPoint keypoints1 = new MatOfKeyPoint();
|
||||
|
||||
detector.detect(grayChess, keypoints1);
|
||||
|
||||
writeFile(filename, "%YAML:1.0\nthreshold: 150\nnonmaxSuppression: 1\n");
|
||||
detector.read(filename);
|
||||
|
||||
MatOfKeyPoint keypoints2 = new MatOfKeyPoint();
|
||||
|
||||
detector.detect(grayChess, keypoints2);
|
||||
|
||||
assertTrue(keypoints2.total() <= keypoints1.total());
|
||||
}
|
||||
|
||||
public void testReadYml() {
|
||||
String filename = OpenCVTestRunner.getTempFileName("yml");
|
||||
|
||||
writeFile(filename,
|
||||
"<?xml version=\"1.0\"?>\n<opencv_storage>\n<threshold>130</threshold>\n<nonmaxSuppression>1</nonmaxSuppression>\n</opencv_storage>\n");
|
||||
detector.read(filename);
|
||||
|
||||
MatOfKeyPoint keypoints1 = new MatOfKeyPoint();
|
||||
|
||||
detector.detect(grayChess, keypoints1);
|
||||
|
||||
writeFile(filename,
|
||||
"<?xml version=\"1.0\"?>\n<opencv_storage>\n<threshold>150</threshold>\n<nonmaxSuppression>1</nonmaxSuppression>\n</opencv_storage>\n");
|
||||
detector.read(filename);
|
||||
|
||||
MatOfKeyPoint keypoints2 = new MatOfKeyPoint();
|
||||
|
||||
detector.detect(grayChess, keypoints2);
|
||||
|
||||
assertTrue(keypoints2.total() <= keypoints1.total());
|
||||
}
|
||||
|
||||
public void testWrite() {
|
||||
String filename = OpenCVTestRunner.getTempFileName("xml");
|
||||
|
||||
detector.write(filename);
|
||||
|
||||
String truth = "<?xml version=\"1.0\"?>\n<opencv_storage>\n<name>Feature2D.FAST</name>\n<nonmaxSuppression>1</nonmaxSuppression>\n<threshold>10</threshold>\n<type>2</type>\n</opencv_storage>\n";
|
||||
String data = readFile(filename);
|
||||
//Log.d("qqq", "\"" + data + "\"");
|
||||
assertEquals(truth, data);
|
||||
}
|
||||
|
||||
public void testWriteYml() {
|
||||
String filename = OpenCVTestRunner.getTempFileName("yml");
|
||||
|
||||
detector.write(filename);
|
||||
|
||||
String truth = "%YAML:1.0\nname: \"Feature2D.FAST\"\nnonmaxSuppression: 1\nthreshold: 10\ntype: 2\n";
|
||||
String data = readFile(filename);
|
||||
|
||||
//Log.d("qqq", "\"" + data + "\"");
|
||||
assertEquals(truth, data);
|
||||
}
|
||||
}
|
@@ -1,145 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.opencv.calib3d.Calib3d;
|
||||
import org.opencv.core.CvType;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.MatOfDMatch;
|
||||
import org.opencv.core.MatOfKeyPoint;
|
||||
import org.opencv.core.MatOfPoint2f;
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.Range;
|
||||
import org.opencv.core.DMatch;
|
||||
import org.opencv.features2d.DescriptorExtractor;
|
||||
import org.opencv.features2d.DescriptorMatcher;
|
||||
import org.opencv.features2d.FeatureDetector;
|
||||
import org.opencv.features2d.Features2d;
|
||||
import org.opencv.core.KeyPoint;
|
||||
import org.opencv.imgcodecs.Imgcodecs;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
import org.opencv.test.OpenCVTestRunner;
|
||||
|
||||
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 = Imgcodecs.imread(OpenCVTestRunner.LENA_PATH, Imgcodecs.CV_LOAD_IMAGE_GRAYSCALE);
|
||||
Mat imgQuery = imgTrain.submat(new Range(0, imgTrain.rows() - 100), Range.all());
|
||||
|
||||
MatOfKeyPoint trainKeypoints = new MatOfKeyPoint();
|
||||
MatOfKeyPoint queryKeypoints = new MatOfKeyPoint();
|
||||
|
||||
detector.detect(imgTrain, trainKeypoints);
|
||||
detector.detect(imgQuery, queryKeypoints);
|
||||
|
||||
// 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);
|
||||
|
||||
MatOfDMatch matches = new MatOfDMatch();
|
||||
|
||||
matcher.add(Arrays.asList(trainDescriptors));
|
||||
matcher.match(queryDescriptors, matches);
|
||||
|
||||
// OpenCVTestRunner.Log("Matches found: " + matches.size());
|
||||
|
||||
DMatch adm[] = matches.toArray();
|
||||
List<Point> lp1 = new ArrayList<Point>(adm.length);
|
||||
List<Point> lp2 = new ArrayList<Point>(adm.length);
|
||||
KeyPoint tkp[] = trainKeypoints.toArray();
|
||||
KeyPoint qkp[] = queryKeypoints.toArray();
|
||||
for (int i = 0; i < adm.length; i++) {
|
||||
DMatch dm = adm[i];
|
||||
lp1.add(tkp[dm.trainIdx].pt);
|
||||
lp2.add(qkp[dm.queryIdx].pt);
|
||||
}
|
||||
|
||||
MatOfPoint2f points1 = new MatOfPoint2f(lp1.toArray(new Point[0]));
|
||||
MatOfPoint2f points2 = new MatOfPoint2f(lp2.toArray(new Point[0]));
|
||||
|
||||
Mat hmg = Calib3d.findHomography(points1, points2, Calib3d.RANSAC, 3);
|
||||
|
||||
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");
|
||||
Imgcodecs.imwrite(outputPath, outimg);
|
||||
// OpenCVTestRunner.Log("Output image is saved to: " + outputPath);
|
||||
}
|
||||
}
|
@@ -1,127 +0,0 @@
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,366 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.opencv.core.Core;
|
||||
import org.opencv.core.CvException;
|
||||
import org.opencv.core.CvType;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.MatOfDMatch;
|
||||
import org.opencv.core.MatOfKeyPoint;
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.Scalar;
|
||||
import org.opencv.core.DMatch;
|
||||
import org.opencv.features2d.DescriptorExtractor;
|
||||
import org.opencv.features2d.DescriptorMatcher;
|
||||
import org.opencv.features2d.FeatureDetector;
|
||||
import org.opencv.core.KeyPoint;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
import org.opencv.test.OpenCVTestRunner;
|
||||
import org.opencv.imgproc.Imgproc;
|
||||
|
||||
public class FlannBasedDescriptorMatcherTest extends OpenCVTestCase {
|
||||
|
||||
static final String xmlParamsDefault = "<?xml version=\"1.0\"?>\n"
|
||||
+ "<opencv_storage>\n"
|
||||
+ "<indexParams>\n"
|
||||
+ " <_>\n"
|
||||
+ " <name>algorithm</name>\n"
|
||||
+ " <type>23</type>\n"
|
||||
+ " <value>1</value></_>\n"
|
||||
+ " <_>\n"
|
||||
+ " <name>trees</name>\n"
|
||||
+ " <type>4</type>\n"
|
||||
+ " <value>4</value></_></indexParams>\n"
|
||||
+ "<searchParams>\n"
|
||||
+ " <_>\n"
|
||||
+ " <name>checks</name>\n"
|
||||
+ " <type>4</type>\n"
|
||||
+ " <value>32</value></_>\n"
|
||||
+ " <_>\n"
|
||||
+ " <name>eps</name>\n"
|
||||
+ " <type>5</type>\n"
|
||||
+ " <value>0.</value></_>\n"
|
||||
+ " <_>\n"
|
||||
+ " <name>sorted</name>\n"
|
||||
+ " <type>15</type>\n"
|
||||
+ " <value>1</value></_></searchParams>\n"
|
||||
+ "</opencv_storage>\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: 4.\n"// this line is changed!
|
||||
+ " -\n"
|
||||
+ " name: sorted\n"
|
||||
+ " type: 15\n"
|
||||
+ " value: 1\n";
|
||||
|
||||
DescriptorMatcher matcher;
|
||||
|
||||
int matSize;
|
||||
|
||||
DMatch[] truth;
|
||||
|
||||
private Mat getMaskImg() {
|
||||
return new Mat(5, 2, CvType.CV_8U, new Scalar(0)) {
|
||||
{
|
||||
put(0, 0, 1, 1, 1, 1);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private Mat getQueryDescriptors() {
|
||||
Mat img = getQueryImg();
|
||||
MatOfKeyPoint keypoints = new MatOfKeyPoint();
|
||||
Mat descriptors = new Mat();
|
||||
|
||||
FeatureDetector detector = FeatureDetector.create(FeatureDetector.SURF);
|
||||
DescriptorExtractor extractor = DescriptorExtractor.create(DescriptorExtractor.SURF);
|
||||
|
||||
String filename = OpenCVTestRunner.getTempFileName("yml");
|
||||
writeFile(filename, "%YAML:1.0\nhessianThreshold: 8000.\noctaves: 3\noctaveLayers: 4\nupright: 0\n");
|
||||
detector.read(filename);
|
||||
|
||||
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));
|
||||
Imgproc.line(cross, new Point(30, matSize / 2), new Point(matSize - 31, matSize / 2), new Scalar(100), 3);
|
||||
Imgproc.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();
|
||||
MatOfKeyPoint keypoints = new MatOfKeyPoint(new KeyPoint(50, 50, 16, 0, 20000, 1, -1), new KeyPoint(42, 42, 16, 160, 10000, 1, -1));
|
||||
Mat descriptors = new Mat();
|
||||
|
||||
DescriptorExtractor extractor = DescriptorExtractor.create(DescriptorExtractor.SURF);
|
||||
|
||||
extractor.compute(img, keypoints, descriptors);
|
||||
|
||||
return descriptors;
|
||||
}
|
||||
|
||||
private Mat getTrainImg() {
|
||||
Mat cross = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255));
|
||||
Imgproc.line(cross, new Point(20, matSize / 2), new Point(matSize - 21, matSize / 2), new Scalar(100), 2);
|
||||
Imgproc.line(cross, new Point(matSize / 2, 20), new Point(matSize / 2, matSize - 21), new Scalar(100), 2);
|
||||
|
||||
return cross;
|
||||
}
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
matcher = DescriptorMatcher.create(DescriptorMatcher.FLANNBASED);
|
||||
matSize = 100;
|
||||
truth = new DMatch[] {
|
||||
new DMatch(0, 0, 0, 0.6211397f),
|
||||
new DMatch(1, 1, 0, 0.9177120f),
|
||||
new DMatch(2, 1, 0, 0.3112163f),
|
||||
new DMatch(3, 1, 0, 0.2925075f),
|
||||
new DMatch(4, 1, 0, 0.9309179f)
|
||||
};
|
||||
}
|
||||
|
||||
public void testAdd() {
|
||||
matcher.add(Arrays.asList(new Mat()));
|
||||
assertFalse(matcher.empty());
|
||||
}
|
||||
|
||||
public void testClear() {
|
||||
matcher.add(Arrays.asList(new Mat()));
|
||||
|
||||
matcher.clear();
|
||||
|
||||
assertTrue(matcher.empty());
|
||||
}
|
||||
|
||||
public void testClone() {
|
||||
Mat train = new Mat(1, 1, CvType.CV_8U, new Scalar(123));
|
||||
matcher.add(Arrays.asList(train));
|
||||
|
||||
try {
|
||||
matcher.clone();
|
||||
fail("Expected CvException (CV_StsNotImplemented)");
|
||||
} catch (CvException cverr) {
|
||||
// expected
|
||||
}
|
||||
}
|
||||
|
||||
public void testCloneBoolean() {
|
||||
matcher.add(Arrays.asList(new Mat()));
|
||||
|
||||
DescriptorMatcher cloned = matcher.clone(true);
|
||||
|
||||
assertNotNull(cloned);
|
||||
assertTrue(cloned.empty());
|
||||
}
|
||||
|
||||
public void testCreate() {
|
||||
assertNotNull(matcher);
|
||||
}
|
||||
|
||||
public void testEmpty() {
|
||||
assertTrue(matcher.empty());
|
||||
}
|
||||
|
||||
public void testGetTrainDescriptors() {
|
||||
Mat train = new Mat(1, 1, CvType.CV_8U, new Scalar(123));
|
||||
Mat truth = train.clone();
|
||||
matcher.add(Arrays.asList(train));
|
||||
|
||||
List<Mat> descriptors = matcher.getTrainDescriptors();
|
||||
|
||||
assertEquals(1, descriptors.size());
|
||||
assertMatEqual(truth, descriptors.get(0));
|
||||
}
|
||||
|
||||
public void testIsMaskSupported() {
|
||||
assertFalse(matcher.isMaskSupported());
|
||||
}
|
||||
|
||||
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();
|
||||
MatOfDMatch matches = new MatOfDMatch();
|
||||
matcher.add(Arrays.asList(train));
|
||||
matcher.train();
|
||||
|
||||
matcher.match(query, matches);
|
||||
|
||||
assertArrayDMatchEquals(truth, matches.toArray(), EPS);
|
||||
}
|
||||
|
||||
public void testMatchMatListOfDMatchListOfMat() {
|
||||
Mat train = getTrainDescriptors();
|
||||
Mat query = getQueryDescriptors();
|
||||
Mat mask = getMaskImg();
|
||||
MatOfDMatch matches = new MatOfDMatch();
|
||||
matcher.add(Arrays.asList(train));
|
||||
matcher.train();
|
||||
|
||||
matcher.match(query, matches, Arrays.asList(mask));
|
||||
|
||||
assertArrayDMatchEquals(truth, matches.toArray(), EPS);
|
||||
}
|
||||
|
||||
public void testMatchMatMatListOfDMatch() {
|
||||
Mat train = getTrainDescriptors();
|
||||
Mat query = getQueryDescriptors();
|
||||
MatOfDMatch matches = new MatOfDMatch();
|
||||
|
||||
matcher.match(query, train, matches);
|
||||
|
||||
assertArrayDMatchEquals(truth, matches.toArray(), EPS);
|
||||
|
||||
// OpenCVTestRunner.Log(matches.toString());
|
||||
// OpenCVTestRunner.Log(matches);
|
||||
}
|
||||
|
||||
public void testMatchMatMatListOfDMatchMat() {
|
||||
Mat train = getTrainDescriptors();
|
||||
Mat query = getQueryDescriptors();
|
||||
Mat mask = getMaskImg();
|
||||
MatOfDMatch matches = new MatOfDMatch();
|
||||
|
||||
matcher.match(query, train, matches, mask);
|
||||
|
||||
assertListDMatchEquals(Arrays.asList(truth), matches.toList(), 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 filenameR = OpenCVTestRunner.getTempFileName("yml");
|
||||
String filenameW = OpenCVTestRunner.getTempFileName("yml");
|
||||
writeFile(filenameR, ymlParamsModified);
|
||||
|
||||
matcher.read(filenameR);
|
||||
matcher.write(filenameW);
|
||||
|
||||
assertEquals(ymlParamsModified, readFile(filenameW));
|
||||
}
|
||||
|
||||
public void testTrain() {
|
||||
Mat train = getTrainDescriptors();
|
||||
matcher.add(Arrays.asList(train));
|
||||
matcher.train();
|
||||
}
|
||||
|
||||
public void testTrainNoData() {
|
||||
try {
|
||||
matcher.train();
|
||||
fail("Expected CvException - FlannBasedMatcher::train should fail on empty train set");
|
||||
} catch (CvException cverr) {
|
||||
// expected
|
||||
}
|
||||
}
|
||||
|
||||
public void testWrite() {
|
||||
String filename = OpenCVTestRunner.getTempFileName("xml");
|
||||
|
||||
matcher.write(filename);
|
||||
|
||||
assertEquals(xmlParamsDefault, readFile(filename));
|
||||
}
|
||||
|
||||
public void testWriteYml() {
|
||||
String filename = OpenCVTestRunner.getTempFileName("yml");
|
||||
|
||||
matcher.write(filename);
|
||||
|
||||
assertEquals(ymlParamsDefault, readFile(filename));
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class GFTTFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class GridDENSEFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class GridFASTFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class GridGFTTFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class GridHARRISFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class GridMSERFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class GridORBFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class GridSIFTFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class GridSIMPLEBLOBFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class GridSTARFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class GridSURFFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class HARRISFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class MSERFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,120 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.core.Core;
|
||||
import org.opencv.core.CvType;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.MatOfKeyPoint;
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.Scalar;
|
||||
import org.opencv.features2d.DescriptorExtractor;
|
||||
import org.opencv.core.KeyPoint;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
import org.opencv.test.OpenCVTestRunner;
|
||||
import org.opencv.imgproc.Imgproc;
|
||||
|
||||
public class ORBDescriptorExtractorTest extends OpenCVTestCase {
|
||||
|
||||
DescriptorExtractor extractor;
|
||||
int matSize;
|
||||
|
||||
public static void assertDescriptorsClose(Mat expected, Mat actual, int allowedDistance) {
|
||||
double distance = Core.norm(expected, actual, Core.NORM_HAMMING);
|
||||
assertTrue("expected:<" + allowedDistance + "> but was:<" + distance + ">", distance <= allowedDistance);
|
||||
}
|
||||
|
||||
private Mat getTestImg() {
|
||||
Mat cross = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255));
|
||||
Imgproc.line(cross, new Point(20, matSize / 2), new Point(matSize - 21, matSize / 2), new Scalar(100), 2);
|
||||
Imgproc.line(cross, new Point(matSize / 2, 20), new Point(matSize / 2, matSize - 21), new Scalar(100), 2);
|
||||
|
||||
return cross;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
extractor = DescriptorExtractor.create(DescriptorExtractor.ORB);
|
||||
matSize = 100;
|
||||
}
|
||||
|
||||
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);
|
||||
MatOfKeyPoint keypoints = new MatOfKeyPoint(point);
|
||||
Mat img = getTestImg();
|
||||
Mat descriptors = new Mat();
|
||||
|
||||
extractor.compute(img, keypoints, descriptors);
|
||||
|
||||
Mat truth = new Mat(1, 32, CvType.CV_8UC1) {
|
||||
{
|
||||
put(0, 0,
|
||||
6, 74, 6, 129, 2, 130, 56, 0, 36, 132, 66, 165, 172, 6, 3, 72, 102, 61, 163, 214, 0, 144, 65, 232, 4, 32, 138, 129, 4, 21, 37, 88);
|
||||
}
|
||||
};
|
||||
assertDescriptorsClose(truth, descriptors, 1);
|
||||
}
|
||||
|
||||
public void testCreate() {
|
||||
assertNotNull(extractor);
|
||||
}
|
||||
|
||||
public void testDescriptorSize() {
|
||||
assertEquals(32, extractor.descriptorSize());
|
||||
}
|
||||
|
||||
public void testDescriptorType() {
|
||||
assertEquals(CvType.CV_8U, extractor.descriptorType());
|
||||
}
|
||||
|
||||
public void testEmpty() {
|
||||
assertFalse(extractor.empty());
|
||||
}
|
||||
|
||||
public void testRead() {
|
||||
KeyPoint point = new KeyPoint(55.775577545166016f, 44.224422454833984f, 16, 9.754629f, 8617.863f, 1, -1);
|
||||
MatOfKeyPoint keypoints = new MatOfKeyPoint(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,
|
||||
6, 10, 22, 5, 2, 130, 56, 0, 44, 164, 66, 165, 140, 6, 1, 72, 38, 61, 163, 210, 0, 208, 1, 104, 4, 32, 10, 131, 0, 37, 37, 67);
|
||||
}
|
||||
};
|
||||
assertDescriptorsClose(truth, descriptors, 1);
|
||||
}
|
||||
|
||||
public void testWrite() {
|
||||
String filename = OpenCVTestRunner.getTempFileName("xml");
|
||||
|
||||
extractor.write(filename);
|
||||
|
||||
String truth = "<?xml version=\"1.0\"?>\n<opencv_storage>\n<name>Feature2D.ORB</name>\n<WTA_K>2</WTA_K>\n<edgeThreshold>31</edgeThreshold>\n<firstLevel>0</firstLevel>\n<nFeatures>500</nFeatures>\n<nLevels>8</nLevels>\n<patchSize>31</patchSize>\n<scaleFactor>1.2000000476837158e+00</scaleFactor>\n<scoreType>0</scoreType>\n</opencv_storage>\n";
|
||||
String actual = readFile(filename);
|
||||
actual = actual.replaceAll("e\\+000", "e+00"); // NOTE: workaround for different platforms double representation
|
||||
assertEquals(truth, actual);
|
||||
}
|
||||
|
||||
public void testWriteYml() {
|
||||
String filename = OpenCVTestRunner.getTempFileName("yml");
|
||||
|
||||
extractor.write(filename);
|
||||
|
||||
String truth = "%YAML:1.0\nname: \"Feature2D.ORB\"\nWTA_K: 2\nedgeThreshold: 31\nfirstLevel: 0\nnFeatures: 500\nnLevels: 8\npatchSize: 31\nscaleFactor: 1.2000000476837158e+00\nscoreType: 0\n";
|
||||
String actual = readFile(filename);
|
||||
actual = actual.replaceAll("e\\+000", "e+00"); // NOTE: workaround for different platforms double representation
|
||||
assertEquals(truth, actual);
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class ORBFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,127 +0,0 @@
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class OpponentBRIEFDescriptorExtractorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class OpponentORBDescriptorExtractorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class OpponentSIFTDescriptorExtractorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class OpponentSURFDescriptorExtractorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class PyramidDENSEFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class PyramidFASTFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class PyramidGFTTFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class PyramidHARRISFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class PyramidMSERFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class PyramidORBFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class PyramidSIFTFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class PyramidSIMPLEBLOBFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class PyramidSTARFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class PyramidSURFFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,107 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.core.Core;
|
||||
import org.opencv.core.CvType;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.MatOfKeyPoint;
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.Scalar;
|
||||
import org.opencv.features2d.DescriptorExtractor;
|
||||
import org.opencv.core.KeyPoint;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
import org.opencv.test.OpenCVTestRunner;
|
||||
import org.opencv.imgproc.Imgproc;
|
||||
|
||||
public class SIFTDescriptorExtractorTest extends OpenCVTestCase {
|
||||
|
||||
DescriptorExtractor extractor;
|
||||
KeyPoint keypoint;
|
||||
int matSize;
|
||||
Mat truth;
|
||||
|
||||
private Mat getTestImg() {
|
||||
Mat cross = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255));
|
||||
Imgproc.line(cross, new Point(20, matSize / 2), new Point(matSize - 21, matSize / 2), new Scalar(100), 2);
|
||||
Imgproc.line(cross, new Point(matSize / 2, 20), new Point(matSize / 2, matSize - 21), new Scalar(100), 2);
|
||||
|
||||
return cross;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
extractor = DescriptorExtractor.create(DescriptorExtractor.SIFT);
|
||||
keypoint = new KeyPoint(55.775577545166016f, 44.224422454833984f, 16, 9.754629f, 8617.863f, 1, -1);
|
||||
matSize = 100;
|
||||
truth = new Mat(1, 128, CvType.CV_32FC1) {
|
||||
{
|
||||
put(0, 0,
|
||||
0, 0, 0, 1, 3, 0, 0, 0, 15, 23, 22, 20, 24, 2, 0, 0, 7, 8, 2, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 16, 13, 2, 0, 0, 117,
|
||||
86, 79, 68, 117, 42, 5, 5, 79, 60, 117, 25, 9, 2, 28, 19, 11, 13,
|
||||
20, 2, 0, 0, 5, 8, 0, 0, 76, 58, 34, 31, 97, 16, 95, 49, 117, 92,
|
||||
117, 112, 117, 76, 117, 54, 117, 25, 29, 22, 117, 117, 16, 11, 14,
|
||||
1, 0, 0, 22, 26, 0, 0, 0, 0, 1, 4, 15, 2, 47, 8, 0, 0, 82, 56, 31,
|
||||
17, 81, 12, 0, 0, 26, 23, 18, 23, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public void testComputeListOfMatListOfListOfKeyPointListOfMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testComputeMatListOfKeyPointMat() {
|
||||
MatOfKeyPoint keypoints = new MatOfKeyPoint(keypoint);
|
||||
Mat img = getTestImg();
|
||||
Mat descriptors = new Mat();
|
||||
|
||||
extractor.compute(img, keypoints, descriptors);
|
||||
|
||||
assertMatEqual(truth, descriptors, EPS);
|
||||
}
|
||||
|
||||
public void testCreate() {
|
||||
assertNotNull(extractor);
|
||||
}
|
||||
|
||||
public void testDescriptorSize() {
|
||||
assertEquals(128, extractor.descriptorSize());
|
||||
}
|
||||
|
||||
public void testDescriptorType() {
|
||||
assertEquals(CvType.CV_32F, extractor.descriptorType());
|
||||
}
|
||||
|
||||
public void testEmpty() {
|
||||
assertFalse(extractor.empty());
|
||||
}
|
||||
|
||||
public void testRead() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testWrite() {
|
||||
String filename = OpenCVTestRunner.getTempFileName("xml");
|
||||
|
||||
extractor.write(filename);
|
||||
|
||||
String truth = "<?xml version=\"1.0\"?>\n<opencv_storage>\n<name>Feature2D.SIFT</name>\n<contrastThreshold>4.0000000000000001e-02</contrastThreshold>\n<edgeThreshold>10.</edgeThreshold>\n<nFeatures>0</nFeatures>\n<nOctaveLayers>3</nOctaveLayers>\n<sigma>1.6000000000000001e+00</sigma>\n</opencv_storage>\n";
|
||||
String actual = readFile(filename);
|
||||
actual = actual.replaceAll("e([+-])0(\\d\\d)", "e$1$2"); // NOTE: workaround for different platforms double representation
|
||||
assertEquals(truth, actual);
|
||||
}
|
||||
|
||||
public void testWriteYml() {
|
||||
String filename = OpenCVTestRunner.getTempFileName("yml");
|
||||
|
||||
extractor.write(filename);
|
||||
|
||||
String truth = "%YAML:1.0\nname: \"Feature2D.SIFT\"\ncontrastThreshold: 4.0000000000000001e-02\nedgeThreshold: 10.\nnFeatures: 0\nnOctaveLayers: 3\nsigma: 1.6000000000000001e+00\n";
|
||||
String actual = readFile(filename);
|
||||
actual = actual.replaceAll("e([+-])0(\\d\\d)", "e$1$2"); // NOTE: workaround for different platforms double representation
|
||||
assertEquals(truth, actual);
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class SIFTFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class SIMPLEBLOBFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,131 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.opencv.core.Core;
|
||||
import org.opencv.core.CvType;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.MatOfKeyPoint;
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.Scalar;
|
||||
import org.opencv.features2d.FeatureDetector;
|
||||
import org.opencv.core.KeyPoint;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
import org.opencv.test.OpenCVTestRunner;
|
||||
import org.opencv.imgproc.Imgproc;
|
||||
|
||||
public class STARFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
FeatureDetector detector;
|
||||
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));
|
||||
Imgproc.circle(img, new Point(center - offset, center), radius, color, -1);
|
||||
Imgproc.circle(img, new Point(center + offset, center), radius, color, -1);
|
||||
Imgproc.circle(img, new Point(center, center - offset), radius, color, -1);
|
||||
Imgproc.circle(img, new Point(center, center + offset), radius, color, -1);
|
||||
Imgproc.circle(img, new Point(center, center), radius, color, -1);
|
||||
return img;
|
||||
}
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
detector = FeatureDetector.create(FeatureDetector.STAR);
|
||||
matSize = 200;
|
||||
truth = new KeyPoint[] {
|
||||
new KeyPoint( 95, 80, 22, -1, 31.5957f, 0, -1),
|
||||
new KeyPoint(105, 80, 22, -1, 31.5957f, 0, -1),
|
||||
new KeyPoint( 80, 95, 22, -1, 31.5957f, 0, -1),
|
||||
new KeyPoint(120, 95, 22, -1, 31.5957f, 0, -1),
|
||||
new KeyPoint(100, 100, 8, -1, 30.f, 0, -1),
|
||||
new KeyPoint( 80, 105, 22, -1, 31.5957f, 0, -1),
|
||||
new KeyPoint(120, 105, 22, -1, 31.5957f, 0, -1),
|
||||
new KeyPoint( 95, 120, 22, -1, 31.5957f, 0, -1),
|
||||
new KeyPoint(105, 120, 22, -1, 31.5957f, 0, -1)
|
||||
};
|
||||
}
|
||||
|
||||
public void testCreate() {
|
||||
assertNotNull(detector);
|
||||
}
|
||||
|
||||
public void testDetectListOfMatListOfListOfKeyPoint() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMatListOfKeyPoint() {
|
||||
Mat img = getTestImg();
|
||||
MatOfKeyPoint keypoints = new MatOfKeyPoint();
|
||||
|
||||
detector.detect(img, keypoints);
|
||||
|
||||
assertListKeyPointEquals(Arrays.asList(truth), keypoints.toList(), EPS);
|
||||
}
|
||||
|
||||
public void testDetectMatListOfKeyPointMat() {
|
||||
Mat img = getTestImg();
|
||||
Mat mask = getMaskImg();
|
||||
MatOfKeyPoint keypoints = new MatOfKeyPoint();
|
||||
|
||||
detector.detect(img, keypoints, mask);
|
||||
|
||||
assertListKeyPointEquals(Arrays.asList(truth[0], truth[2], truth[5], truth[7]), keypoints.toList(), EPS);
|
||||
}
|
||||
|
||||
public void testEmpty() {
|
||||
assertFalse(detector.empty());
|
||||
}
|
||||
|
||||
public void testRead() {
|
||||
Mat img = getTestImg();
|
||||
|
||||
MatOfKeyPoint keypoints1 = new MatOfKeyPoint();
|
||||
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);
|
||||
|
||||
MatOfKeyPoint keypoints2 = new MatOfKeyPoint();
|
||||
detector.detect(img, keypoints2);
|
||||
|
||||
assertTrue(keypoints2.total() <= keypoints1.total());
|
||||
}
|
||||
|
||||
public void testWrite() {
|
||||
String filename = OpenCVTestRunner.getTempFileName("xml");
|
||||
|
||||
detector.write(filename);
|
||||
|
||||
String truth = "<?xml version=\"1.0\"?>\n<opencv_storage>\n<name>Feature2D.STAR</name>\n<lineThresholdBinarized>8</lineThresholdBinarized>\n<lineThresholdProjected>10</lineThresholdProjected>\n<maxSize>45</maxSize>\n<responseThreshold>30</responseThreshold>\n<suppressNonmaxSize>5</suppressNonmaxSize>\n</opencv_storage>\n";
|
||||
assertEquals(truth, readFile(filename));
|
||||
}
|
||||
|
||||
public void testWriteYml() {
|
||||
String filename = OpenCVTestRunner.getTempFileName("yml");
|
||||
|
||||
detector.write(filename);
|
||||
|
||||
String truth = "%YAML:1.0\nname: \"Feature2D.STAR\"\nlineThresholdBinarized: 8\nlineThresholdProjected: 10\nmaxSize: 45\nresponseThreshold: 30\nsuppressNonmaxSize: 5\n";
|
||||
assertEquals(truth, readFile(filename));
|
||||
}
|
||||
|
||||
}
|
@@ -1,118 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import org.opencv.core.Core;
|
||||
import org.opencv.core.CvType;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.MatOfKeyPoint;
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.Scalar;
|
||||
import org.opencv.features2d.DescriptorExtractor;
|
||||
import org.opencv.core.KeyPoint;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
import org.opencv.test.OpenCVTestRunner;
|
||||
import org.opencv.imgproc.Imgproc;
|
||||
|
||||
public class SURFDescriptorExtractorTest extends OpenCVTestCase {
|
||||
|
||||
DescriptorExtractor extractor;
|
||||
int matSize;
|
||||
|
||||
private Mat getTestImg() {
|
||||
Mat cross = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255));
|
||||
Imgproc.line(cross, new Point(20, matSize / 2), new Point(matSize - 21, matSize / 2), new Scalar(100), 2);
|
||||
Imgproc.line(cross, new Point(matSize / 2, 20), new Point(matSize / 2, matSize - 21), new Scalar(100), 2);
|
||||
|
||||
return cross;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
extractor = DescriptorExtractor.create(DescriptorExtractor.SURF);
|
||||
String filename = OpenCVTestRunner.getTempFileName("yml");
|
||||
writeFile(filename, "%YAML:1.0\nextended: 1\nhessianThreshold: 100.\nnOctaveLayers: 2\nnOctaves: 4\nupright: 0");
|
||||
extractor.read(filename);
|
||||
|
||||
matSize = 100;
|
||||
}
|
||||
|
||||
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);
|
||||
MatOfKeyPoint keypoints = new MatOfKeyPoint(point);
|
||||
Mat img = getTestImg();
|
||||
Mat descriptors = new Mat();
|
||||
|
||||
extractor.compute(img, keypoints, descriptors);
|
||||
|
||||
Mat truth = new Mat(1, 128, CvType.CV_32FC1) {
|
||||
{
|
||||
put(0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0.058821894, 0.058821894, -0.045962855, 0.046261817, 0.0085156476,
|
||||
0.0085754395, -0.0064509804, 0.0064509804, 0.00044069235, 0.00044069235, 0, 0, 0.00025723741,
|
||||
0.00025723741, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.00025723741, 0.00025723741, -0.00044069235,
|
||||
0.00044069235, 0, 0, 0.36278215, 0.36278215, -0.24688604, 0.26173124, 0.052068226, 0.052662034,
|
||||
-0.032815345, 0.032815345, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.0064523756,
|
||||
0.0064523756, 0.0082002236, 0.0088908644, -0.059001274, 0.059001274, 0.045789491, 0.04648013,
|
||||
0.11961588, 0.22789426, -0.01322381, 0.18291828, -0.14042182, 0.23973691, 0.073782086, 0.23769434,
|
||||
-0.027880307, 0.027880307, 0.049587864, 0.049587864, -0.33991757, 0.33991757, 0.21437603, 0.21437603,
|
||||
-0.0020763327, 0.0020763327, 0.006245892, 0.006245892, -0.04067041, 0.04067041, 0.019361559,
|
||||
0.019361559, 0, 0, -0.0035977389, 0.0035977389, 0, 0, -0.00099993451, 0.00099993451, 0.040670406,
|
||||
0.040670406, -0.019361559, 0.019361559, 0.006245892, 0.006245892, -0.0020763327, 0.0020763327,
|
||||
-0.00034532088, 0.00034532088, 0, 0, 0, 0, 0.00034532088, 0.00034532088, -0.00099993451,
|
||||
0.00099993451, 0, 0, 0, 0, 0.0035977389, 0.0035977389
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
assertMatEqual(truth, descriptors, EPS);
|
||||
}
|
||||
|
||||
public void testCreate() {
|
||||
assertNotNull(extractor);
|
||||
}
|
||||
|
||||
public void testDescriptorSize() {
|
||||
assertEquals(128, extractor.descriptorSize());
|
||||
}
|
||||
|
||||
public void testDescriptorType() {
|
||||
assertEquals(CvType.CV_32F, extractor.descriptorType());
|
||||
}
|
||||
|
||||
public void testEmpty() {
|
||||
assertFalse(extractor.empty());
|
||||
}
|
||||
|
||||
public void testRead() {
|
||||
String filename = OpenCVTestRunner.getTempFileName("yml");
|
||||
writeFile(filename, "%YAML:1.0\nnOctaves: 4\nnOctaveLayers: 2\nextended: 1\nupright: 0\n");
|
||||
|
||||
extractor.read(filename);
|
||||
|
||||
assertEquals(128, extractor.descriptorSize());
|
||||
}
|
||||
|
||||
public void testWrite() {
|
||||
String filename = OpenCVTestRunner.getTempFileName("xml");
|
||||
|
||||
extractor.write(filename);
|
||||
|
||||
String truth = "<?xml version=\"1.0\"?>\n<opencv_storage>\n<name>Feature2D.SURF</name>\n<extended>1</extended>\n<hessianThreshold>100.</hessianThreshold>\n<nOctaveLayers>2</nOctaveLayers>\n<nOctaves>4</nOctaves>\n<upright>0</upright>\n</opencv_storage>\n";
|
||||
assertEquals(truth, readFile(filename));
|
||||
}
|
||||
|
||||
public void testWriteYml() {
|
||||
String filename = OpenCVTestRunner.getTempFileName("yml");
|
||||
|
||||
extractor.write(filename);
|
||||
|
||||
String truth = "%YAML:1.0\nname: \"Feature2D.SURF\"\nextended: 1\nhessianThreshold: 100.\nnOctaveLayers: 2\nnOctaves: 4\nupright: 0\n";
|
||||
assertEquals(truth, readFile(filename));
|
||||
}
|
||||
|
||||
}
|
@@ -1,167 +0,0 @@
|
||||
package org.opencv.test.features2d;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import org.opencv.core.Core;
|
||||
import org.opencv.core.CvType;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.MatOfKeyPoint;
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.Scalar;
|
||||
import org.opencv.features2d.FeatureDetector;
|
||||
import org.opencv.core.KeyPoint;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
import org.opencv.test.OpenCVTestRunner;
|
||||
import org.opencv.imgproc.Imgproc;
|
||||
|
||||
public class SURFFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
FeatureDetector detector;
|
||||
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() {
|
||||
Mat cross = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255));
|
||||
Imgproc.line(cross, new Point(20, matSize / 2), new Point(matSize - 21, matSize / 2), new Scalar(100), 2);
|
||||
Imgproc.line(cross, new Point(matSize / 2, 20), new Point(matSize / 2, matSize - 21), new Scalar(100), 2);
|
||||
|
||||
return cross;
|
||||
}
|
||||
|
||||
private void order(List<KeyPoint> points) {
|
||||
Collections.sort(points, new Comparator<KeyPoint>() {
|
||||
public int compare(KeyPoint p1, KeyPoint p2) {
|
||||
if (p1.angle < p2.angle)
|
||||
return -1;
|
||||
if (p1.angle > p2.angle)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
detector = FeatureDetector.create(FeatureDetector.SURF);
|
||||
matSize = 100;
|
||||
truth = new KeyPoint[] {
|
||||
new KeyPoint(55.775578f, 55.775578f, 16, 80.245735f, 8617.8633f, 0, -1),
|
||||
new KeyPoint(44.224422f, 55.775578f, 16, 170.24574f, 8617.8633f, 0, -1),
|
||||
new KeyPoint(44.224422f, 44.224422f, 16, 260.24573f, 8617.8633f, 0, -1),
|
||||
new KeyPoint(55.775578f, 44.224422f, 16, 350.24573f, 8617.8633f, 0, -1)
|
||||
};
|
||||
}
|
||||
|
||||
public void testCreate() {
|
||||
assertNotNull(detector);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
List<MatOfKeyPoint> keypoints = new ArrayList<MatOfKeyPoint>();
|
||||
Mat cross = getTestImg();
|
||||
List<Mat> crosses = new ArrayList<Mat>(3);
|
||||
crosses.add(cross);
|
||||
crosses.add(cross);
|
||||
crosses.add(cross);
|
||||
|
||||
detector.detect(crosses, keypoints);
|
||||
|
||||
assertEquals(3, keypoints.size());
|
||||
|
||||
for (MatOfKeyPoint mkp : keypoints) {
|
||||
List<KeyPoint> lkp = mkp.toList();
|
||||
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);
|
||||
|
||||
MatOfKeyPoint keypoints = new MatOfKeyPoint();
|
||||
Mat cross = getTestImg();
|
||||
|
||||
detector.detect(cross, keypoints);
|
||||
|
||||
List<KeyPoint> lkp = keypoints.toList();
|
||||
order(lkp);
|
||||
assertListKeyPointEquals(Arrays.asList(truth), lkp, EPS);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
Mat img = getTestImg();
|
||||
Mat mask = getMaskImg();
|
||||
MatOfKeyPoint keypoints = new MatOfKeyPoint();
|
||||
|
||||
detector.detect(img, keypoints, mask);
|
||||
|
||||
List<KeyPoint> lkp = keypoints.toList();
|
||||
order(lkp);
|
||||
assertListKeyPointEquals(Arrays.asList(truth[1], truth[2]), lkp, EPS);
|
||||
}
|
||||
|
||||
public void testEmpty() {
|
||||
assertFalse(detector.empty());
|
||||
}
|
||||
|
||||
public void testRead() {
|
||||
Mat cross = getTestImg();
|
||||
|
||||
MatOfKeyPoint keypoints1 = new MatOfKeyPoint();
|
||||
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);
|
||||
|
||||
MatOfKeyPoint keypoints2 = new MatOfKeyPoint();
|
||||
detector.detect(cross, keypoints2);
|
||||
|
||||
assertTrue(keypoints2.total() <= keypoints1.total());
|
||||
}
|
||||
|
||||
public void testWrite() {
|
||||
String filename = OpenCVTestRunner.getTempFileName("xml");
|
||||
|
||||
detector.write(filename);
|
||||
|
||||
String truth = "<?xml version=\"1.0\"?>\n<opencv_storage>\n<name>Feature2D.SURF</name>\n<extended>0</extended>\n<hessianThreshold>100.</hessianThreshold>\n<nOctaveLayers>3</nOctaveLayers>\n<nOctaves>4</nOctaves>\n<upright>0</upright>\n</opencv_storage>\n";
|
||||
assertEquals(truth, readFile(filename));
|
||||
}
|
||||
|
||||
public void testWriteYml() {
|
||||
String filename = OpenCVTestRunner.getTempFileName("yml");
|
||||
|
||||
detector.write(filename);
|
||||
|
||||
String truth = "%YAML:1.0\nname: \"Feature2D.SURF\"\nextended: 0\nhessianThreshold: 100.\nnOctaveLayers: 3\nnOctaves: 4\nupright: 0\n";
|
||||
assertEquals(truth, readFile(filename));
|
||||
}
|
||||
|
||||
}
|
@@ -1,63 +0,0 @@
|
||||
package org.opencv.test.highgui;
|
||||
|
||||
import org.opencv.core.MatOfByte;
|
||||
import org.opencv.core.MatOfInt;
|
||||
import org.opencv.imgcodecs.Imgcodecs;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
import org.opencv.test.OpenCVTestRunner;
|
||||
|
||||
public class HighguiTest extends OpenCVTestCase {
|
||||
|
||||
public void testImdecode() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testImencodeStringMatListOfByte() {
|
||||
MatOfByte buff = new MatOfByte();
|
||||
assertEquals(0, buff.total());
|
||||
assertTrue( Imgcodecs.imencode(".jpg", gray127, buff) );
|
||||
assertFalse(0 == buff.total());
|
||||
}
|
||||
|
||||
public void testImencodeStringMatListOfByteListOfInteger() {
|
||||
MatOfInt params40 = new MatOfInt(Imgcodecs.IMWRITE_JPEG_QUALITY, 40);
|
||||
MatOfInt params90 = new MatOfInt(Imgcodecs.IMWRITE_JPEG_QUALITY, 90);
|
||||
/* or
|
||||
MatOfInt params = new MatOfInt();
|
||||
params.fromArray(Imgcodecs.IMWRITE_JPEG_QUALITY, 40);
|
||||
*/
|
||||
MatOfByte buff40 = new MatOfByte();
|
||||
MatOfByte buff90 = new MatOfByte();
|
||||
|
||||
assertTrue( Imgcodecs.imencode(".jpg", rgbLena, buff40, params40) );
|
||||
assertTrue( Imgcodecs.imencode(".jpg", rgbLena, buff90, params90) );
|
||||
|
||||
assertTrue(buff40.total() > 0);
|
||||
assertTrue(buff40.total() < buff90.total());
|
||||
}
|
||||
|
||||
public void testImreadString() {
|
||||
dst = Imgcodecs.imread(OpenCVTestRunner.LENA_PATH);
|
||||
assertTrue(!dst.empty());
|
||||
assertEquals(3, dst.channels());
|
||||
assertTrue(512 == dst.cols());
|
||||
assertTrue(512 == dst.rows());
|
||||
}
|
||||
|
||||
public void testImreadStringInt() {
|
||||
dst = Imgcodecs.imread(OpenCVTestRunner.LENA_PATH, 0);
|
||||
assertTrue(!dst.empty());
|
||||
assertEquals(1, dst.channels());
|
||||
assertTrue(512 == dst.cols());
|
||||
assertTrue(512 == dst.rows());
|
||||
}
|
||||
|
||||
public void testImwriteStringMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testImwriteStringMatListOfInteger() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
}
|
@@ -1,168 +0,0 @@
|
||||
package org.opencv.test.highgui;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.opencv.core.Size;
|
||||
import org.opencv.videoio.Videoio;
|
||||
import org.opencv.videoio.VideoCapture;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class VideoCaptureTest extends OpenCVTestCase {
|
||||
|
||||
private VideoCapture capture;
|
||||
private boolean isOpened;
|
||||
private boolean isSucceed;
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
capture = null;
|
||||
isTestCaseEnabled = false;
|
||||
isSucceed = false;
|
||||
isOpened = false;
|
||||
}
|
||||
|
||||
public void testGet() {
|
||||
try {
|
||||
capture = new VideoCapture(Videoio.CV_CAP_ANDROID);
|
||||
double frameWidth = capture.get(Videoio.CV_CAP_PROP_FRAME_WIDTH);
|
||||
assertTrue(0 != frameWidth);
|
||||
} finally {
|
||||
if (capture != null) capture.release();
|
||||
}
|
||||
}
|
||||
|
||||
public void testGetSupportedPreviewSizes() {
|
||||
try {
|
||||
capture = new VideoCapture(Videoio.CV_CAP_ANDROID);
|
||||
List<Size> sizes = capture.getSupportedPreviewSizes();
|
||||
assertNotNull(sizes);
|
||||
assertFalse(sizes.isEmpty());
|
||||
} finally {
|
||||
if (capture != null) capture.release();
|
||||
}
|
||||
}
|
||||
|
||||
public void testGrab() {
|
||||
capture = new VideoCapture();
|
||||
isSucceed = capture.grab();
|
||||
assertFalse(isSucceed);
|
||||
}
|
||||
|
||||
public void testGrabFromRealCamera() {
|
||||
try {
|
||||
capture = new VideoCapture(Videoio.CV_CAP_ANDROID);
|
||||
isSucceed = capture.grab();
|
||||
assertTrue(isSucceed);
|
||||
} finally {
|
||||
if (capture != null) capture.release();
|
||||
}
|
||||
}
|
||||
|
||||
public void testIsOpened() {
|
||||
capture = new VideoCapture();
|
||||
assertFalse(capture.isOpened());
|
||||
}
|
||||
|
||||
public void testIsOpenedRealCamera() {
|
||||
try {
|
||||
capture = new VideoCapture(Videoio.CV_CAP_ANDROID);
|
||||
isOpened = capture.isOpened();
|
||||
assertTrue(isOpened);
|
||||
} finally {
|
||||
if (capture != null) capture.release();
|
||||
}
|
||||
}
|
||||
|
||||
public void testOpen() {
|
||||
try {
|
||||
capture = new VideoCapture();
|
||||
capture.open(Videoio.CV_CAP_ANDROID);
|
||||
isOpened = capture.isOpened();
|
||||
assertTrue(isOpened);
|
||||
} finally {
|
||||
if (capture != null) capture.release();
|
||||
}
|
||||
}
|
||||
|
||||
public void testRead() {
|
||||
try {
|
||||
capture = new VideoCapture(Videoio.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() {
|
||||
try {
|
||||
capture = new VideoCapture(Videoio.CV_CAP_ANDROID);
|
||||
capture.release();
|
||||
assertFalse(capture.isOpened());
|
||||
capture = null;
|
||||
} finally {
|
||||
if (capture != null) capture.release();
|
||||
}
|
||||
}
|
||||
|
||||
public void testRetrieveMat() {
|
||||
try {
|
||||
capture = new VideoCapture(Videoio.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() {
|
||||
try {
|
||||
capture = new VideoCapture(Videoio.CV_CAP_ANDROID);
|
||||
capture.grab();
|
||||
isSucceed = capture.retrieve(dst, Videoio.CV_CAP_ANDROID_GREY_FRAME);
|
||||
assertTrue(isSucceed);
|
||||
assertFalse(dst.empty());
|
||||
assertEquals(1, dst.channels());
|
||||
} finally {
|
||||
if (capture != null) capture.release();
|
||||
}
|
||||
}
|
||||
|
||||
public void testSet() {
|
||||
try {
|
||||
capture = new VideoCapture(Videoio.CV_CAP_ANDROID);
|
||||
capture.set(Videoio.CV_CAP_PROP_FRAME_WIDTH, 640);
|
||||
capture.set(Videoio.CV_CAP_PROP_FRAME_HEIGHT, 480);
|
||||
double frameWidth = capture.get(Videoio.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();
|
||||
assertNotNull(capture);
|
||||
assertFalse(capture.isOpened());
|
||||
}
|
||||
|
||||
public void testVideoCaptureInt() {
|
||||
try {
|
||||
capture = new VideoCapture(Videoio.CV_CAP_ANDROID);
|
||||
assertNotNull(capture);
|
||||
assertTrue(capture.isOpened());
|
||||
} finally {
|
||||
if (capture != null) capture.release();
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@@ -1,199 +0,0 @@
|
||||
package org.opencv.test.imgproc;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class MomentsTest extends OpenCVTestCase {
|
||||
|
||||
public void testGet_m00() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_m01() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_m02() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_m03() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_m10() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_m11() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_m12() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_m20() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_m21() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_m30() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_mu02() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_mu03() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_mu11() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_mu12() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_mu20() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_mu21() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_mu30() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_nu02() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_nu03() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_nu11() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_nu12() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_nu20() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_nu21() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_nu30() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_m00() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_m01() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_m02() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_m03() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_m10() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_m11() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_m12() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_m20() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_m21() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_m30() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_mu02() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_mu03() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_mu11() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_mu12() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_mu20() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_mu21() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_mu30() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_nu02() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_nu03() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_nu11() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_nu12() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_nu20() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_nu21() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSet_nu30() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
}
|
@@ -1,117 +0,0 @@
|
||||
package org.opencv.test.imgproc;
|
||||
|
||||
import org.opencv.core.MatOfFloat6;
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.Rect;
|
||||
import org.opencv.imgproc.Subdiv2D;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class Subdiv2DTest extends OpenCVTestCase {
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
}
|
||||
|
||||
public void testEdgeDstInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testEdgeDstIntPoint() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testEdgeOrgInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testEdgeOrgIntPoint() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testFindNearestPoint() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testFindNearestPointPoint() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGetEdge() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGetEdgeList() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGetTriangleList() {
|
||||
Subdiv2D s2d = new Subdiv2D( new Rect(0, 0, 50, 50) );
|
||||
s2d.insert( new Point(10, 10) );
|
||||
s2d.insert( new Point(20, 10) );
|
||||
s2d.insert( new Point(20, 20) );
|
||||
s2d.insert( new Point(10, 20) );
|
||||
MatOfFloat6 triangles = new MatOfFloat6();
|
||||
s2d.getTriangleList(triangles);
|
||||
assertEquals(10, triangles.rows());
|
||||
/*
|
||||
int cnt = triangles.rows();
|
||||
float buff[] = new float[cnt*6];
|
||||
triangles.get(0, 0, buff);
|
||||
for(int i=0; i<cnt; i++)
|
||||
Log.d("*****", "["+i+"]: " + // (a.x, a.y) -> (b.x, b.y) -> (c.x, c.y)
|
||||
"("+buff[6*i+0]+","+buff[6*i+1]+")" + "->" +
|
||||
"("+buff[6*i+2]+","+buff[6*i+3]+")" + "->" +
|
||||
"("+buff[6*i+4]+","+buff[6*i+5]+")"
|
||||
);
|
||||
*/
|
||||
}
|
||||
|
||||
public void testGetVertexInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGetVertexIntIntArray() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGetVoronoiFacetList() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testInitDelaunay() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testInsertListOfPoint() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testInsertPoint() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testLocate() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testNextEdge() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testRotateEdge() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSubdiv2D() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSubdiv2DRect() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSymEdge() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
}
|
@@ -1,68 +0,0 @@
|
||||
package org.opencv.test.ml;
|
||||
|
||||
import org.opencv.ml.CvANN_MLP;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class CvANN_MLPTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,76 +0,0 @@
|
||||
package org.opencv.test.ml;
|
||||
|
||||
import org.opencv.ml.CvANN_MLP_TrainParams;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class CvANN_MLP_TrainParamsTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,44 +0,0 @@
|
||||
package org.opencv.test.ml;
|
||||
|
||||
import org.opencv.ml.CvBoostParams;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class CvBoostParamsTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,92 +0,0 @@
|
||||
package org.opencv.test.ml;
|
||||
|
||||
import org.opencv.ml.CvBoost;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class CvBoostTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,76 +0,0 @@
|
||||
package org.opencv.test.ml;
|
||||
|
||||
import org.opencv.ml.CvDTreeParams;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class CvDTreeParamsTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,44 +0,0 @@
|
||||
package org.opencv.test.ml;
|
||||
|
||||
import org.opencv.ml.CvDTree;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class CvDTreeTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,36 +0,0 @@
|
||||
package org.opencv.test.ml;
|
||||
|
||||
import org.opencv.ml.CvERTrees;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class CvERTreesTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,44 +0,0 @@
|
||||
package org.opencv.test.ml;
|
||||
|
||||
import org.opencv.ml.CvGBTreesParams;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class CvGBTreesParamsTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,84 +0,0 @@
|
||||
package org.opencv.test.ml;
|
||||
|
||||
import org.opencv.ml.CvGBTrees;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class CvGBTreesTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,52 +0,0 @@
|
||||
package org.opencv.test.ml;
|
||||
|
||||
import org.opencv.ml.CvKNearest;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class CvKNearestTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,52 +0,0 @@
|
||||
package org.opencv.test.ml;
|
||||
|
||||
import org.opencv.ml.CvNormalBayesClassifier;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class CvNormalBayesClassifierTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,36 +0,0 @@
|
||||
package org.opencv.test.ml;
|
||||
|
||||
import org.opencv.ml.CvParamGrid;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class CvParamGridTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,28 +0,0 @@
|
||||
package org.opencv.test.ml;
|
||||
|
||||
import org.opencv.ml.CvRTParams;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class CvRTParamsTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,60 +0,0 @@
|
||||
package org.opencv.test.ml;
|
||||
|
||||
import org.opencv.ml.CvRTrees;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class CvRTreesTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,76 +0,0 @@
|
||||
package org.opencv.test.ml;
|
||||
|
||||
import org.opencv.ml.CvSVMParams;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class CvSVMParamsTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,100 +0,0 @@
|
||||
package org.opencv.test.ml;
|
||||
|
||||
import org.opencv.ml.CvSVM;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class CvSVMTest extends OpenCVTestCase {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@@ -1,104 +0,0 @@
|
||||
package org.opencv.test.objdetect;
|
||||
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.MatOfRect;
|
||||
import org.opencv.core.Size;
|
||||
import org.opencv.imgproc.Imgproc;
|
||||
import org.opencv.objdetect.CascadeClassifier;
|
||||
import org.opencv.objdetect.Objdetect;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
import org.opencv.test.OpenCVTestRunner;
|
||||
|
||||
public class CascadeClassifierTest extends OpenCVTestCase {
|
||||
|
||||
private CascadeClassifier cc;
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
cc = null;
|
||||
}
|
||||
|
||||
public void testCascadeClassifier() {
|
||||
cc = new CascadeClassifier();
|
||||
assertTrue(null != cc);
|
||||
}
|
||||
|
||||
public void testCascadeClassifierString() {
|
||||
cc = new CascadeClassifier(OpenCVTestRunner.LBPCASCADE_FRONTALFACE_PATH);
|
||||
assertTrue(null != cc);
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRect() {
|
||||
CascadeClassifier cc = new CascadeClassifier(OpenCVTestRunner.LBPCASCADE_FRONTALFACE_PATH);
|
||||
MatOfRect faces = new MatOfRect();
|
||||
|
||||
Mat greyLena = new Mat();
|
||||
Imgproc.cvtColor(rgbLena, greyLena, Imgproc.COLOR_RGB2GRAY);
|
||||
|
||||
// TODO: doesn't detect with 1.1 scale
|
||||
cc.detectMultiScale(greyLena, faces, 1.09, 3, Objdetect.CASCADE_SCALE_IMAGE, new Size(30, 30), new Size());
|
||||
assertEquals(1, faces.total());
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectDouble() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectDoubleInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectDoubleIntInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectDoubleIntIntSize() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectDoubleIntIntSizeSize() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectListOfIntegerListOfDouble() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectListOfIntegerListOfDoubleDouble() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectListOfIntegerListOfDoubleDoubleInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectListOfIntegerListOfDoubleDoubleIntInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectListOfIntegerListOfDoubleDoubleIntIntSize() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectListOfIntegerListOfDoubleDoubleIntIntSizeSize() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectListOfIntegerListOfDoubleDoubleIntIntSizeSizeBoolean() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testEmpty() {
|
||||
cc = new CascadeClassifier();
|
||||
assertTrue(cc.empty());
|
||||
}
|
||||
|
||||
public void testLoad() {
|
||||
cc = new CascadeClassifier();
|
||||
cc.load(OpenCVTestRunner.LBPCASCADE_FRONTALFACE_PATH);
|
||||
assertTrue(!cc.empty());
|
||||
}
|
||||
|
||||
}
|
@@ -1,259 +0,0 @@
|
||||
package org.opencv.test.objdetect;
|
||||
|
||||
import org.opencv.objdetect.HOGDescriptor;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class HOGDescriptorTest extends OpenCVTestCase {
|
||||
|
||||
public void testCheckDetectorSize() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testComputeGradientMatMatMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testComputeGradientMatMatMatSize() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testComputeGradientMatMatMatSizeSize() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testComputeMatListOfFloat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testComputeMatListOfFloatSize() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testComputeMatListOfFloatSizeSize() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testComputeMatListOfFloatSizeSizeListOfPoint() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMatListOfPoint() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMatListOfPointDouble() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMatListOfPointDoubleSize() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMatListOfPointDoubleSizeSize() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMatListOfPointDoubleSizeSizeListOfPoint() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMatListOfPointListOfDouble() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMatListOfPointListOfDoubleDouble() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMatListOfPointListOfDoubleDoubleSize() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMatListOfPointListOfDoubleDoubleSizeSize() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMatListOfPointListOfDoubleDoubleSizeSizeListOfPoint() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRect() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectDouble() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectDoubleSize() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectDoubleSizeSize() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectDoubleSizeSizeDouble() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectDoubleSizeSizeDoubleDouble() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectDoubleSizeSizeDoubleDoubleBoolean() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectListOfDouble() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectListOfDoubleDouble() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectListOfDoubleDoubleSize() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectListOfDoubleDoubleSizeSize() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectListOfDoubleDoubleSizeSizeDouble() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectListOfDoubleDoubleSizeSizeDoubleDouble() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectListOfDoubleDoubleSizeSizeDoubleDoubleBoolean() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_blockSize() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_blockStride() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_cellSize() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_derivAperture() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_gammaCorrection() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_histogramNormType() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_L2HysThreshold() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_nbins() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_nlevels() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_svmDetector() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_winSigma() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGet_winSize() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGetDaimlerPeopleDetector() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGetDefaultPeopleDetector() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGetDescriptorSize() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGetWinSigma() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testHOGDescriptor() {
|
||||
HOGDescriptor hog = new HOGDescriptor();
|
||||
|
||||
assertNotNull(hog);
|
||||
assertEquals(HOGDescriptor.DEFAULT_NLEVELS, hog.get_nlevels());
|
||||
}
|
||||
|
||||
public void testHOGDescriptorSizeSizeSizeSizeInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testHOGDescriptorSizeSizeSizeSizeIntInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testHOGDescriptorSizeSizeSizeSizeIntIntDouble() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testHOGDescriptorSizeSizeSizeSizeIntIntDoubleInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testHOGDescriptorSizeSizeSizeSizeIntIntDoubleIntDouble() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testHOGDescriptorSizeSizeSizeSizeIntIntDoubleIntDoubleBoolean() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testHOGDescriptorSizeSizeSizeSizeIntIntDoubleIntDoubleBooleanInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testHOGDescriptorString() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
public void testSetSVMDetector() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
}
|
@@ -1,42 +0,0 @@
|
||||
package org.opencv.test.objdetect;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
public class ObjdetectTest extends OpenCVTestCase {
|
||||
|
||||
public void testGroupRectanglesListOfRectListOfIntegerInt() {
|
||||
fail("Not yet implemented");
|
||||
/*
|
||||
final int NUM = 10;
|
||||
MatOfRect rects = new MatOfRect();
|
||||
rects.alloc(NUM);
|
||||
|
||||
for (int i = 0; i < NUM; i++)
|
||||
rects.put(i, 0, 10, 10, 20, 20);
|
||||
|
||||
int groupThreshold = 1;
|
||||
Objdetect.groupRectangles(rects, null, groupThreshold);//TODO: second parameter should not be null
|
||||
assertEquals(1, rects.total());
|
||||
*/
|
||||
}
|
||||
|
||||
public void testGroupRectanglesListOfRectListOfIntegerIntDouble() {
|
||||
fail("Not yet implemented");
|
||||
/*
|
||||
final int NUM = 10;
|
||||
MatOfRect rects = new MatOfRect();
|
||||
rects.alloc(NUM);
|
||||
|
||||
for (int i = 0; i < NUM; i++)
|
||||
rects.put(i, 0, 10, 10, 20, 20);
|
||||
|
||||
for (int i = 0; i < NUM; i++)
|
||||
rects.put(i, 0, 10, 10, 25, 25);
|
||||
|
||||
int groupThreshold = 1;
|
||||
double eps = 0.2;
|
||||
Objdetect.groupRectangles(rects, null, groupThreshold, eps);//TODO: second parameter should not be null
|
||||
assertEquals(2, rects.size());
|
||||
*/
|
||||
}
|
||||
}
|
@@ -1,22 +0,0 @@
|
||||
package org.opencv.test.photo;
|
||||
|
||||
import org.opencv.core.Core;
|
||||
import org.opencv.core.CvType;
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.photo.Photo;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
import org.opencv.imgproc.Imgproc;
|
||||
|
||||
public class PhotoTest extends OpenCVTestCase {
|
||||
|
||||
public void testInpaint() {
|
||||
Point p = new Point(matSize / 2, matSize / 2);
|
||||
Imgproc.circle(gray255, p, 2, colorBlack, Core.FILLED);
|
||||
Imgproc.circle(gray0, p, 2, colorWhite, Core.FILLED);
|
||||
|
||||
Photo.inpaint(gray255, gray0, dst, 3, Photo.INPAINT_TELEA);
|
||||
|
||||
assertMatEqual(getMat(CvType.CV_8U, 255), dst);
|
||||
}
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user