Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/2.4' into merge-2.4
Browse files Browse the repository at this point in the history
Conflicts:
	modules/cudaimgproc/test/test_color.cpp
	modules/dynamicuda/include/opencv2/dynamicuda/dynamicuda.hpp
	modules/gpu/perf/perf_imgproc.cpp
	modules/gpu/src/imgproc.cpp
	modules/gpu/test/test_core.cpp
	modules/gpu/test/test_imgproc.cpp
	modules/java/generator/src/cpp/VideoCapture.cpp
	samples/gpu/performance/CMakeLists.txt
	samples/tapi/CMakeLists.txt
  • Loading branch information
Roman Donchenko committed Feb 3, 2014
2 parents 82330a5 + 2bef73c commit 2bbda9d
Show file tree
Hide file tree
Showing 23 changed files with 215 additions and 98 deletions.
21 changes: 20 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ OCV_OPTION(INSTALL_C_EXAMPLES "Install C examples" OFF )
OCV_OPTION(INSTALL_PYTHON_EXAMPLES "Install Python examples" OFF )
OCV_OPTION(INSTALL_ANDROID_EXAMPLES "Install Android examples" OFF IF ANDROID )
OCV_OPTION(INSTALL_TO_MANGLED_PATHS "Enables mangled install paths, that help with side by side installs." OFF IF (UNIX AND NOT ANDROID AND NOT IOS AND BUILD_SHARED_LIBS) )

OCV_OPTION(INSTALL_TESTS "Install accuracy and performance test binaries and test data" OFF)

# OpenCV build options
# ===================================================
Expand Down Expand Up @@ -260,6 +260,9 @@ endif()
set(OPENCV_SAMPLES_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}samples")

set(OPENCV_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}bin")
if(NOT OPENCV_TEST_INSTALL_PATH)
set(OPENCV_TEST_INSTALL_PATH "${OPENCV_BIN_INSTALL_PATH}")
endif()

