From 79894f2688994e2c49ab49aae839070aaf792c75 Mon Sep 17 00:00:00 2001 From: Michael Platings Date: Wed, 28 Aug 2024 11:17:35 +0100 Subject: [PATCH] Remove OpenCV 4.9 support The purpose of this change is to avoid the cost of supporting many versions of OpenCV. --- CHANGELOG.md | 2 +- .../opencv/extra_benchmarks/opencv-4.9.patch | 272 ----------------- adapters/opencv/opencv-4.9.patch | 289 ------------------ 3 files changed, 1 insertion(+), 562 deletions(-) delete mode 100644 adapters/opencv/extra_benchmarks/opencv-4.9.patch delete mode 100644 adapters/opencv/opencv-4.9.patch diff --git a/CHANGELOG.md b/CHANGELOG.md index 4128afb3e..4d7d54440 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,7 +51,7 @@ This changelog aims to follow the guiding principles of - Improved performance of Compare Equal and Greater SC API. ### Removed - +- Support for OpenCV 4.9. ## 0.1.0 - 2024-05-21 diff --git a/adapters/opencv/extra_benchmarks/opencv-4.9.patch b/adapters/opencv/extra_benchmarks/opencv-4.9.patch deleted file mode 100644 index f90464fe1..000000000 --- a/adapters/opencv/extra_benchmarks/opencv-4.9.patch +++ /dev/null @@ -1,272 +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_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_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/imgproc/perf/perf_blur.cpp b/modules/imgproc/perf/perf_blur.cpp -index d1f5a6b1ca..c4a3a6cdc5 100644 ---- a/modules/imgproc/perf/perf_blur.cpp -+++ b/modules/imgproc/perf/perf_blur.cpp -@@ -47,7 +47,7 @@ typedef perf::TestBaseWithParam Size_ksize_BorderType; - - 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() - ) -@@ -188,7 +188,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() - ) -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_resize.cpp b/modules/imgproc/perf/perf_resize.cpp -index 0f470a5f81..89e4f746e1 100644 ---- a/modules/imgproc/perf/perf_resize.cpp -+++ b/modules/imgproc/perf/perf_resize.cpp -@@ -67,7 +67,15 @@ 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) -+ ) - ) - ) - { -diff --git a/modules/imgproc/perf/perf_sepfilters.cpp b/modules/imgproc/perf/perf_sepfilters.cpp -index 480aab9f20..8eb1667f2f 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) -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/adapters/opencv/opencv-4.9.patch b/adapters/opencv/opencv-4.9.patch deleted file mode 100644 index 6a1101574..000000000 --- a/adapters/opencv/opencv-4.9.patch +++ /dev/null @@ -1,289 +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/3rdparty/kleidicv/CMakeLists.txt b/3rdparty/kleidicv/CMakeLists.txt -new file mode 100644 -index 0000000000..5105214af3 ---- /dev/null -+++ b/3rdparty/kleidicv/CMakeLists.txt -@@ -0,0 +1,3 @@ -+set(KLEIDICV_SOURCE_PATH "${CMAKE_SOURCE_DIR}/kleidicv" CACHE PATH "Directory containing KleidiCV sources") -+ -+include("${KLEIDICV_SOURCE_PATH}/adapters/opencv/CMakeLists.txt") -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 5da9c2a695..0e25739d47 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -254,6 +254,8 @@ OCV_OPTION(WITH_CAP_IOS "Enable iOS video capture" ON - VERIFY HAVE_CAP_IOS) - OCV_OPTION(WITH_CAROTENE "Use NVidia carotene acceleration library for ARM platform" (NOT CV_DISABLE_OPTIMIZATION) - VISIBLE_IF (ARM OR AARCH64) AND NOT IOS AND NOT XROS) -+OCV_OPTION(WITH_KLEIDICV "Use KleidiCV library for ARM platforms" OFF -+ VISIBLE_IF (AARCH64)) - OCV_OPTION(WITH_CPUFEATURES "Use cpufeatures Android library" ON - VISIBLE_IF ANDROID - VERIFY HAVE_CPUFEATURES) -@@ -955,6 +957,13 @@ if(HAVE_OPENVX) - endif() - endif() - -+if(WITH_KLEIDICV) -+ ocv_debug_message(STATUS "Enable KleidiCV acceleration") -+ if(NOT ";${OpenCV_HAL};" MATCHES ";kleidicv;") -+ set(OpenCV_HAL "kleidicv;${OpenCV_HAL}") -+ endif() -+endif() -+ - if(WITH_CAROTENE) - ocv_debug_message(STATUS "Enable carotene acceleration") - if(NOT ";${OpenCV_HAL};" MATCHES ";carotene;") -@@ -979,6 +988,10 @@ foreach(hal ${OpenCV_HAL}) - else() - message(STATUS "Carotene: NEON is not available, disabling carotene...") - endif() -+ elseif(hal STREQUAL "kleidicv") -+ add_subdirectory(3rdparty/kleidicv) -+ ocv_hal_register(KLEIDICV_HAL_LIBRARIES KLEIDICV_HAL_HEADERS KLEIDICV_HAL_INCLUDE_DIRS) -+ list(APPEND OpenCV_USED_HAL "KleidiCV (ver ${KLEIDICV_HAL_VERSION})") - elseif(hal STREQUAL "openvx") - add_subdirectory(3rdparty/openvx) - ocv_hal_register(OPENVX_HAL_LIBRARIES OPENVX_HAL_HEADERS OPENVX_HAL_INCLUDE_DIRS) -diff --git a/doc/tutorials/introduction/config_reference/config_reference.markdown b/doc/tutorials/introduction/config_reference/config_reference.markdown -index dba280485f..7ced9a2536 100644 ---- a/doc/tutorials/introduction/config_reference/config_reference.markdown -+++ b/doc/tutorials/introduction/config_reference/config_reference.markdown -@@ -623,6 +623,7 @@ Following build options are utilized in `opencv_contrib` modules, as stated [pre - `CMAKE_TOOLCHAIN_FILE` - - `WITH_CAROTENE` -+`WITH_KLEIDICV` - `WITH_CPUFEATURES` - `WITH_EIGEN` - `WITH_OPENVX` -diff --git a/modules/core/include/opencv2/core/hal/interface.h b/modules/core/include/opencv2/core/hal/interface.h -index 6f0a83d359..4c294962ca 100644 ---- a/modules/core/include/opencv2/core/hal/interface.h -+++ b/modules/core/include/opencv2/core/hal/interface.h -@@ -81,6 +81,8 @@ typedef signed char schar; - - #define CV_MAT_DEPTH_MASK (CV_DEPTH_MAX - 1) - #define CV_MAT_DEPTH(flags) ((flags) & CV_MAT_DEPTH_MASK) -+#define CV_MAT_CN_MASK ((CV_CN_MAX - 1) << CV_CN_SHIFT) -+#define CV_MAT_CN(flags) ((((flags) & CV_MAT_CN_MASK) >> CV_CN_SHIFT) + 1) - - #define CV_MAKETYPE(depth,cn) (CV_MAT_DEPTH(depth) + (((cn)-1) << CV_CN_SHIFT)) - #define CV_MAKE_TYPE CV_MAKETYPE -diff --git a/modules/core/src/arithm.cpp b/modules/core/src/arithm.cpp -index 9de474b402..4757861a34 100644 ---- a/modules/core/src/arithm.cpp -+++ b/modules/core/src/arithm.cpp -@@ -1803,6 +1803,19 @@ void cv::inRange(InputArray _src, InputArray _lowerb, - - convertAndUnrollScalar( lb, src.type(), lbuf, blocksize ); - convertAndUnrollScalar( ub, src.type(), ubuf, blocksize ); -+ -+ if (depth == CV_8U) { -+ uint8_t lb_scalar = lb.at(0, 0); -+ uint8_t ub_scalar = ub.at(0, 0); -+ CALL_HAL(inRange_u8, cv_hal_inRange8u, src.data, src.step, dst.data, dst.step, dst.depth(), src.cols, src.rows, src.channels(), -+ lb_scalar, ub_scalar); -+ -+ } else if (depth == CV_32F) { -+ double lb_scalar = lb.at(0, 0); -+ double ub_scalar = ub.at(0, 0); -+ CALL_HAL(inRange_f32, cv_hal_inRange32f, src.data, src.step, dst.data, dst.step, dst.depth(), src.cols, src.rows, src.channels(), -+ lb_scalar, ub_scalar); -+ } - } - - for( size_t i = 0; i < it.nplanes; i++, ++it ) -diff --git a/modules/core/src/convert.dispatch.cpp b/modules/core/src/convert.dispatch.cpp -index 345b4624cb..8698cc64bf 100644 ---- a/modules/core/src/convert.dispatch.cpp -+++ b/modules/core/src/convert.dispatch.cpp -@@ -201,10 +201,15 @@ void Mat::convertTo(OutputArray _dst, int _type, double alpha, double beta) cons - else - _dst.create( dims, size, _type ); - Mat dst = _dst.getMat(); -+ int cn = channels(); -+ -+ if( dims <= 2 ) { -+ int width_in_elements = src.cols * cn; -+ CALL_HAL(convertTo, cv_hal_convertTo, src.data, src.step, src.depth(), dst.data, dst.step, dst.depth(), width_in_elements, src.rows, alpha, beta); -+ } - - BinaryFunc func = noScale ? getConvertFunc(sdepth, ddepth) : getConvertScaleFunc(sdepth, ddepth); - double scale[] = {alpha, beta}; -- int cn = channels(); - CV_Assert( func != 0 ); - - if( dims <= 2 ) -diff --git a/modules/core/src/hal_replacement.hpp b/modules/core/src/hal_replacement.hpp -index 1f2b259920..72a42d4beb 100644 ---- a/modules/core/src/hal_replacement.hpp -+++ b/modules/core/src/hal_replacement.hpp -@@ -818,6 +818,55 @@ inline int hal_ni_rotate90(int src_type, const uchar* src_data, size_t src_step, - #define cv_hal_rotate90 hal_ni_rotate90 - //! @endcond - -+/** -+ @brief Transpose2d -+ @param src_data,src_step Source image -+ @param dst_data,dst_step Destination image -+ @param src_width,src_height Source image dimensions -+ @param element_size Size of an element in bytes -+*/ -+inline int hal_ni_transpose2d(const uchar* src_data, size_t src_step, uchar* dst_data, size_t dst_step, int src_width, -+ int src_height, int element_size) { return CV_HAL_ERROR_NOT_IMPLEMENTED; } -+ -+//! @cond IGNORED -+#define cv_hal_transpose2d hal_ni_transpose2d -+//! @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/matrix_transform.cpp b/modules/core/src/matrix_transform.cpp -index 5a80ac8ca7..bad17e7b6b 100644 ---- a/modules/core/src/matrix_transform.cpp -+++ b/modules/core/src/matrix_transform.cpp -@@ -269,6 +269,8 @@ void transpose( InputArray _src, OutputArray _dst ) - return; - } - -+ CALL_HAL(transpose2d, cv_hal_transpose2d, src.data, src.step, dst.data, dst.step, src.cols, src.rows, esz); -+ - CV_IPP_RUN_FAST(ipp_transpose(src, dst)) - - if( dst.data == src.data ) -diff --git a/modules/core/src/minmax.cpp b/modules/core/src/minmax.cpp -index ff3786886e..62db04f8eb 100644 ---- a/modules/core/src/minmax.cpp -+++ b/modules/core/src/minmax.cpp -@@ -1510,7 +1510,7 @@ void cv::minMaxIdx(InputArray _src, double* minVal, - - Mat src = _src.getMat(), mask = _mask.getMat(); - -- if (src.dims <= 2) -+ if (cn == 1 && src.dims <= 2) - CALL_HAL(minMaxIdx, cv_hal_minMaxIdx, src.data, src.step, src.cols, src.rows, src.depth(), minVal, maxVal, - minIdx, maxIdx, mask.data); - -diff --git a/modules/imgproc/src/hal_replacement.hpp b/modules/imgproc/src/hal_replacement.hpp -index c066f3d6f3..d8b58015f9 100644 ---- a/modules/imgproc/src/hal_replacement.hpp -+++ b/modules/imgproc/src/hal_replacement.hpp -@@ -857,6 +857,12 @@ inline int hal_ni_gaussianBlur(const uchar* src_data, size_t src_step, uchar* ds - #define cv_hal_gaussianBlur hal_ni_gaussianBlur - //! @endcond - -+inline int hal_ni_gaussianBlurBinomial(const uchar*, size_t, uchar*, size_t, int, int, int, int, size_t, size_t, size_t, size_t, size_t, int) { return CV_HAL_ERROR_NOT_IMPLEMENTED; } -+ -+//! @cond IGNORED -+#define cv_hal_gaussianBlurBinomial hal_ni_gaussianBlurBinomial -+//! @endcond -+ - /** - @brief Computes Sobel derivatives - @param src_depth Depth of source image -diff --git a/modules/imgproc/src/smooth.dispatch.cpp b/modules/imgproc/src/smooth.dispatch.cpp -index 8a521d6df3..c1e5ec56d1 100644 ---- a/modules/imgproc/src/smooth.dispatch.cpp -+++ b/modules/imgproc/src/smooth.dispatch.cpp -@@ -654,6 +654,34 @@ void GaussianBlur(InputArray _src, OutputArray _dst, Size ksize, - ocl_GaussianBlur_8UC1(_src, _dst, ksize, CV_MAT_DEPTH(type), kx, ky, borderType) - ); - -+ if (sigma1 == 0.0 && sigma2 == 0.0 && ksize.height == ksize.width) -+ { -+ Mat src = _src.getMat(); -+ Mat dst = _dst.getMat(); -+ -+ Point ofs; -+ Size wsz(src.cols, src.rows); -+ if(!(borderType & BORDER_ISOLATED)) -+ src.locateROI( wsz, ofs ); -+ -+ 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); -+ } -+ -+ { -+ Mat src = _src.getMat(); -+ Mat dst = _dst.getMat(); -+ -+ Point ofs; -+ Size wsz(src.cols, src.rows); -+ if(!(borderType & BORDER_ISOLATED)) -+ src.locateROI( wsz, ofs ); -+ -+ 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; -@@ -737,15 +765,6 @@ void GaussianBlur(InputArray _src, OutputArray _dst, Size ksize, - Mat src = _src.getMat(); - Mat dst = _dst.getMat(); - -- Point ofs; -- Size wsz(src.cols, src.rows); -- if(!(borderType & BORDER_ISOLATED)) -- src.locateROI( wsz, ofs ); -- -- 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); -- - CV_OVX_RUN(true, - openvx_gaussianBlur(src, dst, ksize, sigma1, sigma2, borderType)) - -- GitLab