From 5de01fde534e1ec1adbf9241d2644cd8cdab9302 Mon Sep 17 00:00:00 2001 From: Elena Shipunova Date: Mon, 7 Sep 2015 13:50:30 +0300 Subject: [PATCH 01/16] do not proceed with removing zero-length slice --- modules/core/src/datastructs.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/core/src/datastructs.cpp b/modules/core/src/datastructs.cpp index 34ed64dbe..2612de6c5 100644 --- a/modules/core/src/datastructs.cpp +++ b/modules/core/src/datastructs.cpp @@ -1695,6 +1695,9 @@ cvSeqRemoveSlice( CvSeq* seq, CvSlice slice ) slice.end_index = slice.start_index + length; + if ( slice.start_index == slice.end_index ) + return; + if( slice.end_index < total ) { CvSeqReader reader_to, reader_from; From 7d245e0f29b3c611a2fdd378d28df28505b1691d Mon Sep 17 00:00:00 2001 From: Vitaly Tuzov Date: Thu, 30 Jul 2015 18:42:29 +0300 Subject: [PATCH 02/16] Added more resize_area tests to ensure right rounding behavior for half and quarter downscaling --- modules/imgproc/test/test_imgwarp.cpp | 102 ++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) diff --git a/modules/imgproc/test/test_imgwarp.cpp b/modules/imgproc/test/test_imgwarp.cpp index 2260cf510..c2cf2bfc6 100644 --- a/modules/imgproc/test/test_imgwarp.cpp +++ b/modules/imgproc/test/test_imgwarp.cpp @@ -1538,6 +1538,108 @@ TEST(Imgproc_resize_area, regression) ASSERT_EQ(cvtest::norm(one_channel_diff, cv::NORM_INF), 0); } +TEST(Imgproc_resize_area, regression_half_round) +{ + static uchar input_data[32 * 32]; + for(int i = 0; i < 32 * 32; ++i) + input_data[i] = i % 2 + 253 + i / (16 * 32); + + static uchar expected_data[16 * 16]; + for(int i = 0; i < 16 * 16; ++i) + expected_data[i] = 254 + i / (16 * 8); + + cv::Mat src(32, 32, CV_8UC1, input_data); + cv::Mat expected(16, 16, CV_8UC1, expected_data); + cv::Mat actual(expected.size(), expected.type()); + + cv::resize(src, actual, cv::Size(), 0.5, 0.5, INTER_AREA); + + ASSERT_EQ(actual.type(), expected.type()); + ASSERT_EQ(actual.size(), expected.size()); + + Mat diff; + absdiff(actual, expected, diff); + + float elem_diff = 0.5f; + Size dsize = actual.size(); + bool next = true; + for (int dy = 0; dy < dsize.height && next; ++dy) + { + uchar* eD = expected.ptr(dy); + uchar* aD = actual.ptr(dy); + + for (int dx = 0; dx < dsize.width && next; ++dx) + if (fabs(static_cast(aD[dx] - eD[dx])) > elem_diff) + { + cvtest::TS::ptr()->printf(cvtest::TS::SUMMARY, "Inf norm: %f\n", static_cast(norm(actual, expected, NORM_INF))); + cvtest::TS::ptr()->printf(cvtest::TS::SUMMARY, "Error in : (%d, %d)\n", dx, dy); + + const int radius = 3; + int rmin = MAX(dy - radius, 0), rmax = MIN(dy + radius, dsize.height); + int cmin = MAX(dx - radius, 0), cmax = MIN(dx + radius, dsize.width); + + std::cout << "Abs diff:" << std::endl << diff << std::endl; + std::cout << "actual result:\n" << actual(Range(rmin, rmax), Range(cmin, cmax)) << std::endl; + std::cout << "expected result:\n" << expected(Range(rmin, rmax), Range(cmin, cmax)) << std::endl; + + next = false; + } + } + + ASSERT_EQ(norm(diff, cv::NORM_INF), 0); +} + +TEST(Imgproc_resize_area, regression_quarter_round) +{ + static uchar input_data[32 * 32]; + for(int i = 0; i < 32 * 32; ++i) + input_data[i] = i % 2 + 253 + i / (16 * 32); + + static uchar expected_data[8 * 8]; + for(int i = 0; i < 8 * 8; ++i) + expected_data[i] = 254; + + cv::Mat src(32, 32, CV_8UC1, input_data); + cv::Mat expected(8, 8, CV_8UC1, expected_data); + cv::Mat actual(expected.size(), expected.type()); + + cv::resize(src, actual, cv::Size(), 0.25, 0.25, INTER_AREA); + + ASSERT_EQ(actual.type(), expected.type()); + ASSERT_EQ(actual.size(), expected.size()); + + Mat diff; + absdiff(actual, expected, diff); + + float elem_diff = 0.5f; + Size dsize = actual.size(); + bool next = true; + for (int dy = 0; dy < dsize.height && next; ++dy) + { + uchar* eD = expected.ptr(dy); + uchar* aD = actual.ptr(dy); + + for (int dx = 0; dx < dsize.width && next; ++dx) + if (fabs(static_cast(aD[dx] - eD[dx])) > elem_diff) + { + cvtest::TS::ptr()->printf(cvtest::TS::SUMMARY, "Inf norm: %f\n", static_cast(norm(actual, expected, NORM_INF))); + cvtest::TS::ptr()->printf(cvtest::TS::SUMMARY, "Error in : (%d, %d)\n", dx, dy); + + const int radius = 3; + int rmin = MAX(dy - radius, 0), rmax = MIN(dy + radius, dsize.height); + int cmin = MAX(dx - radius, 0), cmax = MIN(dx + radius, dsize.width); + + std::cout << "Abs diff:" << std::endl << diff << std::endl; + std::cout << "actual result:\n" << actual(Range(rmin, rmax), Range(cmin, cmax)) << std::endl; + std::cout << "expected result:\n" << expected(Range(rmin, rmax), Range(cmin, cmax)) << std::endl; + + next = false; + } + } + + ASSERT_EQ(norm(diff, cv::NORM_INF), 0); +} + ////////////////////////////////////////////////////////////////////////// From 4a0152c731fc919bbc15d0d19c31445fc060e391 Mon Sep 17 00:00:00 2001 From: Vitaly Tuzov Date: Fri, 31 Jul 2015 15:01:33 +0300 Subject: [PATCH 03/16] Resize area result verification moved to the separate function fix position of assert expected/actual parameter --- modules/imgproc/test/test_imgwarp.cpp | 153 +++++++++----------------- 1 file changed, 49 insertions(+), 104 deletions(-) diff --git a/modules/imgproc/test/test_imgwarp.cpp b/modules/imgproc/test/test_imgwarp.cpp index c2cf2bfc6..0568cbce0 100644 --- a/modules/imgproc/test/test_imgwarp.cpp +++ b/modules/imgproc/test/test_imgwarp.cpp @@ -1372,6 +1372,49 @@ void CV_GetQuadSubPixTest::prepare_to_validation( int /*test_case_idx*/ ) dst.convertTo(dst0, dst0.depth()); } +////////////////////////////// resizeArea ///////////////////////////////// + +template +static void check_resize_area(const Mat& expected, const Mat& actual, double tolerance = 1.0) +{ + ASSERT_EQ(actual.type(), expected.type()); + ASSERT_EQ(actual.size(), expected.size()); + + Mat diff; + absdiff(actual, expected, diff); + + Mat one_channel_diff = diff; //.reshape(1); + + Size dsize = actual.size(); + bool next = true; + for (int dy = 0; dy < dsize.height && next; ++dy) + { + const T* eD = expected.ptr(dy); + const T* aD = actual.ptr(dy); + + for (int dx = 0; dx < dsize.width && next; ++dx) + if (fabs(static_cast(aD[dx] - eD[dx])) > tolerance) + { + cvtest::TS::ptr()->printf(cvtest::TS::SUMMARY, "Inf norm: %f\n", static_cast(norm(actual, expected, NORM_INF))); + cvtest::TS::ptr()->printf(cvtest::TS::SUMMARY, "Error in : (%d, %d)\n", dx, dy); + + const int radius = 3; + int rmin = MAX(dy - radius, 0), rmax = MIN(dy + radius, dsize.height); + int cmin = MAX(dx - radius, 0), cmax = MIN(dx + radius, dsize.width); + + std::cout << "Abs diff:" << std::endl << diff << std::endl; + std::cout << "actual result:\n" << actual(Range(rmin, rmax), Range(cmin, cmax)) << std::endl; + std::cout << "expected result:\n" << expected(Range(rmin, rmax), Range(cmin, cmax)) << std::endl; + + next = false; + } + } + + ASSERT_EQ(0, norm(one_channel_diff, cv::NORM_INF)); +} + +/////////////////////////////////////////////////////////////////////////// + TEST(Imgproc_cvWarpAffine, regression) { IplImage* src = cvCreateImage(cvSize(100, 100), IPL_DEPTH_8U, 1); @@ -1501,52 +1544,18 @@ TEST(Imgproc_resize_area, regression) cv::resize(src, actual, cv::Size(), 0.3, 0.3, INTER_AREA); - ASSERT_EQ(actual.type(), expected.type()); - ASSERT_EQ(actual.size(), expected.size()); - - Mat diff; - absdiff(actual, expected, diff); - - Mat one_channel_diff = diff; //.reshape(1); - - float elem_diff = 1.0f; - Size dsize = actual.size(); - bool next = true; - for (int dy = 0; dy < dsize.height && next; ++dy) - { - ushort* eD = expected.ptr(dy); - ushort* aD = actual.ptr(dy); - - for (int dx = 0; dx < dsize.width && next; ++dx) - if (fabs(static_cast(aD[dx] - eD[dx])) > elem_diff) - { - cvtest::TS::ptr()->printf(cvtest::TS::SUMMARY, "Inf norm: %f\n", static_cast(norm(actual, expected, NORM_INF))); - cvtest::TS::ptr()->printf(cvtest::TS::SUMMARY, "Error in : (%d, %d)\n", dx, dy); - - const int radius = 3; - int rmin = MAX(dy - radius, 0), rmax = MIN(dy + radius, dsize.height); - int cmin = MAX(dx - radius, 0), cmax = MIN(dx + radius, dsize.width); - - std::cout << "Abs diff:" << std::endl << diff << std::endl; - std::cout << "actual result:\n" << actual(Range(rmin, rmax), Range(cmin, cmax)) << std::endl; - std::cout << "expected result:\n" << expected(Range(rmin, rmax), Range(cmin, cmax)) << std::endl; - - next = false; - } - } - - ASSERT_EQ(cvtest::norm(one_channel_diff, cv::NORM_INF), 0); + check_resize_area(expected, actual, 1.0); } TEST(Imgproc_resize_area, regression_half_round) { static uchar input_data[32 * 32]; for(int i = 0; i < 32 * 32; ++i) - input_data[i] = i % 2 + 253 + i / (16 * 32); + input_data[i] = (uchar)(i % 2 + 253 + i / (16 * 32)); static uchar expected_data[16 * 16]; for(int i = 0; i < 16 * 16; ++i) - expected_data[i] = 254 + i / (16 * 8); + expected_data[i] = (uchar)(254 + i / (16 * 8)); cv::Mat src(32, 32, CV_8UC1, input_data); cv::Mat expected(16, 16, CV_8UC1, expected_data); @@ -1554,46 +1563,14 @@ TEST(Imgproc_resize_area, regression_half_round) cv::resize(src, actual, cv::Size(), 0.5, 0.5, INTER_AREA); - ASSERT_EQ(actual.type(), expected.type()); - ASSERT_EQ(actual.size(), expected.size()); - - Mat diff; - absdiff(actual, expected, diff); - - float elem_diff = 0.5f; - Size dsize = actual.size(); - bool next = true; - for (int dy = 0; dy < dsize.height && next; ++dy) - { - uchar* eD = expected.ptr(dy); - uchar* aD = actual.ptr(dy); - - for (int dx = 0; dx < dsize.width && next; ++dx) - if (fabs(static_cast(aD[dx] - eD[dx])) > elem_diff) - { - cvtest::TS::ptr()->printf(cvtest::TS::SUMMARY, "Inf norm: %f\n", static_cast(norm(actual, expected, NORM_INF))); - cvtest::TS::ptr()->printf(cvtest::TS::SUMMARY, "Error in : (%d, %d)\n", dx, dy); - - const int radius = 3; - int rmin = MAX(dy - radius, 0), rmax = MIN(dy + radius, dsize.height); - int cmin = MAX(dx - radius, 0), cmax = MIN(dx + radius, dsize.width); - - std::cout << "Abs diff:" << std::endl << diff << std::endl; - std::cout << "actual result:\n" << actual(Range(rmin, rmax), Range(cmin, cmax)) << std::endl; - std::cout << "expected result:\n" << expected(Range(rmin, rmax), Range(cmin, cmax)) << std::endl; - - next = false; - } - } - - ASSERT_EQ(norm(diff, cv::NORM_INF), 0); + check_resize_area(expected, actual, 0.5); } TEST(Imgproc_resize_area, regression_quarter_round) { static uchar input_data[32 * 32]; for(int i = 0; i < 32 * 32; ++i) - input_data[i] = i % 2 + 253 + i / (16 * 32); + input_data[i] = (uchar)(i % 2 + 253 + i / (16 * 32)); static uchar expected_data[8 * 8]; for(int i = 0; i < 8 * 8; ++i) @@ -1605,39 +1582,7 @@ TEST(Imgproc_resize_area, regression_quarter_round) cv::resize(src, actual, cv::Size(), 0.25, 0.25, INTER_AREA); - ASSERT_EQ(actual.type(), expected.type()); - ASSERT_EQ(actual.size(), expected.size()); - - Mat diff; - absdiff(actual, expected, diff); - - float elem_diff = 0.5f; - Size dsize = actual.size(); - bool next = true; - for (int dy = 0; dy < dsize.height && next; ++dy) - { - uchar* eD = expected.ptr(dy); - uchar* aD = actual.ptr(dy); - - for (int dx = 0; dx < dsize.width && next; ++dx) - if (fabs(static_cast(aD[dx] - eD[dx])) > elem_diff) - { - cvtest::TS::ptr()->printf(cvtest::TS::SUMMARY, "Inf norm: %f\n", static_cast(norm(actual, expected, NORM_INF))); - cvtest::TS::ptr()->printf(cvtest::TS::SUMMARY, "Error in : (%d, %d)\n", dx, dy); - - const int radius = 3; - int rmin = MAX(dy - radius, 0), rmax = MIN(dy + radius, dsize.height); - int cmin = MAX(dx - radius, 0), cmax = MIN(dx + radius, dsize.width); - - std::cout << "Abs diff:" << std::endl << diff << std::endl; - std::cout << "actual result:\n" << actual(Range(rmin, rmax), Range(cmin, cmax)) << std::endl; - std::cout << "expected result:\n" << expected(Range(rmin, rmax), Range(cmin, cmax)) << std::endl; - - next = false; - } - } - - ASSERT_EQ(norm(diff, cv::NORM_INF), 0); + check_resize_area(expected, actual, 0.5); } From 344d9fd83f048d083783eaa792bccefed83c7815 Mon Sep 17 00:00:00 2001 From: Gleb Gladilov Date: Mon, 20 Jul 2015 15:10:46 +0300 Subject: [PATCH 04/16] Fixed minMaxLoc and test functions --- modules/core/src/stat.cpp | 12 ++++++++++-- modules/ts/src/ts_func.cpp | 15 ++++++--------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/modules/core/src/stat.cpp b/modules/core/src/stat.cpp index 0a4c0415c..ebb845a14 100644 --- a/modules/core/src/stat.cpp +++ b/modules/core/src/stat.cpp @@ -2331,8 +2331,8 @@ void cv::minMaxIdx(InputArray _src, double* minVal, size_t minidx = 0, maxidx = 0; int iminval = INT_MAX, imaxval = INT_MIN; - float fminval = FLT_MAX, fmaxval = -FLT_MAX; - double dminval = DBL_MAX, dmaxval = -DBL_MAX; + float fminval = std::numeric_limits::infinity(), fmaxval = -fminval; + double dminval = std::numeric_limits::infinity(), dmaxval = -dminval; size_t startidx = 1; int *minval = &iminval, *maxval = &imaxval; int planeSize = (int)it.size*cn; @@ -2345,6 +2345,14 @@ void cv::minMaxIdx(InputArray _src, double* minVal, for( size_t i = 0; i < it.nplanes; i++, ++it, startidx += planeSize ) func( ptrs[0], ptrs[1], minval, maxval, &minidx, &maxidx, planeSize, startidx ); + if (!src.empty() && mask.empty()) + { + if( minidx == 0 ) + minidx = 1; + if( maxidx == 0 ) + maxidx = 1; + } + if( minidx == 0 ) dminval = dmaxval = 0; else if( depth == CV_32F ) diff --git a/modules/ts/src/ts_func.cpp b/modules/ts/src/ts_func.cpp index f5fed678d..202a96f36 100644 --- a/modules/ts/src/ts_func.cpp +++ b/modules/ts/src/ts_func.cpp @@ -980,12 +980,12 @@ minMaxLoc_(const _Tp* src, size_t total, size_t startidx, for( size_t i = 0; i < total; i++ ) { _Tp val = src[i]; - if( minval > val ) + if( minval > val || !minpos ) { minval = val; minpos = startidx + i; } - if( maxval < val ) + if( maxval < val || !maxpos ) { maxval = val; maxpos = startidx + i; @@ -997,12 +997,12 @@ minMaxLoc_(const _Tp* src, size_t total, size_t startidx, for( size_t i = 0; i < total; i++ ) { _Tp val = src[i]; - if( minval > val && mask[i] ) + if( (minval > val || !minpos) && mask[i] ) { minval = val; minpos = startidx + i; } - if( maxval < val && mask[i] ) + if( (maxval < val || !maxpos) && mask[i] ) { maxval = val; maxpos = startidx + i; @@ -1049,8 +1049,8 @@ void minMaxLoc(const Mat& src, double* _minval, double* _maxval, size_t startidx = 1, total = planes[0].total(); size_t i, nplanes = it.nplanes; int depth = src.depth(); - double maxval = depth < CV_32F ? INT_MIN : depth == CV_32F ? -FLT_MAX : -DBL_MAX; - double minval = depth < CV_32F ? INT_MAX : depth == CV_32F ? FLT_MAX : DBL_MAX; + double minval = 0; + double maxval = 0; size_t maxidx = 0, minidx = 0; for( i = 0; i < nplanes; i++, ++it, startidx += total ) @@ -1093,9 +1093,6 @@ void minMaxLoc(const Mat& src, double* _minval, double* _maxval, } } - if( minidx == 0 ) - minval = maxval = 0; - if( _maxval ) *_maxval = maxval; if( _minval ) From 2bc448696681f9722ba31b0a264c6e629ecbefc0 Mon Sep 17 00:00:00 2001 From: Gleb Gladilov Date: Tue, 21 Jul 2015 18:08:30 +0300 Subject: [PATCH 05/16] Added test of minMaxLoc on filling with maximums of int --- modules/core/test/test_arithm.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/modules/core/test/test_arithm.cpp b/modules/core/test/test_arithm.cpp index 8bd45ee39..0471ffc0b 100644 --- a/modules/core/test/test_arithm.cpp +++ b/modules/core/test/test_arithm.cpp @@ -1792,7 +1792,6 @@ INSTANTIATE_TEST_CASE_P(Arithm, SubtractOutputMatNotEmpty, testing::Combine( testing::Values(-1, CV_16S, CV_32S, CV_32F), testing::Bool())); - TEST(Core_FindNonZero, singular) { Mat img(10, 10, CV_8U, Scalar::all(0)); @@ -1816,3 +1815,21 @@ TEST(Core_BoolVector, support) ASSERT_EQ( nz, countNonZero(test) ); ASSERT_FLOAT_EQ((float)nz/n, (float)(mean(test)[0])); } + +TEST(MinMaxLoc, Mat_IntMax_Without_Mask) +{ + Mat_ mat(50, 50); + int iMaxVal = numeric_limits::max(); + mat.setTo(iMaxVal); + + double min, max; + Point minLoc, maxLoc; + + minMaxLoc(mat, &min, &max, &minLoc, &maxLoc, Mat()); + + ASSERT_EQ(iMaxVal, min); + ASSERT_EQ(iMaxVal, max); + + ASSERT_EQ(Point(0, 0), minLoc); + ASSERT_EQ(Point(0, 0), maxLoc); +} From 5dd76a47919985447514289da101ebc6c8e11ad4 Mon Sep 17 00:00:00 2001 From: Roman Donchenko Date: Mon, 8 Jun 2015 16:08:58 +0300 Subject: [PATCH 06/16] Set CPACK_DEBIAN_PACKAGE_ARCHITECTURE instead of CPACK_DEBIAN_ARCHITECTURE Because that's the variable actually used by CPack. --- cmake/OpenCVPackaging.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmake/OpenCVPackaging.cmake b/cmake/OpenCVPackaging.cmake index 59d602c5d..eb3594736 100644 --- a/cmake/OpenCVPackaging.cmake +++ b/cmake/OpenCVPackaging.cmake @@ -20,21 +20,21 @@ endif(NOT OPENCV_CUSTOM_PACKAGE_INFO) #arch if(X86) - set(CPACK_DEBIAN_ARCHITECTURE "i386") + set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "i386") set(CPACK_RPM_PACKAGE_ARCHITECTURE "i686") elseif(X86_64) - set(CPACK_DEBIAN_ARCHITECTURE "amd64") + set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64") set(CPACK_RPM_PACKAGE_ARCHITECTURE "x86_64") elseif(ARM) - set(CPACK_DEBIAN_ARCHITECTURE "armhf") + set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "armhf") set(CPACK_RPM_PACKAGE_ARCHITECTURE "armhf") else() - set(CPACK_DEBIAN_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR}) + set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR}) set(CPACK_RPM_PACKAGE_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR}) endif() if(CPACK_GENERATOR STREQUAL "DEB") - set(OPENCV_PACKAGE_ARCH_SUFFIX ${CPACK_DEBIAN_ARCHITECTURE}) + set(OPENCV_PACKAGE_ARCH_SUFFIX ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}) elseif(CPACK_GENERATOR STREQUAL "RPM") set(OPENCV_PACKAGE_ARCH_SUFFIX ${CPACK_RPM_PACKAGE_ARCHITECTURE}) else() From c0cc51cb4b6677697b940cda943c239fc2849f24 Mon Sep 17 00:00:00 2001 From: Roman Donchenko Date: Mon, 8 Jun 2015 18:01:24 +0300 Subject: [PATCH 07/16] Add ARM64 packaging support --- cmake/OpenCVPackaging.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/OpenCVPackaging.cmake b/cmake/OpenCVPackaging.cmake index eb3594736..60af2008f 100644 --- a/cmake/OpenCVPackaging.cmake +++ b/cmake/OpenCVPackaging.cmake @@ -28,6 +28,9 @@ elseif(X86_64) elseif(ARM) set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "armhf") set(CPACK_RPM_PACKAGE_ARCHITECTURE "armhf") +elseif(AARCH64) + set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "arm64") + set(CPACK_RPM_PACKAGE_ARCHITECTURE "aarch64") else() set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR}) set(CPACK_RPM_PACKAGE_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR}) From 0e5fec288c836363883400aac4d679eab354231e Mon Sep 17 00:00:00 2001 From: Vladislav Vinogradov Date: Tue, 19 May 2015 18:17:28 +0300 Subject: [PATCH 08/16] check that current directory has write access --- cmake/templates/opencv_run_all_tests_unix.sh.in | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmake/templates/opencv_run_all_tests_unix.sh.in b/cmake/templates/opencv_run_all_tests_unix.sh.in index 7b946af13..a21bb03fd 100644 --- a/cmake/templates/opencv_run_all_tests_unix.sh.in +++ b/cmake/templates/opencv_run_all_tests_unix.sh.in @@ -55,6 +55,15 @@ OPENCV_TEST_PATH=@CMAKE_INSTALL_PREFIX@/@OPENCV_TEST_INSTALL_PATH@ OPENCV_PYTHON_TESTS=@OPENCV_PYTHON_TESTS_LIST@ export OPENCV_TEST_DATA_PATH=@CMAKE_INSTALL_PREFIX@/share/OpenCV/testdata +CUR_DIR=`pwd` +if [ -d "$CUR_DIR" -a -w "$CUR_DIR" ]; then + echo "${TEXT_CYAN}CUR_DIR : $CUR_DIR${TEXT_RESET}" +else + echo "${TEXT_RED}Error: Do not have permissions to write to $CUR_DIR${TEXT_RESET}" + echo "${TEXT_RED}Please run the script from directory with write access${TEXT_RESET}" + exit 1 +fi + # Run tests SUMMARY_STATUS=0 From ea35fee5b824b438be98d9a140f1b73557963833 Mon Sep 17 00:00:00 2001 From: Vladislav Vinogradov Date: Tue, 19 May 2015 18:22:30 +0300 Subject: [PATCH 09/16] save tests console output to separate log files --- cmake/templates/opencv_run_all_tests_unix.sh.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/templates/opencv_run_all_tests_unix.sh.in b/cmake/templates/opencv_run_all_tests_unix.sh.in index a21bb03fd..9789a6b7f 100644 --- a/cmake/templates/opencv_run_all_tests_unix.sh.in +++ b/cmake/templates/opencv_run_all_tests_unix.sh.in @@ -88,7 +88,7 @@ do fi echo "${TEXT_CYAN}[$test_name]${TEXT_RESET} RUN : $cmd" - $cmd | sed -r "$seg_reg" + eval "$cmd" | tee "$test_name.log" | sed -r "$seg_reg" ret=${PIPESTATUS[0]} echo "${TEXT_CYAN}[$test_name]${TEXT_RESET} RETURN_CODE : $ret" @@ -114,7 +114,7 @@ do seg_reg="s/^/${TEXT_CYAN}[$test_name]${TEXT_RESET} /" # append test name echo "${TEXT_CYAN}[$test_name]${TEXT_RESET} RUN : $cmd" - eval "$cmd" | sed -r "$seg_reg" + eval "$cmd" | tee "$test_name.log" | sed -r "$seg_reg" ret=${PIPESTATUS[0]} echo "${TEXT_CYAN}[$test_name]${TEXT_RESET} RETURN_CODE : $ret" From 6282ff0887ae5c3daaac759b9e821d6062ae4113 Mon Sep 17 00:00:00 2001 From: Vladislav Vinogradov Date: Tue, 19 May 2015 18:23:10 +0300 Subject: [PATCH 10/16] exclude dates from report names --- cmake/templates/opencv_run_all_tests_unix.sh.in | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cmake/templates/opencv_run_all_tests_unix.sh.in b/cmake/templates/opencv_run_all_tests_unix.sh.in index 9789a6b7f..f92d7c613 100644 --- a/cmake/templates/opencv_run_all_tests_unix.sh.in +++ b/cmake/templates/opencv_run_all_tests_unix.sh.in @@ -73,9 +73,8 @@ PASSED_TESTS="" for t in "$OPENCV_TEST_PATH/"opencv_test_* "$OPENCV_TEST_PATH/"opencv_perf_*; do test_name=`basename "$t"` - report="$test_name-`date --rfc-3339=date`.xml" - cmd="$t --perf_min_samples=1 --perf_force_samples=1 --gtest_output=xml:\"$report\"" + cmd="$t --perf_min_samples=1 --perf_force_samples=1 --gtest_output=xml:$test_name.xml" seg_reg="s/^/${TEXT_CYAN}[$test_name]${TEXT_RESET} /" # append test name if [ $COLOR_OUTPUT -eq 1 ]; then @@ -107,9 +106,8 @@ done for t in $OPENCV_PYTHON_TESTS; do test_name=`basename "$t"` - report="$test_name-`date --rfc-3339=date`.xml" - cmd="py.test --junitxml $report \"$OPENCV_TEST_PATH\"/$t" + cmd="py.test --junitxml $test_name.xml \"$OPENCV_TEST_PATH\"/$t" seg_reg="s/^/${TEXT_CYAN}[$test_name]${TEXT_RESET} /" # append test name From 55df326589b708dd765ee67e17eaa903164d7891 Mon Sep 17 00:00:00 2001 From: Dikay900 Date: Sat, 19 Sep 2015 14:05:38 +0200 Subject: [PATCH 11/16] PR #4003 --- modules/videoio/include/opencv2/videoio/cap_ios.h | 2 ++ modules/videoio/src/cap_ios_video_camera.mm | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/videoio/include/opencv2/videoio/cap_ios.h b/modules/videoio/include/opencv2/videoio/cap_ios.h index cf7f2e4ff..1a9875b25 100644 --- a/modules/videoio/include/opencv2/videoio/cap_ios.h +++ b/modules/videoio/include/opencv2/videoio/cap_ios.h @@ -71,6 +71,7 @@ @property (nonatomic, readonly) BOOL captureSessionLoaded; @property (nonatomic, assign) int defaultFPS; +@property (nonatomic, readonly) AVCaptureVideoPreviewLayer *captureVideoPreviewLayer; @property (nonatomic, assign) AVCaptureDevicePosition defaultAVCaptureDevicePosition; @property (nonatomic, assign) AVCaptureVideoOrientation defaultAVCaptureVideoOrientation; @property (nonatomic, assign) BOOL useAVCaptureVideoPreviewLayer; @@ -145,6 +146,7 @@ - (void)layoutPreviewLayer; - (void)saveVideo; - (NSURL *)videoFileURL; +- (NSString *)videoFileString; @end diff --git a/modules/videoio/src/cap_ios_video_camera.mm b/modules/videoio/src/cap_ios_video_camera.mm index 0acec6686..1ae70e298 100644 --- a/modules/videoio/src/cap_ios_video_camera.mm +++ b/modules/videoio/src/cap_ios_video_camera.mm @@ -41,7 +41,9 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;} -@interface CvVideoCamera () +@interface CvVideoCamera () { + int recordingCountDown; +} - (void)createVideoDataOutput; - (void)createVideoFileOutput; @@ -98,6 +100,7 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;} - (void)start; { + recordingCountDown = 10; [super start]; if (self.recordVideo == YES) { @@ -551,7 +554,8 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;} }); - if (self.recordVideo == YES) { + recordingCountDown--; + if (self.recordVideo == YES && recordingCountDown < 0) { lastSampleTime = CMSampleBufferGetPresentationTimeStamp(sampleBuffer); // CMTimeShow(lastSampleTime); if (self.recordAssetWriter.status != AVAssetWriterStatusWriting) { @@ -571,6 +575,8 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;} withPresentationTime:lastSampleTime] ) { NSLog(@"Video Writing Error"); } + if (pixelBuffer != nullptr) + CVPixelBufferRelease(pixelBuffer); } } From c7bfdc2063285d864d7e713c4fa2b6c2716330b9 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Wed, 6 May 2015 13:10:39 +0300 Subject: [PATCH 12/16] Added explicit deb package dependency from libtbb-dev if TBB is enabled. --- cmake/OpenCVPackaging.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmake/OpenCVPackaging.cmake b/cmake/OpenCVPackaging.cmake index 60af2008f..2330decda 100644 --- a/cmake/OpenCVPackaging.cmake +++ b/cmake/OpenCVPackaging.cmake @@ -99,6 +99,14 @@ if(HAVE_CUDA) set(CPACK_COMPONENT_dev_DEPENDS libs) endif() +if(HAVE_TBB AND NOT BUILD_TBB) + if(CPACK_DEB_DEV_PACKAGE_DEPENDS) + set(CPACK_DEB_DEV_PACKAGE_DEPENDS "${CPACK_DEB_DEV_PACKAGE_DEPENDS}, libtbb-dev") + else() + set(CPACK_DEB_DEV_PACKAGE_DEPENDS "libtbb-dev") + endif() +endif() + if(NOT OPENCV_CUSTOM_PACKAGE_INFO) set(CPACK_COMPONENT_LIBS_DESCRIPTION "Open Computer Vision Library") set(CPACK_DEBIAN_COMPONENT_LIBS_NAME "lib${CMAKE_PROJECT_NAME}") From bd5a222d84684a888bcc8d5b13b823b77ea90728 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Thu, 4 Jun 2015 15:42:27 +0300 Subject: [PATCH 13/16] Debian packages header update to fix conflict with OpenCV from deb repo. --- cmake/OpenCVPackaging.cmake | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/cmake/OpenCVPackaging.cmake b/cmake/OpenCVPackaging.cmake index 2330decda..894f669e5 100644 --- a/cmake/OpenCVPackaging.cmake +++ b/cmake/OpenCVPackaging.cmake @@ -107,6 +107,35 @@ if(HAVE_TBB AND NOT BUILD_TBB) endif() endif() +set(STD_OPENCV_LIBS opencv-data libopencv-calib3d2.4 libopencv-contrib2.4 libopencv-core2.4 + libopencv-features2d2.4 libopencv-flann2.4 libopencv-gpu2.4 libopencv-imgproc2.4 + libopencv-ml2.4 libopencv-ocl2.4 libopencv-stitching2.4 libopencv-ts2.4 libopencv-videostab2.4) + +set(STD_OPENCV_DEV libopencv-calib3d-dev libopencv-contrib-dev libopencv-core-dev + libopencv-dev libopencv-features2d-dev libopencv-flann-dev libopencv-gpu-dev + libopencv-highgui-dev libopencv-imgproc-dev libopencv-legacy-dev libopencv-ml-dev + libopencv-objdetect-dev libopencv-ocl-dev libopencv-photo-dev libopencv-stitching-dev + libopencv-superres-dev libopencv-ts-dev libopencv-video-dev libopencv-videostab-dev) + +string(REPLACE ";" ", " CPACK_COMPONENT_LIBS_CONFLICTS "${STD_OPENCV_LIBS}") +string(REPLACE ";" ", " CPACK_COMPONENT_LIBS_PROVIDES "${STD_OPENCV_LIBS}") +string(REPLACE ";" ", " CPACK_COMPONENT_LIBS_REPLACES "${STD_OPENCV_LIBS}") + +string(REPLACE ";" ", " CPACK_COMPONENT_DEV_CONFLICTS "${STD_OPENCV_DEV}") +string(REPLACE ";" ", " CPACK_COMPONENT_DEV_PROVIDES "${STD_OPENCV_DEV}") +string(REPLACE ";" ", " CPACK_COMPONENT_DEV_REPLACES "${STD_OPENCV_DEV}") + +set(CPACK_COMPONENT_PYTHON_CONFLICTS python-opencv) +set(CPACK_COMPONENT_PYTHON_PROVIDES python-opencv) +set(CPACK_COMPONENT_PYTHON_REPLACES python-opencv) + +set(CPACK_COMPONENT_JAVA_CONFLICTS "libopencv2.4-java, libopencv2.4-jni") +set(CPACK_COMPONENT_JAVA_PROVIDES "libopencv2.4-java, libopencv2.4-jni") +set(CPACK_COMPONENT_JAVA_REPLACES "libopencv2.4-java, libopencv2.4-jni") + +set(CPACK_COMPONENT_DOCS_CONFLICTS opencv-doc) +set(CPACK_COMPONENT_SAMPLES_CONFLICTS opencv-doc) + if(NOT OPENCV_CUSTOM_PACKAGE_INFO) set(CPACK_COMPONENT_LIBS_DESCRIPTION "Open Computer Vision Library") set(CPACK_DEBIAN_COMPONENT_LIBS_NAME "lib${CMAKE_PROJECT_NAME}") From 7749eb5d1f43091a535dcaeba23c5af792c75f5d Mon Sep 17 00:00:00 2001 From: Roman Donchenko Date: Tue, 25 Aug 2015 18:50:06 +0300 Subject: [PATCH 14/16] Add missing packages to the Debian conflict list And refactor the code to make sure that the dev and runtime package lists are in sync. --- cmake/OpenCVPackaging.cmake | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/cmake/OpenCVPackaging.cmake b/cmake/OpenCVPackaging.cmake index 894f669e5..b3943e79a 100644 --- a/cmake/OpenCVPackaging.cmake +++ b/cmake/OpenCVPackaging.cmake @@ -107,15 +107,14 @@ if(HAVE_TBB AND NOT BUILD_TBB) endif() endif() -set(STD_OPENCV_LIBS opencv-data libopencv-calib3d2.4 libopencv-contrib2.4 libopencv-core2.4 - libopencv-features2d2.4 libopencv-flann2.4 libopencv-gpu2.4 libopencv-imgproc2.4 - libopencv-ml2.4 libopencv-ocl2.4 libopencv-stitching2.4 libopencv-ts2.4 libopencv-videostab2.4) +set(STD_OPENCV_LIBS opencv-data) +set(STD_OPENCV_DEV libopencv-dev) -set(STD_OPENCV_DEV libopencv-calib3d-dev libopencv-contrib-dev libopencv-core-dev - libopencv-dev libopencv-features2d-dev libopencv-flann-dev libopencv-gpu-dev - libopencv-highgui-dev libopencv-imgproc-dev libopencv-legacy-dev libopencv-ml-dev - libopencv-objdetect-dev libopencv-ocl-dev libopencv-photo-dev libopencv-stitching-dev - libopencv-superres-dev libopencv-ts-dev libopencv-video-dev libopencv-videostab-dev) +foreach(module calib3d contrib core features2d flann gpu highgui imgproc legacy + ml objdetect ocl photo stitching superres ts video videostab) + list(APPEND STD_OPENCV_LIBS "libopencv-${module}2.4") + list(APPEND STD_OPENCV_DEV "libopencv-${module}-dev") +endforeach() string(REPLACE ";" ", " CPACK_COMPONENT_LIBS_CONFLICTS "${STD_OPENCV_LIBS}") string(REPLACE ";" ", " CPACK_COMPONENT_LIBS_PROVIDES "${STD_OPENCV_LIBS}") From 2eab5eb6c080b319674366a375c49b02497e9ea9 Mon Sep 17 00:00:00 2001 From: Roman Donchenko Date: Wed, 26 Aug 2015 13:42:21 +0300 Subject: [PATCH 15/16] Only conflict with packages corresponding to modules that are built --- cmake/OpenCVPackaging.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/OpenCVPackaging.cmake b/cmake/OpenCVPackaging.cmake index b3943e79a..1574ffa73 100644 --- a/cmake/OpenCVPackaging.cmake +++ b/cmake/OpenCVPackaging.cmake @@ -112,8 +112,10 @@ set(STD_OPENCV_DEV libopencv-dev) foreach(module calib3d contrib core features2d flann gpu highgui imgproc legacy ml objdetect ocl photo stitching superres ts video videostab) - list(APPEND STD_OPENCV_LIBS "libopencv-${module}2.4") - list(APPEND STD_OPENCV_DEV "libopencv-${module}-dev") + if(HAVE_opencv_${module}) + list(APPEND STD_OPENCV_LIBS "libopencv-${module}2.4") + list(APPEND STD_OPENCV_DEV "libopencv-${module}-dev") + endif() endforeach() string(REPLACE ";" ", " CPACK_COMPONENT_LIBS_CONFLICTS "${STD_OPENCV_LIBS}") From 32a4ec156bc9f56ad2520ffbf29b0bb6a71d718b Mon Sep 17 00:00:00 2001 From: Dikay900 Date: Sat, 19 Sep 2015 14:15:40 +0200 Subject: [PATCH 16/16] changes to reflect 3.0 status --- cmake/OpenCVPackaging.cmake | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cmake/OpenCVPackaging.cmake b/cmake/OpenCVPackaging.cmake index 1574ffa73..21a82a478 100644 --- a/cmake/OpenCVPackaging.cmake +++ b/cmake/OpenCVPackaging.cmake @@ -110,10 +110,12 @@ endif() set(STD_OPENCV_LIBS opencv-data) set(STD_OPENCV_DEV libopencv-dev) -foreach(module calib3d contrib core features2d flann gpu highgui imgproc legacy - ml objdetect ocl photo stitching superres ts video videostab) +foreach(module calib3d core cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters + cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping + cudev features2d flann hal highgui imgcodecs imgproc ml objdetect ocl + photo shape stitching superres ts video videoio videostab viz) if(HAVE_opencv_${module}) - list(APPEND STD_OPENCV_LIBS "libopencv-${module}2.4") + list(APPEND STD_OPENCV_LIBS "libopencv-${module}3.0") list(APPEND STD_OPENCV_DEV "libopencv-${module}-dev") endif() endforeach() @@ -130,9 +132,9 @@ set(CPACK_COMPONENT_PYTHON_CONFLICTS python-opencv) set(CPACK_COMPONENT_PYTHON_PROVIDES python-opencv) set(CPACK_COMPONENT_PYTHON_REPLACES python-opencv) -set(CPACK_COMPONENT_JAVA_CONFLICTS "libopencv2.4-java, libopencv2.4-jni") -set(CPACK_COMPONENT_JAVA_PROVIDES "libopencv2.4-java, libopencv2.4-jni") -set(CPACK_COMPONENT_JAVA_REPLACES "libopencv2.4-java, libopencv2.4-jni") +set(CPACK_COMPONENT_JAVA_CONFLICTS "libopencv3.0-java, libopencv3.0-jni") +set(CPACK_COMPONENT_JAVA_PROVIDES "libopencv3.0-java, libopencv3.0-jni") +set(CPACK_COMPONENT_JAVA_REPLACES "libopencv3.0-java, libopencv3.0-jni") set(CPACK_COMPONENT_DOCS_CONFLICTS opencv-doc) set(CPACK_COMPONENT_SAMPLES_CONFLICTS opencv-doc)