if(ANDROID)
set(LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/lib/${ANDROID_NDK_ABI_NAME}")
Expand All @@ -268,6 +271,7 @@ if(ANDROID)
set(OPENCV_3P_LIB_INSTALL_PATH sdk/native/3rdparty/libs/${ANDROID_NDK_ABI_NAME})
set(OPENCV_CONFIG_INSTALL_PATH sdk/native/jni)
set(OPENCV_INCLUDE_INSTALL_PATH sdk/native/jni/include)
set(OPENCV_SAMPLES_SRC_INSTALL_PATH samples/native)
else()
set(LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/lib")
set(3P_LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/3rdparty/lib${LIB_SUFFIX}")
Expand All @@ -278,9 +282,11 @@ else()
set(OPENCV_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}lib${LIB_SUFFIX}")
endif()
set(OPENCV_3P_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib${LIB_SUFFIX}")
set(OPENCV_SAMPLES_SRC_INSTALL_PATH samples/native)
else()
set(OPENCV_LIB_INSTALL_PATH lib${LIB_SUFFIX})
set(OPENCV_3P_LIB_INSTALL_PATH share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH})
set(OPENCV_SAMPLES_SRC_INSTALL_PATH share/OpenCV/samples)
endif()
set(OPENCV_INCLUDE_INSTALL_PATH "include")

Expand Down Expand Up @@ -535,6 +541,19 @@ include(cmake/OpenCVGenConfig.cmake)
# Generate Info.plist for the IOS framework
include(cmake/OpenCVGenInfoPlist.cmake)

# Generate environment setup file
if(INSTALL_TESTS AND OPENCV_TEST_DATA_PATH AND UNIX AND NOT ANDROID)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/opencv_testing.sh.in"
"${CMAKE_BINARY_DIR}/unix-install/opencv_testing.sh" @ONLY)
install(FILES "${CMAKE_BINARY_DIR}/unix-install/opencv_testing.sh"
DESTINATION /etc/profile.d/ COMPONENT tests)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/opencv_run_all_tests.sh.in"
"${CMAKE_BINARY_DIR}/unix-install/opencv_run_all_tests.sh" @ONLY)
install(FILES "${CMAKE_BINARY_DIR}/unix-install/opencv_run_all_tests.sh"
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE
DESTINATION ${OPENCV_TEST_INSTALL_PATH} COMPONENT tests)
endif()

# ----------------------------------------------------------------------------
# Summary:
# ----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion cmake/OpenCVExtraTargets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
CONFIGURE_FILE(
"${OpenCV_SOURCE_DIR}/cmake/templates/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
@ONLY)

ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
if(ENABLE_SOLUTION_FOLDERS)
Expand Down
4 changes: 2 additions & 2 deletions cmake/OpenCVGenAndroidMK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ if(ANDROID)
set(OPENCV_LIBS_DIR_CONFIGCMAKE "\$(OPENCV_THIS_DIR)/lib/\$(OPENCV_TARGET_ARCH_ABI)")
set(OPENCV_3RDPARTY_LIBS_DIR_CONFIGCMAKE "\$(OPENCV_THIS_DIR)/3rdparty/lib/\$(OPENCV_TARGET_ARCH_ABI)")

configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCV.mk.in" "${CMAKE_BINARY_DIR}/OpenCV.mk" IMMEDIATE @ONLY)
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCV.mk.in" "${CMAKE_BINARY_DIR}/OpenCV.mk" @ONLY)

# -------------------------------------------------------------------------------------------
# Part 2/2: ${BIN_DIR}/unix-install/OpenCV.mk -> For use with "make install"
Expand All @@ -101,6 +101,6 @@ if(ANDROID)
set(OPENCV_LIBS_DIR_CONFIGCMAKE "\$(OPENCV_THIS_DIR)/../libs/\$(OPENCV_TARGET_ARCH_ABI)")
set(OPENCV_3RDPARTY_LIBS_DIR_CONFIGCMAKE "\$(OPENCV_THIS_DIR)/../3rdparty/libs/\$(OPENCV_TARGET_ARCH_ABI)")

configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCV.mk.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCV.mk" IMMEDIATE @ONLY)
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCV.mk.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCV.mk" @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/unix-install/OpenCV.mk DESTINATION ${OPENCV_CONFIG_INSTALL_PATH} COMPONENT dev)
endif(ANDROID)
12 changes: 6 additions & 6 deletions cmake/OpenCVGenConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ endif()

export(TARGETS ${OpenCVModules_TARGETS} FILE "${CMAKE_BINARY_DIR}/OpenCVModules${modules_file_suffix}.cmake")

configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/OpenCVConfig.cmake" IMMEDIATE @ONLY)
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/OpenCVConfig.cmake" @ONLY)
#support for version checking when finding opencv. find_package(OpenCV 2.3.1 EXACT) should now work.
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.in" "${CMAKE_BINARY_DIR}/OpenCVConfig-version.cmake" IMMEDIATE @ONLY)
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.in" "${CMAKE_BINARY_DIR}/OpenCVConfig-version.cmake" @ONLY)

# --------------------------------------------------------------------------------------------
# Part 2/3: ${BIN_DIR}/unix-install/OpenCVConfig.cmake -> For use *with* "make install"
Expand All @@ -98,8 +98,8 @@ if(INSTALL_TO_MANGLED_PATHS)
set(OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/${OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE}\"")
endif()

configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake" IMMEDIATE @ONLY)
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig-version.cmake" IMMEDIATE @ONLY)
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake" @ONLY)
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig-version.cmake" @ONLY)

if(UNIX) # ANDROID configuration is created here also
#http://www.vtk.org/Wiki/CMake/Tutorials/Packaging reference
Expand Down Expand Up @@ -131,8 +131,8 @@ if(WIN32)
set(OpenCV2_INCLUDE_DIRS_CONFIGCMAKE "\"\"")

exec_program(mkdir ARGS "-p \"${CMAKE_BINARY_DIR}/win-install/\"" OUTPUT_VARIABLE RET_VAL)
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" IMMEDIATE @ONLY)
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.in" "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig-version.cmake" IMMEDIATE @ONLY)
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" @ONLY)
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.in" "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig-version.cmake" @ONLY)
if(BUILD_SHARED_LIBS)
install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}lib" COMPONENT dev)
install(EXPORT OpenCVModules DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}lib" FILE OpenCVModules${modules_file_suffix}.cmake COMPONENT dev)
Expand Down
2 changes: 1 addition & 1 deletion cmake/OpenCVGenPkgconfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ else()
endif()
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/opencv-XXX.pc.in"
"${CMAKE_BINARY_DIR}/unix-install/${OPENCV_PC_FILE_NAME}"
@ONLY IMMEDIATE)
@ONLY)

