From f3b91931b3aaed8c78ec1c90b26b3268ac6fca11 Mon Sep 17 00:00:00 2001 From: Michael Platings Date: Wed, 8 May 2024 07:59:08 +0000 Subject: [PATCH] Disable cv_hal_minMaxIdx implementation OpenCV 4.9 has a bug that cv_hal_minMaxIdx is called regardless of the number of channels in the image even though the interface has no way to pass the channel count to it. A fix is planned in OpenCV 4.10 but as yet it is unstable. Therefore disable the implementation in KleidiCV for now. --- adapters/opencv/kleidicv_hal.h | 4 ++++ doc/opencv.md | 12 ------------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/adapters/opencv/kleidicv_hal.h b/adapters/opencv/kleidicv_hal.h index a25be7719..1df5b667f 100644 --- a/adapters/opencv/kleidicv_hal.h +++ b/adapters/opencv/kleidicv_hal.h @@ -288,6 +288,9 @@ static inline int kleidicv_transpose_with_fallback( #undef cv_hal_transpose2d #define cv_hal_transpose2d kleidicv_transpose_with_fallback +// cv_hal_minMaxIdx is unstable in OpenCV +// See https://github.com/opencv/opencv/issues/25540 +#if 0 // min_max_idx static inline int kleidicv_min_max_idx_with_fallback( const uchar *src_data, size_t src_stride, int width, int height, int depth, @@ -299,6 +302,7 @@ static inline int kleidicv_min_max_idx_with_fallback( } #undef cv_hal_minMaxIdx #define cv_hal_minMaxIdx kleidicv_min_max_idx_with_fallback +#endif // 0 #if defined(cv_hal_convertTo) static inline int kleidicv_convertTo_with_fallback( diff --git a/doc/opencv.md b/doc/opencv.md index 685bc4853..890122b89 100644 --- a/doc/opencv.md +++ b/doc/opencv.md @@ -162,17 +162,5 @@ Notes on parameters: + `uint8_t` + `uint16_t` -### `min_max_idx` -Finds the minimum and maximum element values and their positions. - -Notes on parameters: -* `minIdx`,`maxIdx` - only supported for `depth == CV_8U` -* `depth` - supported element size (without specifying index): - + `CV_8S` - + `CV_8U` - + `CV_16S` - + `CV_16U` - + `CV_32S` - ### `convertTo` Currently converting to different data types is not supported. This function scales given input of `src_depth == CV_8U` using `scale` and `shift`. -- GitLab