From b6b9ec5db12332470fef2176cd209f895ae1b4c1 Mon Sep 17 00:00:00 2001 From: Michael Platings Date: Mon, 20 Jan 2025 17:56:55 +0000 Subject: [PATCH] Remove OpenCV 4.10 support The purpose of this change is to avoid the cost of supporting many versions of OpenCV. --- CHANGELOG.md | 3 + .../opencv/extra_benchmarks/opencv-4.10.patch | 825 ------------------ adapters/opencv/opencv-4.10.patch | 345 -------- 3 files changed, 3 insertions(+), 1170 deletions(-) delete mode 100644 adapters/opencv/extra_benchmarks/opencv-4.10.patch delete mode 100644 adapters/opencv/opencv-4.10.patch diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ad96463c..14816afce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,9 @@ This changelog aims to follow the guiding principles of ### Fixed - Handling of cv::erode and cv::dilate non-default constant borders. +### Removed +- Support for OpenCV 4.10. + ## 0.3.0 - 2024-12-12 ### Added diff --git a/adapters/opencv/extra_benchmarks/opencv-4.10.patch b/adapters/opencv/extra_benchmarks/opencv-4.10.patch deleted file mode 100644 index 66d80fe3f..000000000 --- a/adapters/opencv/extra_benchmarks/opencv-4.10.patch +++ /dev/null @@ -1,825 +0,0 @@ -// SPDX-FileCopyrightText: 2024 Arm Limited and/or its affiliates -// SPDX-FileCopyrightText: Copyright (C) 2000-2022, Intel Corporation, all rights reserved. -// SPDX-FileCopyrightText: Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. -// SPDX-FileCopyrightText: Copyright (C) 2009-2016, NVIDIA Corporation, all rights reserved. -// SPDX-FileCopyrightText: Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved. -// SPDX-FileCopyrightText: Copyright (C) 2015-2023, OpenCV Foundation, all rights reserved. -// SPDX-FileCopyrightText: Copyright (C) 2008-2016, Itseez Inc., all rights reserved. -// SPDX-FileCopyrightText: Copyright (C) 2019-2023, Xperience AI, all rights reserved. -// SPDX-FileCopyrightText: Copyright (C) 2019-2022, Shenzhen Institute of Artificial Intelligence and Robotics for Society, all rights reserved. -// SPDX-FileCopyrightText: Copyright (C) 2022-2023, Southern University of Science And Technology, all rights reserved. -// SPDX-FileCopyrightText: Third party copyrights are property of their respective owners. -// -// SPDX-License-Identifier: Apache-2.0 - -diff --git a/modules/core/perf/perf_arithm.cpp b/modules/core/perf/perf_arithm.cpp -index 36f400e34f..2f39ff1274 100644 ---- a/modules/core/perf/perf_arithm.cpp -+++ b/modules/core/perf/perf_arithm.cpp -@@ -447,7 +447,7 @@ PERF_TEST_P_(BinaryOpTest, transposeND) - - INSTANTIATE_TEST_CASE_P(/*nothing*/ , BinaryOpTest, - testing::Combine( -- testing::Values(szVGA, sz720p, sz1080p), -+ testing::Values(szVGA, sz720p, sz1080p, sz2160p), - testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_8SC1, CV_16SC1, CV_16SC2, CV_16SC3, CV_16SC4, CV_32SC1, CV_32FC1) - ) - ); -diff --git a/modules/core/perf/perf_compare.cpp b/modules/core/perf/perf_compare.cpp -index be706e1a83..862b8b7c35 100644 ---- a/modules/core/perf/perf_compare.cpp -+++ b/modules/core/perf/perf_compare.cpp -@@ -11,7 +11,7 @@ typedef perf::TestBaseWithParam Size_MatType_CmpType; - - PERF_TEST_P( Size_MatType_CmpType, compare, - testing::Combine( -- testing::Values(::perf::szVGA, ::perf::sz1080p), -+ testing::Values(::perf::szVGA, ::perf::sz1080p, ::perf::sz2160p), - testing::Values(CV_8UC1, CV_8UC4, CV_8SC1, CV_16UC1, CV_16SC1, CV_32SC1, CV_32FC1), - CmpType::all() - ) -diff --git a/modules/core/perf/perf_convertTo.cpp b/modules/core/perf/perf_convertTo.cpp -index 344d81cb8a..ef5a3aa7d2 100644 ---- a/modules/core/perf/perf_convertTo.cpp -+++ b/modules/core/perf/perf_convertTo.cpp -@@ -4,17 +4,18 @@ namespace opencv_test - { - using namespace perf; - --typedef tuple Size_DepthSrc_DepthDst_Channels_alpha_t; --typedef perf::TestBaseWithParam Size_DepthSrc_DepthDst_Channels_alpha; -+typedef tuple Size_DepthSrc_DepthDst_Channels_alpha_beta_t; -+typedef perf::TestBaseWithParam Size_DepthSrc_DepthDst_Channels_alpha_beta; - --PERF_TEST_P( Size_DepthSrc_DepthDst_Channels_alpha, convertTo, -+PERF_TEST_P( Size_DepthSrc_DepthDst_Channels_alpha_beta, convertTo, - testing::Combine - ( -- testing::Values(szVGA, sz1080p), -+ testing::Values(sz1080p, sz2160p), - testing::Values(CV_8U, CV_8S, CV_16U, CV_16S, CV_32S, CV_32F, CV_64F), - testing::Values(CV_8U, CV_8S, CV_16U, CV_16S, CV_32S, CV_32F, CV_64F), - testing::Values(1, 4), -- testing::Values(1.0, 1./255) -+ testing::Values(1.0, 1./255, 1.234), -+ testing::Values(0, 4.567) - ) - ) - { -@@ -23,6 +24,7 @@ PERF_TEST_P( Size_DepthSrc_DepthDst_Channels_alpha, convertTo, - int depthDst = get<2>(GetParam()); - int channels = get<3>(GetParam()); - double alpha = get<4>(GetParam()); -+ double beta = get<5>(GetParam()); - - int maxValue = 255; - -@@ -31,7 +33,7 @@ PERF_TEST_P( Size_DepthSrc_DepthDst_Channels_alpha, convertTo, - Mat dst(sz, CV_MAKETYPE(depthDst, channels)); - - int runs = (sz.width <= 640) ? 8 : 1; -- TEST_CYCLE_MULTIRUN(runs) src.convertTo(dst, depthDst, alpha); -+ TEST_CYCLE_MULTIRUN(runs) src.convertTo(dst, depthDst, alpha, beta); - - double eps = depthSrc <= CV_32S && (depthDst <= CV_32S || depthDst == CV_64F) ? 1e-12 : (FLT_EPSILON * maxValue); - eps = eps * std::max(1.0, fabs(alpha)); -diff --git a/modules/core/perf/perf_exp.cpp b/modules/core/perf/perf_exp.cpp -new file mode 100644 -index 0000000000..6b20e19a0c ---- /dev/null -+++ b/modules/core/perf/perf_exp.cpp -@@ -0,0 +1,59 @@ -+#include "perf_precomp.hpp" -+ -+namespace opencv_test -+{ -+using namespace perf; -+ -+typedef perf::TestBaseWithParam Exp; -+ -+PERF_TEST_P( Exp, ExpAnyInput, -+ testing::Combine -+ ( -+ testing::Values(sz1080p, sz2160p), -+ testing::Values(CV_32FC4) -+ ) -+ ) -+{ -+ cv::RNG rng(0); -+ -+ Size sz = get<0>(GetParam()); -+ int type = get<1>(GetParam()); -+ -+ Mat src(sz, type); -+ Mat dst(sz, type); -+ -+ declare.in(src, WARMUP_RNG).out(dst); -+ -+ TEST_CYCLE() cv::exp(src, dst); -+ -+ SANITY_CHECK(dst); -+} -+ -+PERF_TEST_P( Exp, ExpSmallInput, -+ testing::Combine -+ ( -+ testing::Values(sz1080p, sz2160p), -+ testing::Values(CV_32F) -+ ) -+ ) -+{ -+ cv::RNG rng(0); -+ -+ Size sz = get<0>(GetParam()); -+ int type = get<1>(GetParam()); -+ -+ Mat src(sz, type); -+ Mat dst(sz, type); -+ -+ // Keping input values in a range where output's 1st derivative is -+ // manageable (0.001 < exp'(x) < 1000) -+ rng.fill(src, cv::RNG::UNIFORM, -7.0, 7.0); -+ -+ declare.out(dst); -+ -+ TEST_CYCLE() cv::exp(src, dst); -+ -+ SANITY_CHECK(dst); -+} -+ -+} // namespace -diff --git a/modules/core/perf/perf_inRangeScalar.cpp b/modules/core/perf/perf_inRangeScalar.cpp -new file mode 100644 -index 0000000000..9ecca30b6c ---- /dev/null -+++ b/modules/core/perf/perf_inRangeScalar.cpp -@@ -0,0 +1,34 @@ -+#include "perf_precomp.hpp" -+ -+namespace opencv_test -+{ -+using namespace perf; -+ -+typedef tuple Size_TypeSrc_lb_ub_t; -+typedef perf::TestBaseWithParam Size_TypeSrc_lb_ub; -+ -+PERF_TEST_P( Size_TypeSrc_lb_ub, inRangeScalar, -+ testing::Combine -+ ( -+ testing::Values(sz1080p, sz2160p), -+ testing::Values(CV_8UC1, CV_32FC1), -+ testing::Values(1), -+ testing::Values(2) -+ ) -+ ) -+{ -+ Size size = get<0>(GetParam()); -+ int type = get<1>(GetParam()); -+ Mat lb (1, 1, type, get<2>(GetParam())); -+ Mat ub (1, 1, type, get<3>(GetParam())); -+ Mat src(size, type); -+ Mat dst(size, CV_8UC1); -+ -+ declare.in(src, WARMUP_RNG).out(dst); -+ -+ TEST_CYCLE() inRange( src, lb, ub, dst ); -+ -+ SANITY_CHECK(dst); -+} -+ -+} // namespace -diff --git a/modules/core/perf/perf_minMaxIdx.cpp b/modules/core/perf/perf_minMaxIdx.cpp -new file mode 100644 -index 0000000000..b5c4ddad05 ---- /dev/null -+++ b/modules/core/perf/perf_minMaxIdx.cpp -@@ -0,0 +1,34 @@ -+#include "perf_precomp.hpp" -+ -+namespace opencv_test -+{ -+using namespace perf; -+ -+PERF_TEST_P(Size_MatType, minMaxVals, testing::Combine( -+ testing::Values(TYPICAL_MAT_SIZES), -+ testing::Values(CV_8UC1, CV_8SC1, CV_16UC1, CV_16SC1, CV_32SC1, CV_32FC1) -+ ) -+ ) -+{ -+ Size sz = get<0>(GetParam()); -+ int matType = get<1>(GetParam()); -+ -+ Mat src(sz, matType); -+ double minVal, maxVal; -+ -+ if (matType == CV_8U) -+ randu(src, 1, 254 /*do not include 0 and 255 to avoid early exit on 1 byte data*/); -+ else if (matType == CV_8S) -+ randu(src, -127, 126); -+ else -+ warmup(src, WARMUP_RNG); -+ -+ declare.in(src); -+ -+ TEST_CYCLE() cv::minMaxIdx(src, &minVal, &maxVal, nullptr, nullptr); -+ -+ SANITY_CHECK(minVal, 1e-12); -+ SANITY_CHECK(maxVal, 1e-12); -+} -+ -+} // namespace -diff --git a/modules/core/perf/perf_transpose.cpp b/modules/core/perf/perf_transpose.cpp -new file mode 100644 -index 0000000000..7c6a4afaf2 ---- /dev/null -+++ b/modules/core/perf/perf_transpose.cpp -@@ -0,0 +1,50 @@ -+#include "perf_precomp.hpp" -+ -+namespace opencv_test -+{ -+using namespace perf; -+ -+typedef perf::TestBaseWithParam Transpose; -+ -+PERF_TEST_P( Transpose, Copy, -+ testing::Combine -+ ( -+ testing::Values(sz1080p, sz2160p), -+ testing::Values(CV_8U, CV_16U, CV_32S, CV_64F) -+ ) -+ ) -+{ -+ Size sz = get<0>(GetParam()); -+ int type = get<1>(GetParam()); -+ -+ Mat src(sz, type); -+ Mat dst(sz, type); -+ -+ declare.in(src, WARMUP_RNG).out(dst); -+ -+ TEST_CYCLE() cv::transpose(src, dst); -+ -+ SANITY_CHECK(dst); -+} -+ -+PERF_TEST_P( Transpose, InPlace, -+ testing::Combine -+ ( -+ testing::Values(sz1080p, sz2160p), -+ testing::Values(CV_8U, CV_16U, CV_32S, CV_64F) -+ ) -+ ) -+{ -+ Size sz = get<0>(GetParam()); -+ int type = get<1>(GetParam()); -+ -+ Mat src(sz, type); -+ -+ declare.in(src, WARMUP_RNG); -+ -+ TEST_CYCLE() cv::transpose(src, src); -+ -+ SANITY_CHECK(src); -+} -+ -+} // namespace -diff --git a/modules/imgproc/perf/perf_blur.cpp b/modules/imgproc/perf/perf_blur.cpp -index d1f5a6b1ca..62463e2a28 100644 ---- a/modules/imgproc/perf/perf_blur.cpp -+++ b/modules/imgproc/perf/perf_blur.cpp -@@ -35,6 +35,7 @@ PERF_TEST_P(Size_MatType_kSize, medianBlur, - - CV_ENUM(BorderType3x3, BORDER_REPLICATE, BORDER_CONSTANT) - CV_ENUM(BorderType, BORDER_REPLICATE, BORDER_CONSTANT, BORDER_REFLECT, BORDER_REFLECT101) -+CV_ENUM(BorderTypeKleidiCV, BORDER_REPLICATE, BORDER_REFLECT, BORDER_REFLECT101, BORDER_WRAP) - - typedef tuple Size_MatType_BorderType3x3_t; - typedef perf::TestBaseWithParam Size_MatType_BorderType3x3; -@@ -45,9 +46,12 @@ typedef perf::TestBaseWithParam Size_MatType_BorderTy - typedef tuple Size_ksize_BorderType_t; - typedef perf::TestBaseWithParam Size_ksize_BorderType; - -+typedef tuple Size_MatType_BorderTypeKleidiCV_t; -+typedef perf::TestBaseWithParam Size_MatType_BorderTypeKleidiCV; -+ - PERF_TEST_P(Size_MatType_BorderType3x3, gaussianBlur3x3, - testing::Combine( -- testing::Values(szODD, szQVGA, szVGA, sz720p), -+ testing::Values(szODD, szQVGA, szVGA, sz720p, sz1080p, sz2160p), - testing::Values(CV_8UC1, CV_8UC4, CV_16UC1, CV_16SC1, CV_32FC1), - BorderType3x3::all() - ) -@@ -67,6 +71,28 @@ PERF_TEST_P(Size_MatType_BorderType3x3, gaussianBlur3x3, - SANITY_CHECK(dst, 1); - } - -+PERF_TEST_P(Size_MatType_BorderType3x3, gaussianBlur3x3_CustomSigma, -+ testing::Combine( -+ testing::Values(szODD, szQVGA, szVGA, sz720p, sz1080p, sz2160p), -+ testing::Values(CV_8UC1, CV_8UC4, CV_16UC1, CV_16SC1, CV_32FC1), -+ BorderType3x3::all() -+ ) -+ ) -+{ -+ Size size = get<0>(GetParam()); -+ int type = get<1>(GetParam()); -+ BorderType3x3 btype = get<2>(GetParam()); -+ -+ Mat src(size, type); -+ Mat dst(size, type); -+ -+ declare.in(src, WARMUP_RNG).out(dst); -+ -+ TEST_CYCLE() GaussianBlur(src, dst, Size(3,3), 2.2, 2.2, btype); -+ -+ SANITY_CHECK(dst, 1); -+} -+ - PERF_TEST_P(Size_MatType_BorderType3x3, blur3x3, - testing::Combine( - testing::Values(szODD, szQVGA, szVGA, sz720p), -@@ -188,7 +214,7 @@ PERF_TEST_P(Size_MatType_BorderType3x3, box3x3_inplace, - - PERF_TEST_P(Size_MatType_BorderType, gaussianBlur5x5, - testing::Combine( -- testing::Values(szODD, szQVGA, szVGA, sz720p), -+ testing::Values(szODD, szQVGA, szVGA, sz720p, sz1080p, sz2160p), - testing::Values(CV_8UC1, CV_8UC4, CV_16UC1, CV_16SC1, CV_32FC1), - BorderType::all() - ) -@@ -208,6 +234,116 @@ PERF_TEST_P(Size_MatType_BorderType, gaussianBlur5x5, - SANITY_CHECK(dst, 1); - } - -+PERF_TEST_P(Size_MatType_BorderType, gaussianBlur5x5_CustomSigma, -+ testing::Combine( -+ testing::Values(szODD, szQVGA, szVGA, sz720p, sz1080p, sz2160p), -+ testing::Values(CV_8UC1, CV_8UC4, CV_16UC1, CV_16SC1, CV_32FC1), -+ BorderType::all() -+ ) -+ ) -+{ -+ Size size = get<0>(GetParam()); -+ int type = get<1>(GetParam()); -+ BorderType btype = get<2>(GetParam()); -+ -+ Mat src(size, type); -+ Mat dst(size, type); -+ -+ declare.in(src, WARMUP_RNG).out(dst); -+ -+ TEST_CYCLE() GaussianBlur(src, dst, Size(5,5), 2.2, 2.2, btype); -+ -+ SANITY_CHECK(dst, 1); -+} -+ -+PERF_TEST_P(Size_MatType_BorderTypeKleidiCV, gaussianBlur7x7, -+ testing::Combine( -+ testing::Values(sz1080p, sz2160p), -+ testing::Values(CV_8UC1, CV_8UC4), -+ BorderTypeKleidiCV::all() -+ ) -+ ) -+{ -+ Size size = get<0>(GetParam()); -+ int type = get<1>(GetParam()); -+ BorderTypeKleidiCV btype = get<2>(GetParam()); -+ -+ Mat src(size, type); -+ Mat dst(size, type); -+ -+ declare.in(src, WARMUP_RNG).out(dst); -+ -+ TEST_CYCLE() GaussianBlur(src, dst, Size(7,7), 0, 0, btype); -+ -+ SANITY_CHECK(dst, 1); -+} -+ -+PERF_TEST_P(Size_MatType_BorderTypeKleidiCV, gaussianBlur7x7_CustomSigma, -+ testing::Combine( -+ testing::Values(sz1080p, sz2160p), -+ testing::Values(CV_8UC1, CV_8UC4), -+ BorderTypeKleidiCV::all() -+ ) -+ ) -+{ -+ Size size = get<0>(GetParam()); -+ int type = get<1>(GetParam()); -+ BorderTypeKleidiCV btype = get<2>(GetParam()); -+ -+ Mat src(size, type); -+ Mat dst(size, type); -+ -+ declare.in(src, WARMUP_RNG).out(dst); -+ -+ TEST_CYCLE() GaussianBlur(src, dst, Size(7,7), 2.2, 2.2, btype); -+ -+ SANITY_CHECK(dst, 1); -+} -+ -+PERF_TEST_P(Size_MatType_BorderTypeKleidiCV, gaussianBlur15x15, -+ testing::Combine( -+ testing::Values(sz1080p, sz2160p), -+ testing::Values(CV_8UC1, CV_8UC4), -+ BorderTypeKleidiCV::all() -+ ) -+ ) -+{ -+ Size size = get<0>(GetParam()); -+ int type = get<1>(GetParam()); -+ BorderTypeKleidiCV btype = get<2>(GetParam()); -+ -+ Mat src(size, type); -+ Mat dst(size, type); -+ -+ declare.in(src, WARMUP_RNG).out(dst); -+ -+ TEST_CYCLE() GaussianBlur(src, dst, Size(15,15), 0, 0, btype); -+ -+ SANITY_CHECK(dst, 1); -+} -+ -+PERF_TEST_P(Size_MatType_BorderTypeKleidiCV, gaussianBlur15x15_CustomSigma, -+ testing::Combine( -+ testing::Values(sz1080p, sz2160p), -+ testing::Values(CV_8UC1, CV_8UC4), -+ BorderTypeKleidiCV::all() -+ ) -+ ) -+{ -+ Size size = get<0>(GetParam()); -+ int type = get<1>(GetParam()); -+ BorderTypeKleidiCV btype = get<2>(GetParam()); -+ -+ Mat src(size, type); -+ Mat dst(size, type); -+ -+ declare.in(src, WARMUP_RNG).out(dst); -+ -+ TEST_CYCLE() GaussianBlur(src, dst, Size(15,15), 2.2, 2.2, btype); -+ -+ SANITY_CHECK(dst, 1); -+} -+ - PERF_TEST_P(Size_MatType_BorderType, blur5x5, - testing::Combine( - testing::Values(szVGA, sz720p), -diff --git a/modules/imgproc/perf/perf_cvt_color.cpp b/modules/imgproc/perf/perf_cvt_color.cpp -index 5915b507ce..4a8c02df40 100644 ---- a/modules/imgproc/perf/perf_cvt_color.cpp -+++ b/modules/imgproc/perf/perf_cvt_color.cpp -@@ -319,7 +319,7 @@ typedef perf::TestBaseWithParam Size_CvtMode; - - PERF_TEST_P(Size_CvtMode, cvtColor8u, - testing::Combine( -- testing::Values(::perf::szODD, ::perf::szVGA, ::perf::sz1080p), -+ testing::Values(::perf::szODD, ::perf::szVGA, ::perf::sz1080p, ::perf::sz2160p), - CvtMode::all() - ) - ) -@@ -435,7 +435,7 @@ typedef perf::TestBaseWithParam Size_CvtMode2; - - PERF_TEST_P(Size_CvtMode2, cvtColorYUV420, - testing::Combine( -- testing::Values(szVGA, sz1080p, Size(130, 60)), -+ testing::Values(szVGA, sz1080p, sz2160p, Size(130, 60)), - CvtMode2::all() - ) - ) -diff --git a/modules/imgproc/perf/perf_morph.cpp b/modules/imgproc/perf/perf_morph.cpp -index dc9e975a21..1b73c5eaee 100644 ---- a/modules/imgproc/perf/perf_morph.cpp -+++ b/modules/imgproc/perf/perf_morph.cpp -@@ -39,4 +39,64 @@ PERF_TEST_P(Size_MatType, dilate, TYPICAL_MATS_MORPH) - SANITY_CHECK(dst); - } - -+typedef tuple MorphParams_t; -+typedef perf::TestBaseWithParam Erode; -+typedef perf::TestBaseWithParam Dilate; -+ -+PERF_TEST_P(Erode, big, -+ testing::Combine( -+ testing::Values(::perf::sz1080p, ::perf::sz2160p), -+ testing::Values(CV_8UC1), -+ testing::Values(3, 5, 17) -+ )) -+{ -+ Size sz = get<0>(GetParam()); -+ int type = get<1>(GetParam()); -+ int kernelSize = get<2>(GetParam()); -+ -+ Mat src(sz, type); -+ Mat dst(sz, type); -+ -+ declare.in(src, WARMUP_RNG).out(dst); -+ -+ const cv::MorphShapes morph_shape = cv::MorphShapes::MORPH_RECT; -+ const cv::Size kernel{kernelSize, kernelSize}; -+ const cv::Point anchor{-1, -1}; -+ -+ cv::Mat element = cv::getStructuringElement(morph_shape, kernel, anchor); -+ -+ TEST_CYCLE() erode(src, dst, element, cv::Point(-1, -1), 1, -+ cv::BorderTypes::BORDER_CONSTANT, cv::Scalar(0xAA)); -+ -+ SANITY_CHECK(dst); -+} -+ -+PERF_TEST_P(Dilate, big, -+ testing::Combine( -+ testing::Values(::perf::sz1080p, ::perf::sz2160p), -+ testing::Values(CV_8UC1), -+ testing::Values(3, 5, 17) -+ )) -+{ -+ Size sz = get<0>(GetParam()); -+ int type = get<1>(GetParam()); -+ int kernelSize = get<2>(GetParam()); -+ -+ Mat src(sz, type); -+ Mat dst(sz, type); -+ -+ declare.in(src, WARMUP_RNG).out(dst); -+ -+ const cv::MorphShapes morph_shape = cv::MorphShapes::MORPH_RECT; -+ const cv::Size kernel{kernelSize, kernelSize}; -+ const cv::Point anchor{-1, -1}; -+ -+ cv::Mat element = cv::getStructuringElement(morph_shape, kernel, anchor); -+ -+ TEST_CYCLE() dilate(src, dst, element, cv::Point(-1, -1), 1, -+ cv::BorderTypes::BORDER_CONSTANT, cv::Scalar(0xAA)); -+ -+ SANITY_CHECK(dst); -+} -+ - } // namespace -diff --git a/modules/imgproc/perf/perf_pyramids.cpp b/modules/imgproc/perf/perf_pyramids.cpp -index 5dd5b9cece..42c83b2903 100644 ---- a/modules/imgproc/perf/perf_pyramids.cpp -+++ b/modules/imgproc/perf/perf_pyramids.cpp -@@ -6,7 +6,7 @@ - namespace opencv_test { - - PERF_TEST_P(Size_MatType, pyrDown, testing::Combine( -- testing::Values(sz1080p, sz720p, szVGA, szQVGA, szODD), -+ testing::Values(sz1080p, sz720p, szVGA, szQVGA, szODD, sz2160p), - testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1, CV_32FC3, CV_32FC4) - ) - ) -diff --git a/modules/imgproc/perf/perf_remap.cpp b/modules/imgproc/perf/perf_remap.cpp -index bd2129d233..351c082bed 100644 ---- a/modules/imgproc/perf/perf_remap.cpp -+++ b/modules/imgproc/perf/perf_remap.cpp -@@ -6,25 +6,28 @@ - namespace opencv_test { - - CV_ENUM(InterType, INTER_NEAREST, INTER_LINEAR, INTER_CUBIC, INTER_LANCZOS4) -+CV_ENUM(BorderType, BORDER_REPLICATE, BORDER_CONSTANT) - --typedef TestBaseWithParam< tuple > TestRemap; -+typedef TestBaseWithParam< tuple > TestRemap; - - PERF_TEST_P( TestRemap, Remap, - Combine( -- Values( szVGA, sz1080p ), -- Values( CV_16UC1, CV_16SC1, CV_32FC1 ), -+ Values( szVGA, sz1080p, sz2160p ), -+ Values( CV_8UC1, CV_16UC1, CV_16SC1, CV_32FC1 ), - Values( CV_16SC2, CV_32FC1, CV_32FC2 ), -- InterType::all() -+ InterType::all(), -+ BorderType::all() - ) - ) - { - Size sz; -- int src_type, map1_type, inter_type; -+ int src_type, map1_type, inter_type, border_type; - - sz = get<0>(GetParam()); - src_type = get<1>(GetParam()); - map1_type = get<2>(GetParam()); - inter_type = get<3>(GetParam()); -+ border_type = get<4>(GetParam()); - - Mat src(sz, src_type), dst(sz, src_type), map1(sz, map1_type), map2; - if (map1_type == CV_32FC1) -@@ -62,7 +65,7 @@ PERF_TEST_P( TestRemap, Remap, - declare.in(src, WARMUP_RNG).out(dst).time(20); - - int runs = (sz.width <= 640) ? 3 : 1; -- TEST_CYCLE_MULTIRUN(runs) remap(src, dst, map1, map2, inter_type); -+ TEST_CYCLE_MULTIRUN(runs) remap(src, dst, map1, map2, inter_type, border_type); - - SANITY_CHECK(dst); - } -diff --git a/modules/imgproc/perf/perf_resize.cpp b/modules/imgproc/perf/perf_resize.cpp -index 0f470a5f81..4e31ffec82 100644 ---- a/modules/imgproc/perf/perf_resize.cpp -+++ b/modules/imgproc/perf/perf_resize.cpp -@@ -67,7 +67,18 @@ PERF_TEST_P(MatInfo_SizePair, resizeUpLinearNonExact, - testing::Combine - ( - testing::Values( MATTYPE_NE_VALUES ), -- testing::Values( Size_Size_t(szVGA, szqHD), Size_Size_t(szVGA, sz720p) ) -+ testing::Values -+ ( -+ // 2*2 -+ Size_Size_t(szqHD, sz1080p), -+ Size_Size_t(sz1080p, sz2160p), -+ // 4*4 -+ Size_Size_t(cv::Size(480, 270), sz1080p), -+ Size_Size_t(szqHD, sz2160p), -+ // 8*8 -+ Size_Size_t(cv::Size(240, 135), sz1080p), -+ Size_Size_t(cv::Size(480, 270), sz2160p) -+ ) - ) - ) - { -@@ -142,7 +153,9 @@ PERF_TEST_P(MatInfo_SizePair, resizeDownLinearNonExact, - Size_Size_t(szqHD, szVGA), - Size_Size_t(sz720p, Size(120 * sz720p.width / sz720p.height, 120)), - Size_Size_t(sz720p, szVGA), -- Size_Size_t(sz720p, szQVGA) -+ Size_Size_t(sz720p, szQVGA), -+ Size_Size_t(sz1080p, szqHD), -+ Size_Size_t(sz2160p, sz1080p) - ) - ) - ) -@@ -173,7 +186,7 @@ typedef TestBaseWithParam MatInfo_Size_Scale; - PERF_TEST_P(MatInfo_Size_Scale, ResizeAreaFast, - testing::Combine( - testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4), -- testing::Values(szVGA, szqHD, sz720p, sz1080p), -+ testing::Values(szVGA, szqHD, sz720p, sz1080p, sz2160p), - testing::Values(2) - ) - ) -diff --git a/modules/imgproc/perf/perf_sepfilters.cpp b/modules/imgproc/perf/perf_sepfilters.cpp -index 480aab9f20..d33a29d5ed 100644 ---- a/modules/imgproc/perf/perf_sepfilters.cpp -+++ b/modules/imgproc/perf/perf_sepfilters.cpp -@@ -5,7 +5,7 @@ - - namespace opencv_test { - --#define FILTER_SRC_SIZES szODD, szQVGA, szVGA -+#define FILTER_SRC_SIZES szODD, szQVGA, szVGA, sz1080p, sz2160p - - CV_ENUM(BorderType3x3, BORDER_REPLICATE, BORDER_CONSTANT) - CV_ENUM(BorderType3x3ROI, BORDER_DEFAULT, BORDER_REPLICATE|BORDER_ISOLATED, BORDER_CONSTANT|BORDER_ISOLATED) -@@ -242,4 +242,32 @@ PERF_TEST_P(Size_MatType_dx_dy_Border3x3ROI, scharrViaSobelFilter, - SANITY_CHECK(dst); - } - -+CV_ENUM(BorderMode_KleidiCV, BORDER_REPLICATE, BORDER_REFLECT, BORDER_REFLECT_101) -+typedef TestBaseWithParam> SepFilter2D_KleidiCV; -+ -+PERF_TEST_P(SepFilter2D_KleidiCV, SepFilter2D, -+ testing::Combine( -+ testing::Values(sz1080p, sz2160p), -+ testing::Values(CV_8UC1, CV_8UC4, CV_16UC1, CV_16UC4, CV_16SC1, CV_16SC4), -+ testing::Values(5), -+ BorderMode_KleidiCV::all() -+ ) -+ ) -+{ -+ const Size srcSize = get<0>(GetParam()); -+ const int type = get<1>(GetParam()), ksize = get<2>(GetParam()), borderMode = get<3>(GetParam()); -+ -+ Mat src(srcSize, type), dst(srcSize, type); -+ declare.in(src, WARMUP_RNG).out(dst); -+ -+ Mat kernelX(1, ksize, type); -+ randu(kernelX, -3.0, 3.0); -+ Mat kernelY(1, ksize, type); -+ randu(kernelY, -3.0, 3.0); -+ -+ TEST_CYCLE() cv::sepFilter2D(src, dst, -1, kernelX, kernelY, cv::Point(-1, -1), 0.0f, borderMode); -+ -+ SANITY_CHECK_NOTHING(); -+} -+ - } // namespace -diff --git a/modules/imgproc/perf/perf_warp.cpp b/modules/imgproc/perf/perf_warp.cpp -index 3716e663f9..c7421ee067 100644 ---- a/modules/imgproc/perf/perf_warp.cpp -+++ b/modules/imgproc/perf/perf_warp.cpp -@@ -13,7 +13,7 @@ CV_ENUM(InterTypeExtended, INTER_NEAREST, INTER_LINEAR, WARP_RELATIVE_MAP) - CV_ENUM(RemapMode, HALF_SIZE, UPSIDE_DOWN, REFLECTION_X, REFLECTION_BOTH) - - typedef TestBaseWithParam< tuple > TestWarpAffine; --typedef TestBaseWithParam< tuple > TestWarpPerspective; -+typedef TestBaseWithParam< tuple > TestWarpPerspective; - typedef TestBaseWithParam< tuple > TestWarpPerspectiveNear_t; - typedef TestBaseWithParam< tuple > TestRemap; - -@@ -81,20 +81,22 @@ PERF_TEST_P(TestWarpAffine, DISABLED_WarpAffine_ovx, - - PERF_TEST_P( TestWarpPerspective, WarpPerspective, - Combine( -- Values( szVGA, sz720p, sz1080p ), -+ Values( szVGA, sz720p, sz1080p, sz2160p ), - InterType::all(), -- BorderMode::all() -+ BorderMode::all(), -+ Values( CV_8UC1, CV_8UC4 ) - ) - ) - { - Size sz, szSrc(512, 512); -- int borderMode, interType; -+ int borderMode, interType, type; - sz = get<0>(GetParam()); - interType = get<1>(GetParam()); - borderMode = get<2>(GetParam()); -+ type = get<3>(GetParam()); - Scalar borderColor = Scalar::all(150); - -- Mat src(szSrc,CV_8UC4), dst(sz, CV_8UC4); -+ Mat src(szSrc, type), dst(sz, type); - cvtest::fillGradient(src); - if(borderMode == BORDER_CONSTANT) cvtest::smoothBorder(src, borderColor, 1); - Mat rotMat = getRotationMatrix2D(Point2f(src.cols/2.f, src.rows/2.f), 30., 2.2); -@@ -121,18 +123,20 @@ PERF_TEST_P(TestWarpPerspective, DISABLED_WarpPerspective_ovx, - Combine( - Values(szVGA, sz720p, sz1080p), - InterType::all(), -- BorderMode::all() -+ BorderMode::all(), -+ Values( CV_8UC1, CV_8UC4 ) - ) - ) - { - Size sz, szSrc(512, 512); -- int borderMode, interType; -+ int borderMode, interType, type; - sz = get<0>(GetParam()); - interType = get<1>(GetParam()); - borderMode = get<2>(GetParam()); -+ type = get<2>(GetParam()); - Scalar borderColor = Scalar::all(150); - -- Mat src(szSrc, CV_8UC1), dst(sz, CV_8UC1); -+ Mat src(szSrc, type), dst(sz, type); - cvtest::fillGradient(src); - if (borderMode == BORDER_CONSTANT) cvtest::smoothBorder(src, borderColor, 1); - Mat rotMat = getRotationMatrix2D(Point2f(src.cols / 2.f, src.rows / 2.f), 30., 2.2); -@@ -157,7 +161,7 @@ PERF_TEST_P(TestWarpPerspective, DISABLED_WarpPerspective_ovx, - - PERF_TEST_P( TestWarpPerspectiveNear_t, WarpPerspectiveNear, - Combine( -- Values( Size(640,480), Size(1920,1080), Size(2592,1944) ), -+ Values( szVGA, sz720p, sz1080p, sz5MP, sz2160p ), - InterType::all(), - BorderMode::all(), - Values( CV_8UC1, CV_8UC4 ) -diff --git a/modules/ts/include/opencv2/ts/ts_perf.hpp b/modules/ts/include/opencv2/ts/ts_perf.hpp -index 7aa3809f27..9ff587f325 100644 ---- a/modules/ts/include/opencv2/ts/ts_perf.hpp -+++ b/modules/ts/include/opencv2/ts/ts_perf.hpp -@@ -78,7 +78,7 @@ const static cv::Size szSmall128 = cv::Size(128, 128); - #define SZ_TYPICAL ::testing::Values(::perf::szVGA, ::perf::szqHD, ::perf::sz720p, ::perf::szODD) - - --#define TYPICAL_MAT_SIZES ::perf::szVGA, ::perf::sz720p, ::perf::sz1080p, ::perf::szODD -+#define TYPICAL_MAT_SIZES ::perf::szVGA, ::perf::sz720p, ::perf::sz1080p, ::perf::szODD, ::perf::sz2160p - #define TYPICAL_MAT_TYPES CV_8UC1, CV_8UC4, CV_32FC1 - #define TYPICAL_MATS testing::Combine( testing::Values( TYPICAL_MAT_SIZES ), testing::Values( TYPICAL_MAT_TYPES ) ) - #define TYPICAL_MATS_C1 testing::Combine( testing::Values( TYPICAL_MAT_SIZES ), testing::Values( CV_8UC1, CV_32FC1 ) ) -diff --git a/modules/video/perf/perf_optflowpyrlk.cpp b/modules/video/perf/perf_optflowpyrlk.cpp -index aca8a1399b..6bae000b2d 100644 ---- a/modules/video/perf/perf_optflowpyrlk.cpp -+++ b/modules/video/perf/perf_optflowpyrlk.cpp -@@ -266,4 +266,26 @@ PERF_TEST_P(Path_Win_Deriv_Border_Reuse, OpticalFlowPyrLK_pyr, testing::Combine( - SANITY_CHECK_NOTHING(); - } - -+typedef perf::TestBaseWithParam calcScharrDerivParams; -+PERF_TEST_P(calcScharrDerivParams, calcScharrDeriv, testing::Values(sz1080p, sz2160p)) -+{ -+ cv::RNG rng(0); -+ -+ Size sz = GetParam(); -+ -+ Mat src(sz, CV_8UC1); -+ std::vector pyramid; -+ -+ // `winSize` is not take into account when `maxLevel` is set to 0. -+ buildOpticalFlowPyramid(src, pyramid, cv::Size(3, 3), 0, true); -+ -+ declare.in(src).out(pyramid); -+ -+ TEST_CYCLE() { -+ buildOpticalFlowPyramid(src, pyramid, cv::Size(3, 3), 0, true); -+ } -+ -+ SANITY_CHECK_NOTHING(); -+} -+ - }} // namespace diff --git a/adapters/opencv/opencv-4.10.patch b/adapters/opencv/opencv-4.10.patch deleted file mode 100644 index 85599737b..000000000 --- a/adapters/opencv/opencv-4.10.patch +++ /dev/null @@ -1,345 +0,0 @@ -// SPDX-FileCopyrightText: 2024 Arm Limited and/or its affiliates -// SPDX-FileCopyrightText: Copyright (C) 2000-2022, Intel Corporation, all rights reserved. -// SPDX-FileCopyrightText: Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. -// SPDX-FileCopyrightText: Copyright (C) 2009-2016, NVIDIA Corporation, all rights reserved. -// SPDX-FileCopyrightText: Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved. -// SPDX-FileCopyrightText: Copyright (C) 2015-2023, OpenCV Foundation, all rights reserved. -// SPDX-FileCopyrightText: Copyright (C) 2008-2016, Itseez Inc., all rights reserved. -// SPDX-FileCopyrightText: Copyright (C) 2019-2023, Xperience AI, all rights reserved. -// SPDX-FileCopyrightText: Copyright (C) 2019-2022, Shenzhen Institute of Artificial Intelligence and Robotics for Society, all rights reserved. -// SPDX-FileCopyrightText: Copyright (C) 2022-2023, Southern University of Science And Technology, all rights reserved. -// SPDX-FileCopyrightText: Third party copyrights are property of their respective owners. -// -// SPDX-License-Identifier: Apache-2.0 - -diff --git a/modules/core/src/convert.dispatch.cpp b/modules/core/src/convert.dispatch.cpp -index 2b4035285f..729cd1dd43 100644 ---- a/modules/core/src/convert.dispatch.cpp -+++ b/modules/core/src/convert.dispatch.cpp -@@ -281,6 +281,11 @@ void Mat::convertTo(OutputArray dst, int type_, double alpha, double beta) const - dst.create(dims, size, dtype); - Mat dstMat = dst.getMat(); - -+ if( dims <= 2 ) { -+ int width_in_elements = src.cols * cn; -+ CALL_HAL(convertTo, cv_hal_convertTo, src.data, src.step, src.depth(), dstMat.data, dstMat.step, dstMat.depth(), width_in_elements, src.rows, alpha, beta); -+ } -+ - BinaryFunc func = noScale ? getConvertFunc(sdepth, ddepth) : getConvertScaleFunc(sdepth, ddepth); - double scale[] = {alpha, beta}; - CV_Assert( func != 0 ); -diff --git a/modules/core/src/hal_replacement.hpp b/modules/core/src/hal_replacement.hpp -index f78608dbad..a9384588ec 100644 ---- a/modules/core/src/hal_replacement.hpp -+++ b/modules/core/src/hal_replacement.hpp -@@ -953,6 +953,53 @@ inline int hal_ni_transpose2d(const uchar* src_data, size_t src_step, uchar* dst - #define cv_hal_transpose2d hal_ni_transpose2d - //! @endcond - -+/** -+ @brief sum -+ @param src_data,src_step,src_type Source image -+ @param width,height Source image dimensions -+ @param result Pointer to save the sum result to. -+*/ -+inline int hal_ni_sum(const uchar *src_data, size_t src_step, int src_type, size_t width, size_t height, double *result) { return CV_HAL_ERROR_NOT_IMPLEMENTED; } -+ -+//! @cond IGNORED -+#define cv_hal_sum hal_ni_sum -+//! @endcond -+ -+/** -+ @brief convertTo -+ @param src_data,src_step,src_depth Source image -+ @param dst_data,dst_step,dst_depth Destination image -+ @param width,height Source image dimensions -+ @param scale,shift Dst values = src_value * scale + shift -+*/ -+inline int hal_ni_convertTo(const uchar *src_data, size_t src_step, int src_depth, -+ uchar *dst_data, size_t dst_step, int dst_depth, int width, -+ int height, double scale, double shift) { return CV_HAL_ERROR_NOT_IMPLEMENTED; } -+ -+//! @cond IGNORED -+#define cv_hal_convertTo hal_ni_convertTo -+//! @endcond -+ -+/** -+ @brief inRange -+ @param src_data,src_step,src_depth Source image -+ @param dst_data,dst_step,dst_depth Destination image -+ @param width,height Source image dimensions -+ @param cn number of channels -+ @param lower_bound,upper_bound Dst values = (lower_bound <= src_value) && (src_value <= upper_bound) ? 255 : 0 -+*/ -+inline int hal_ni_inRange8u(const uchar *src_data, size_t src_step, -+ uchar *dst_data, size_t dst_step, int dst_depth, int width, -+ int height, int cn, uchar lower_bound, uchar upper_bound) { return CV_HAL_ERROR_NOT_IMPLEMENTED; } -+inline int hal_ni_inRange32f(const uchar *src_data, size_t src_step, -+ uchar *dst_data, size_t dst_step, int dst_depth, int width, -+ int height, int cn, double lower_bound, double upper_bound) { return CV_HAL_ERROR_NOT_IMPLEMENTED; } -+ -+//! @cond IGNORED -+#define cv_hal_inRange8u hal_ni_inRange8u -+#define cv_hal_inRange32f hal_ni_inRange32f -+//! @endcond -+ - //! @} - - -diff --git a/modules/core/src/minmax.cpp b/modules/core/src/minmax.cpp -index 8c6d8ad9a9..47eb6fdb66 100644 ---- a/modules/core/src/minmax.cpp -+++ b/modules/core/src/minmax.cpp -@@ -1524,9 +1524,9 @@ void cv::minMaxIdx(InputArray _src, double* minVal, - { - // minIdx[0] and minIdx[0] are always 0 for "flatten" version - if (minIdx) -- ofs2idx(src, minIdx[1], minIdx); -+ ofs2idx(src, minIdx[1] + 1, minIdx); - if (maxIdx) -- ofs2idx(src, maxIdx[1], maxIdx); -+ ofs2idx(src, maxIdx[1] + 1, maxIdx); - return; - } - else if (res != CV_HAL_ERROR_NOT_IMPLEMENTED) -diff --git a/modules/core/src/sum.dispatch.cpp b/modules/core/src/sum.dispatch.cpp -index fade948336..17b40ca0e8 100644 ---- a/modules/core/src/sum.dispatch.cpp -+++ b/modules/core/src/sum.dispatch.cpp -@@ -199,6 +199,10 @@ Scalar sum(InputArray _src) - CV_IPP_RUN(IPP_VERSION_X100 >= 700, ipp_sum(src, _res), _res); - - int k, cn = src.channels(), depth = src.depth(); -+ -+ double result = 0; -+ CALL_HAL_RET(sum, cv_hal_sum, result, src.data, src.step, src.type(), src.cols, src.rows); -+ - SumFunc func = getSumFunc(depth); - CV_Assert( cn <= 4 && func != 0 ); - -diff --git a/modules/imgproc/src/hal_replacement.hpp b/modules/imgproc/src/hal_replacement.hpp -index 773fed9b48..b74ff70f99 100644 ---- a/modules/imgproc/src/hal_replacement.hpp -+++ b/modules/imgproc/src/hal_replacement.hpp -@@ -328,6 +328,60 @@ inline int hal_ni_remap32f(int src_type, const uchar *src_data, size_t src_step, - #define cv_hal_remap32f hal_ni_remap32f - //! @endcond - -+/** -+ @brief hal_remap with a short integer map -+ @param src_type source and destination image type -+ @param src_data source image data -+ @param src_step source image step -+ @param src_width source image width -+ @param src_height source image height -+ @param dst_data destination image data -+ @param dst_step destination image step -+ @param dst_width destination image width -+ @param dst_height destination image height -+ @param mapxy map for interleaved x and y values -+ @param mapxy_step mapxy matrix step -+ @param border_type border processing mode (CV_HAL_BORDER_REFLECT, ...) -+ @param border_value values to use for CV_HAL_BORDER_CONSTANT mode -+ @sa cv::remap -+ */ -+inline int hal_ni_remap16s(int src_type, const uchar *src_data, size_t src_step, int src_width, int src_height, -+ uchar *dst_data, size_t dst_step, int dst_width, int dst_height, -+ const short* mapxy, size_t mapxy_step, int border_type, const double border_value[4]) -+{ return CV_HAL_ERROR_NOT_IMPLEMENTED; } -+ -+//! @cond IGNORED -+#define cv_hal_remap16s hal_ni_remap16s -+//! @endcond -+ -+/** -+ @brief hal_remap with short maps plus fractions -+ @param src_type source and destination image type -+ @param src_data source image data -+ @param src_step source image step -+ @param src_width source image width -+ @param src_height source image height -+ @param dst_data destination image data -+ @param dst_step destination image step -+ @param dst_width destination image width -+ @param dst_height destination image height -+ @param mapxy map for interleaved x and y values -+ @param mapxy_step mapxy matrix step -+ @param mapfrac map for fractional part x and y values (5+5 bits) -+ @param mapfrac_step mapfrac matrix step -+ @param border_type border processing mode (CV_HAL_BORDER_REFLECT, ...) -+ @param border_value values to use for CV_HAL_BORDER_CONSTANT mode -+ @sa cv::remap -+ */ -+inline int hal_ni_remap16s16u(int src_type, const uchar *src_data, size_t src_step, int src_width, int src_height, -+ uchar *dst_data, size_t dst_step, int dst_width, int dst_height, -+ const short* mapxy, size_t mapxy_step, const unsigned short* mapfrac, size_t mapfrac_step, int border_type, const double border_value[4]) -+{ return CV_HAL_ERROR_NOT_IMPLEMENTED; } -+ -+//! @cond IGNORED -+#define cv_hal_remap16s16u hal_ni_remap16s16u -+//! @endcond -+ - /** - @brief hal_cvtBGRtoBGR - @param src_data source image data -diff --git a/modules/imgproc/src/imgwarp.cpp b/modules/imgproc/src/imgwarp.cpp -index d7c9c64c3c..348208b72d 100644 ---- a/modules/imgproc/src/imgwarp.cpp -+++ b/modules/imgproc/src/imgwarp.cpp -@@ -1819,6 +1819,14 @@ void cv::remap( InputArray _src, OutputArray _dst, - { - CALL_HAL(remap32f, cv_hal_remap32f, src.type(), src.data, src.step, src.cols, src.rows, dst.data, dst.step, dst.cols, dst.rows, - map1.ptr(), map1.step, map2.ptr(), map2.step, interpolation, borderType, borderValue.val); -+ } else if ((map1.type() == CV_16SC2) && map2.empty() && interpolation == INTER_NEAREST) -+ { -+ CALL_HAL(remap16s, cv_hal_remap16s, src.type(), src.data, src.step, src.cols, src.rows, dst.data, dst.step, dst.cols, dst.rows, -+ map1.ptr(), map1.step, borderType, borderValue.val); -+ } else if ((map1.type() == CV_16SC2) && (map2.type() == CV_16UC1) && interpolation == INTER_LINEAR) -+ { -+ CALL_HAL(remap16s16u, cv_hal_remap16s16u, src.type(), src.data, src.step, src.cols, src.rows, dst.data, dst.step, dst.cols, dst.rows, -+ map1.ptr(), map1.step, map2.ptr(), map2.step, borderType, borderValue.val); - } - - interpolation &= ~WARP_RELATIVE_MAP; -diff --git a/modules/imgproc/src/smooth.dispatch.cpp b/modules/imgproc/src/smooth.dispatch.cpp -index d0f50a73bb..1c308887dc 100644 ---- a/modules/imgproc/src/smooth.dispatch.cpp -+++ b/modules/imgproc/src/smooth.dispatch.cpp -@@ -654,6 +654,25 @@ void GaussianBlur(InputArray _src, OutputArray _dst, Size ksize, - ocl_GaussianBlur_8UC1(_src, _dst, ksize, CV_MAT_DEPTH(type), kx, ky, borderType) - ); - -+ { -+ Mat src = _src.getMat(); -+ Mat dst = _dst.getMat(); -+ -+ Point ofs; -+ Size wsz(src.cols, src.rows); -+ if(!(borderType & BORDER_ISOLATED)) -+ src.locateROI( wsz, ofs ); -+ -+ if (sigma1 == 0.0 && sigma2 == 0.0 && ksize.height == ksize.width) { -+ CALL_HAL(gaussianBlurBinomial, cv_hal_gaussianBlurBinomial, src.ptr(), src.step, dst.ptr(), dst.step, src.cols, src.rows, sdepth, cn, -+ ofs.x, ofs.y, wsz.width - src.cols - ofs.x, wsz.height - src.rows - ofs.y, ksize.width, borderType&~BORDER_ISOLATED); -+ } -+ -+ CALL_HAL(gaussianBlur, cv_hal_gaussianBlur, src.ptr(), src.step, dst.ptr(), dst.step, src.cols, src.rows, sdepth, cn, -+ ofs.x, ofs.y, wsz.width - src.cols - ofs.x, wsz.height - src.rows - ofs.y, ksize.width, ksize.height, -+ sigma1, sigma2, borderType&~BORDER_ISOLATED); -+ } -+ - if(sdepth == CV_8U && ((borderType & BORDER_ISOLATED) || !_src.isSubmatrix())) - { - std::vector fkx, fky; -diff --git a/modules/video/src/hal_replacement.hpp b/modules/video/src/hal_replacement.hpp -new file mode 100644 -index 0000000000..e413dd3894 ---- /dev/null -+++ b/modules/video/src/hal_replacement.hpp -@@ -0,0 +1,73 @@ -+// This file is part of OpenCV project. -+// It is subject to the license terms in the LICENSE file found in the top-level directory -+// of this distribution and at http://opencv.org/license.html. -+ -+#ifndef OPENCV_VIDEO_HAL_REPLACEMENT_HPP -+#define OPENCV_VIDEO_HAL_REPLACEMENT_HPP -+ -+#include "opencv2/core/hal/interface.h" -+ -+#if defined(__clang__) // clang or MSVC clang -+#pragma clang diagnostic push -+#pragma clang diagnostic ignored "-Wunused-parameter" -+#elif defined(_MSC_VER) -+#pragma warning(push) -+#pragma warning(disable : 4100) -+#elif defined(__GNUC__) -+#pragma GCC diagnostic push -+#pragma GCC diagnostic ignored "-Wunused-parameter" -+#endif -+ -+/** -+@brief Computes Schaar derivatives with inteleaved layout xyxy... -+@param src_data source image data -+@param src_step source image step -+@param dst_data destination buffer data -+@param dst_step destination buffer step -+@param width image width -+@param height image height -+@param cn source image channels -+**/ -+inline int hal_ni_ScharrDeriv(const uchar* src_data, size_t src_step, -+ short* dst_data, size_t dst_step, -+ int width, int height, int cn) -+{ -+ return CV_HAL_ERROR_NOT_IMPLEMENTED; -+} -+ -+//! @cond IGNORED -+#define cv_hal_ScharrDeriv hal_ni_ScharrDeriv -+//! @endcond -+ -+//! @} -+ -+#if defined(__clang__) -+#pragma clang diagnostic pop -+#elif defined(_MSC_VER) -+#pragma warning(pop) -+#elif defined(__GNUC__) -+#pragma GCC diagnostic pop -+#endif -+ -+#include "custom_hal.hpp" -+ -+//! @cond IGNORED -+#define CALL_HAL_RET(name, fun, retval, ...) \ -+ int res = __CV_EXPAND(fun(__VA_ARGS__, &retval)); \ -+ if (res == CV_HAL_ERROR_OK) \ -+ return retval; \ -+ else if (res != CV_HAL_ERROR_NOT_IMPLEMENTED) \ -+ CV_Error_(cv::Error::StsInternal, \ -+ ("HAL implementation " CVAUX_STR(name) " ==> " CVAUX_STR(fun) " returned %d (0x%08x)", res, res)); -+ -+ -+#define CALL_HAL(name, fun, ...) \ -+ int res = __CV_EXPAND(fun(__VA_ARGS__)); \ -+ if (res == CV_HAL_ERROR_OK) \ -+ return; \ -+ else if (res != CV_HAL_ERROR_NOT_IMPLEMENTED) \ -+ CV_Error_(cv::Error::StsInternal, \ -+ ("HAL implementation " CVAUX_STR(name) " ==> " CVAUX_STR(fun) " returned %d (0x%08x)", res, res)); -+//! @endcond -+ -+#endif -diff --git a/modules/video/src/lkpyramid.cpp b/modules/video/src/lkpyramid.cpp -index 6d51c0cf1a..0e6f6a324e 100644 ---- a/modules/video/src/lkpyramid.cpp -+++ b/modules/video/src/lkpyramid.cpp -@@ -50,6 +50,7 @@ - #endif - - #include "opencv2/core/openvx/ovx_defs.hpp" -+#include "hal_replacement.hpp" - - #define CV_DESCALE(x,n) (((x) + (1 << ((n)-1))) >> (n)) - -@@ -62,6 +63,9 @@ static void calcScharrDeriv(const cv::Mat& src, cv::Mat& dst) - int rows = src.rows, cols = src.cols, cn = src.channels(), depth = src.depth(); - CV_Assert(depth == CV_8U); - dst.create(rows, cols, CV_MAKETYPE(DataType::depth, cn*2)); -+ -+ CALL_HAL(ScharrDeriv, cv_hal_ScharrDeriv, src.data, src.step, (short*)dst.data, dst.step, cols, rows, cn); -+ - parallel_for_(Range(0, rows), cv::detail::ScharrDerivInvoker(src, dst), cv::getNumThreads()); - } - -diff --git a/modules/imgproc/test/test_imgwarp_strict.cpp b/modules/imgproc/test/test_imgwarp_strict.cpp -index 83a5e23781..75df962fb7 100644 ---- a/modules/imgproc/test/test_imgwarp_strict.cpp -+++ b/modules/imgproc/test/test_imgwarp_strict.cpp -@@ -239,7 +239,7 @@ float CV_ImageWarpBaseTest::get_success_error_level(int _interpolation, int) con - else if (_interpolation == INTER_AREA) - return 2.0f; - else -- return 1.0f; -+ return 4.0f; // Reference algorithm uses integer interpolation with 5 bits fractional part, and this greater tolerance allows better precision algorithms to pass the test - } -- GitLab