if(UNIX AND NOT ANDROID)
install(FILES ${CMAKE_BINARY_DIR}/unix-install/${OPENCV_PC_FILE_NAME} DESTINATION ${OPENCV_LIB_INSTALL_PATH}/pkgconfig COMPONENT dev)
Expand Down
9 changes: 8 additions & 1 deletion cmake/OpenCVModule.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,9 @@ function(ocv_add_perf_tests)
else(OCV_DEPENDENCIES_FOUND)
# TODO: warn about unsatisfied dependencies
endif(OCV_DEPENDENCIES_FOUND)
if(INSTALL_TESTS)
install(TARGETS ${the_target} RUNTIME DESTINATION ${OPENCV_TEST_INSTALL_PATH} COMPONENT tests)
endif()
endif()
endfunction()

Expand Down Expand Up @@ -770,6 +773,10 @@ function(ocv_add_accuracy_tests)
else(OCV_DEPENDENCIES_FOUND)
# TODO: warn about unsatisfied dependencies
endif(OCV_DEPENDENCIES_FOUND)

if(INSTALL_TESTS)
install(TARGETS ${the_target} RUNTIME DESTINATION ${OPENCV_TEST_INSTALL_PATH} COMPONENT tests)
endif()
endif()
endfunction()

Expand Down Expand Up @@ -810,7 +817,7 @@ function(ocv_add_samples)
if(INSTALL_C_EXAMPLES AND NOT WIN32 AND EXISTS "${samples_path}")
file(GLOB sample_files "${samples_path}/*")
install(FILES ${sample_files}
DESTINATION share/OpenCV/samples/${module_id}
DESTINATION ${OPENCV_SAMPLES_SRC_INSTALL_PATH}/${module_id}
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ COMPONENT samples)
endif()
endfunction()
Expand Down
14 changes: 9 additions & 5 deletions cmake/OpenCVPackaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ set(CPACK_COMPONENT_dev_DEPENDS libs)
set(CPACK_COMPONENT_docs_DEPENDS libs)
set(CPACK_COMPONENT_java_DEPENDS libs)
set(CPACK_COMPONENT_python_DEPENDS libs)
set(CPACK_COMPONENT_tests_DEPENDS libs)

if(HAVE_CUDA)
string(REPLACE "." "-" cuda_version_suffix ${CUDA_VERSION})
Expand All @@ -77,19 +78,22 @@ if(NOT OPENCV_CUSTOM_PACKAGE_INFO)
set(CPACK_COMPONENT_libs_DESCRIPTION "Open Computer Vision Library")

set(CPACK_COMPONENT_python_DISPLAY_NAME "lib${CMAKE_PROJECT_NAME}-python")
set(CPACK_COMPONENT_python_DESCRIPTION "Python bindings for Open Computer Vision Library")
set(CPACK_COMPONENT_python_DESCRIPTION "Python bindings for Open Source Computer Vision Library")

