From c95bc0c7fdeabcd7287722fd6bb743ac4e748dbc Mon Sep 17 00:00:00 2001 From: elenagvo Date: Mon, 27 Nov 2017 15:11:19 +0300 Subject: [PATCH] add HAL for threshold --- modules/imgproc/src/hal_replacement.hpp | 15 +++++++++++++++ modules/imgproc/src/thresh.cpp | 3 +++ 2 files changed, 18 insertions(+) diff --git a/modules/imgproc/src/hal_replacement.hpp b/modules/imgproc/src/hal_replacement.hpp index d838d68..b585566 100644 --- a/modules/imgproc/src/hal_replacement.hpp +++ b/modules/imgproc/src/hal_replacement.hpp @@ -647,6 +647,21 @@ inline int hal_ni_adaptiveThreshold(const uchar* src_data, size_t src_step, ucha #define cv_hal_adaptiveThreshold hal_ni_adaptiveThreshold //! @endcond +/** + @brief Calculates fixed-level threshold to each array element + @param src_data,src_step Source image + @param dst_data,dst_step Destination image + @param width,height Source image dimensions + @param thresh Threshold value + @param maxValue Value assigned to the pixels for which the condition is satisfied + @param thresholdType Thresholding type +*/ +inline int hal_ni_thresholdBin8u(const uchar* src_data, size_t src_step, uchar* dst_data, size_t dst_step, int width, int height, double thresh, double maxValue, int thresholdType) { return CV_HAL_ERROR_NOT_IMPLEMENTED; } + +//! @cond IGNORED +#define cv_hal_thresholdBin8u hal_ni_thresholdBin8u +//! @endcond + //! @} #if defined __GNUC__ diff --git a/modules/imgproc/src/thresh.cpp b/modules/imgproc/src/thresh.cpp index a428f7c..5a802b9 100644 --- a/modules/imgproc/src/thresh.cpp +++ b/modules/imgproc/src/thresh.cpp @@ -141,6 +141,9 @@ thresh_8u( const Mat& _src, Mat& _dst, uchar thresh, uchar maxval, int type ) return; #endif + CALL_HAL(thresholdBin, cv_hal_thresholdBin8u, _src.data, src_step, _dst.data, dst_step, roi.width, roi.height, + thresh, maxval, type); + #if defined(HAVE_IPP) CV_IPP_CHECK() { -- 2.7.4