From 17c7f76da3a8e880734e2f3628e43e0ae80dabe8 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Fri, 5 Apr 2024 12:50:21 +0300 Subject: [PATCH] HALL interface for bilaterialFilter. --- .../imgproc/src/bilateral_filter.dispatch.cpp | 3 +++ modules/imgproc/src/hal_replacement.hpp | 23 +++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/modules/imgproc/src/bilateral_filter.dispatch.cpp b/modules/imgproc/src/bilateral_filter.dispatch.cpp index 501af5b24409..4ccec1249646 100644 --- a/modules/imgproc/src/bilateral_filter.dispatch.cpp +++ b/modules/imgproc/src/bilateral_filter.dispatch.cpp @@ -415,6 +415,9 @@ void bilateralFilter( InputArray _src, OutputArray _dst, int d, Mat src = _src.getMat(), dst = _dst.getMat(); + CALL_HAL(bilateralFilter, cv_hal_bilateralFilter, src.data, src.step, dst.data, dst.step, src.cols, src.rows, src.depth(), + src.channels(), d, sigmaColor, sigmaSpace, borderType); + CV_IPP_RUN_FAST(ipp_bilateralFilter(src, dst, d, sigmaColor, sigmaSpace, borderType)); if( src.depth() == CV_8U ) diff --git a/modules/imgproc/src/hal_replacement.hpp b/modules/imgproc/src/hal_replacement.hpp index c066f3d6f3fd..5c6497bd805e 100644 --- a/modules/imgproc/src/hal_replacement.hpp +++ b/modules/imgproc/src/hal_replacement.hpp @@ -763,6 +763,29 @@ inline int hal_ni_medianBlur(const uchar* src_data, size_t src_step, uchar* dst_ #define cv_hal_medianBlur hal_ni_medianBlur //! @endcond +/** + @brief Calculate bilateral filter. See https://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/Bilateral_Filtering.html + @param src_data Source image data + @param src_step Source image step + @param dst_data Destination image data + @param dst_step Destination image step + @param width Source image width + @param height Source image height + @param depth Depths of source and destination image. Should support CV_8U and CV_32F + @param cn Number of channels + @param d Diameter of each pixel neighborhood that is used during filtering. If it is non-positive, it is computed from sigmaSpace + @param sigma_color Filter sigma in the color space + @param sigma_space Filter sigma in the coordinate space. When d>0, it specifies the neighborhood size regardless of sigmaSpace. Otherwise, d is proportional to sigmaSpace + @param border_type border mode used to extrapolate pixels outside of the image +*/ +inline int hal_ni_bilateralFilter(const uchar* src_data, size_t src_step, uchar* dst_data, size_t dst_step, + int width, int height, int depth, int cn, int d, double sigma_color, double sigma_space, int border_type) +{ return CV_HAL_ERROR_NOT_IMPLEMENTED; } + +//! @cond IGNORED +#define cv_hal_bilateralFilter hal_ni_bilateralFilter +//! @endcond + /** @brief Calculates adaptive threshold @param src_data Source image data