set(CPACK_COMPONENT_java_DISPLAY_NAME "lib${CMAKE_PROJECT_NAME}-java")
set(CPACK_COMPONENT_java_DESCRIPTION "Java bindings for Open Computer Vision Library")
set(CPACK_COMPONENT_java_DESCRIPTION "Java bindings for Open Source Computer Vision Library")

set(CPACK_COMPONENT_dev_DISPLAY_NAME "lib${CMAKE_PROJECT_NAME}-dev")
set(CPACK_COMPONENT_dev_DESCRIPTION "Development files for Open Computer Vision Library")
set(CPACK_COMPONENT_dev_DESCRIPTION "Development files for Open Source Computer Vision Library")

set(CPACK_COMPONENT_docs_DISPLAY_NAME "lib${CMAKE_PROJECT_NAME}-docs")
set(CPACK_COMPONENT_docs_DESCRIPTION "Documentation for Open Computer Vision Library")
set(CPACK_COMPONENT_docs_DESCRIPTION "Documentation for Open Source Computer Vision Library")

set(CPACK_COMPONENT_samples_DISPLAY_NAME "lib${CMAKE_PROJECT_NAME}-samples")
set(CPACK_COMPONENT_samples_DESCRIPTION "Samples for Open Computer Vision Library")
set(CPACK_COMPONENT_samples_DESCRIPTION "Samples for Open Source Computer Vision Library")

set(CPACK_COMPONENT_tests_DISPLAY_NAME "lib${CMAKE_PROJECT_NAME}-tests")
set(CPACK_COMPONENT_tests_DESCRIPTION "Accuracy and performance tests for Open Source Computer Vision Library")
endif(NOT OPENCV_CUSTOM_PACKAGE_INFO)

if(NOT OPENCV_CUSTOM_PACKAGE_LAYOUT)
Expand Down
25 changes: 25 additions & 0 deletions cmake/templates/opencv_run_all_tests.sh.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh

OPENCV_TEST_PATH=@OPENCV_TEST_INSTALL_PATH@
export OPENCV_TEST_DATA_PATH=@CMAKE_INSTALL_PREFIX@/share/OpenCV/testdata

SUMMARY_STATUS=0
for t in "$OPENCV_TEST_PATH/"opencv_test_* "$OPENCV_TEST_PATH/"opencv_perf_*;
do
report="`basename "$t"`-`date --rfc-3339=date`.xml"
"$t" --perf_min_samples=1 --perf_force_samples=1 --gtest_output=xml:"$report"
TEST_STATUS=$?
if [ $TEST_STATUS -ne 0 ]; then
SUMMARY_STATUS=$TEST_STATUS
fi
done

rm -f /tmp/__opencv_temp.*

if [ $SUMMARY_STATUS -eq 0 ]; then
echo "All OpenCV tests finished successfully"
else
echo "OpenCV tests finished with status $SUMMARY_STATUS"
fi

return $SUMMARY_STATUS
2 changes: 2 additions & 0 deletions cmake/templates/opencv_testing.sh.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Environment setup for OpenCV testing
export OPENCV_TEST_DATA_PATH=@CMAKE_INSTALL_PREFIX@/share/OpenCV/testdata
8 changes: 8 additions & 0 deletions data/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,11 @@ elseif(NOT WIN32)
install(FILES ${HAAR_CASCADES} DESTINATION share/OpenCV/haarcascades COMPONENT libs)
install(FILES ${LBP_CASCADES} DESTINATION share/OpenCV/lbpcascades COMPONENT libs)
endif()

if(INSTALL_TESTS AND OPENCV_TEST_DATA_PATH)
if(ANDROID)
install(DIRECTORY ${OPENCV_TEST_DATA_PATH} DESTINATION sdk/etc/testdata COMPONENT tests)
elseif(NOT WIN32)
install(DIRECTORY ${OPENCV_TEST_DATA_PATH} DESTINATION share/OpenCV/testdata COMPONENT tests)
endif()
endif()
36 changes: 15 additions & 21 deletions modules/core/test/test_math.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2485,50 +2485,44 @@ TYPED_TEST_P(Core_CheckRange, Negative)
double min_bound = 4.5;
double max_bound = 16.0;

TypeParam data[] = {5, 10, 15, 4, 10 ,2, 8, 12, 14};
TypeParam data[] = {5, 10, 15, 4, 10, 2, 8, 12, 14};
cv::Mat src = cv::Mat(3,3, cv::DataDepth<TypeParam>::value, data);

cv::Point* bad_pt = new cv::Point(0, 0);
cv::Point bad_pt(0, 0);

ASSERT_FALSE(checkRange(src, true, bad_pt, min_bound, max_bound));
ASSERT_EQ(bad_pt->x,0);
ASSERT_EQ(bad_pt->y,1);

delete bad_pt;
ASSERT_FALSE(checkRange(src, true, &bad_pt, min_bound, max_bound));
ASSERT_EQ(bad_pt.x, 0);
ASSERT_EQ(bad_pt.y, 1);
}

TYPED_TEST_P(Core_CheckRange, Positive)
{
double min_bound = -1;
double max_bound = 16.0;

TypeParam data[] = {5, 10, 15, 4, 10 ,2, 8, 12, 14};
TypeParam data[] = {5, 10, 15, 4, 10, 2, 8, 12, 14};
cv::Mat src = cv::Mat(3,3, cv::DataDepth<TypeParam>::value, data);

cv::Point* bad_pt = new cv::Point(0, 0);

ASSERT_TRUE(checkRange(src, true, bad_pt, min_bound, max_bound));
ASSERT_EQ(bad_pt->x,0);
ASSERT_EQ(bad_pt->y,0);
cv::Point bad_pt(0, 0);

delete bad_pt;
ASSERT_TRUE(checkRange(src, true, &bad_pt, min_bound, max_bound));
ASSERT_EQ(bad_pt.x, 0);
ASSERT_EQ(bad_pt.y, 0);
}

TYPED_TEST_P(Core_CheckRange, Bounds)
{
double min_bound = 24.5;
double max_bound = 1.0;

TypeParam data[] = {5, 10, 15, 4, 10 ,2, 8, 12, 14};
TypeParam data[] = {5, 10, 15, 4, 10, 2, 8, 12, 14};
cv::Mat src = cv::Mat(3,3, cv::DataDepth<TypeParam>::value, data);

cv::Point* bad_pt = new cv::Point(0, 0);

ASSERT_FALSE(checkRange(src, true, bad_pt, min_bound, max_bound));
ASSERT_EQ(bad_pt->x,0);
ASSERT_EQ(bad_pt->y,0);
cv::Point bad_pt(0, 0);

delete bad_pt;
ASSERT_FALSE(checkRange(src, true, &bad_pt, min_bound, max_bound));
ASSERT_EQ(bad_pt.x, 0);
ASSERT_EQ(bad_pt.y, 0);
}

TYPED_TEST_P(Core_CheckRange, Zero)
Expand Down
2 changes: 1 addition & 1 deletion modules/cudalegacy/test/TestHaarCascadeLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ bool TestHaarCascadeLoader::process()
NCV_SET_SKIP_COND(this->allocatorGPU.get()->isCounting());
NCV_SKIP_COND_BEGIN

const std::string testNvbinName = "test.nvbin";
const std::string testNvbinName = cv::tempfile("test.nvbin");
ncvStat = ncvHaarLoadFromFile_host(this->cascadeName, haar, h_HaarStages, h_HaarNodes, h_HaarFeatures);
ncvAssertReturn(ncvStat == NCV_SUCCESS, false);

Expand Down
2 changes: 1 addition & 1 deletion modules/highgui/test/test_ffmpeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class CV_FFmpegWriteBigVideoTest : public cvtest::BaseTest
stringstream s;
s << tag;

const string filename = "output_"+s.str()+".avi";
const string filename = tempfile((s.str()+".avi").c_str());

try
{
Expand Down
2 changes: 0 additions & 2 deletions modules/highgui/test/test_video_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,7 @@ void CV_HighGuiTest::VideoTest(const string& dir, const cvtest::VideoFormat& fmt
}
}

printf("Before saved release for %s\n", tmp_name.c_str());
cvReleaseCapture( &saved );
printf("After release\n");

ts->printf(ts->LOG, "end test function : ImagesVideo \n");
}
Expand Down
2 changes: 1 addition & 1 deletion modules/imgproc/src/smooth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ void cv::boxFilter( InputArray _src, OutputArray _dst, int ddepth,
ddepth = sdepth;
_dst.create( src.size(), CV_MAKETYPE(ddepth, cn) );
Mat dst = _dst.getMat();
if( borderType != BORDER_CONSTANT && normalize )
if( borderType != BORDER_CONSTANT && normalize && (borderType & BORDER_ISOLATED) != 0 )
{
if( src.rows == 1 )
ksize.height = 1;
Expand Down
32 changes: 32 additions & 0 deletions modules/imgproc/test/test_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1886,3 +1886,35 @@ class CV_FilterSupportedFormatsTest : public cvtest::BaseTest
};

TEST(Imgproc_Filtering, supportedFormats) { CV_FilterSupportedFormatsTest test; test.safe_run(); }

TEST(Imgproc_Blur, borderTypes)
{
Size kernelSize(3, 3);

/// ksize > src_roi.size()
Mat src(3, 3, CV_8UC1, cv::Scalar::all(255)), dst;
Mat src_roi = src(Rect(1, 1, 1, 1));
src_roi.setTo(cv::Scalar::all(0));

// should work like !BORDER_ISOLATED
blur(src_roi, dst, kernelSize, Point(-1, -1), BORDER_REPLICATE);
EXPECT_EQ(227, dst.at<uchar>(0, 0));

// should work like BORDER_ISOLATED
blur(src_roi, dst, kernelSize, Point(-1, -1), BORDER_REPLICATE | BORDER_ISOLATED);
EXPECT_EQ(0, dst.at<uchar>(0, 0));

/// ksize <= src_roi.size()
src = Mat(5, 5, CV_8UC1, cv::Scalar(255));
src_roi = src(Rect(1, 1, 3, 3));
src_roi.setTo(0);
src.at<uchar>(2, 2) = 255;

// should work like !BORDER_ISOLATED
blur(src_roi, dst, kernelSize, Point(-1, -1), BORDER_REPLICATE);
Mat expected_dst =
(Mat_<uchar>(3, 3) << 170, 113, 170, 113, 28, 113, 170, 113, 170);
EXPECT_EQ(expected_dst.type(), dst.type());
EXPECT_EQ(expected_dst.size(), dst.size());
EXPECT_DOUBLE_EQ(0.0, cvtest::norm(expected_dst, dst, NORM_INF));
}
2 changes: 1 addition & 1 deletion modules/java/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ if(ANDROID)
else(ANDROID)
set(JAR_NAME opencv-${LIB_NAME_SUFIX}.jar)
set(JAR_FILE "${OpenCV_BINARY_DIR}/bin/${JAR_NAME}")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/build.xml.in" "${OpenCV_BINARY_DIR}/build.xml" IMMEDIATE @ONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/build.xml.in" "${OpenCV_BINARY_DIR}/build.xml" @ONLY)
list(APPEND step3_depends "${OpenCV_BINARY_DIR}/build.xml")

add_custom_command(OUTPUT "${JAR_FILE}" "${JAR_FILE}.dephelper"
Expand Down
Loading

0 comments on commit 2bbda9d

Please sign in to comment.