Skip to content

Commit

Permalink
Merge pull request #25343 from asmorkalov:as/HAL_bilaterialFilter
Browse files Browse the repository at this point in the history
HAL interface for bilaterialFilter
  • Loading branch information
asmorkalov committed Apr 11, 2024
2 parents a10e339 + 17c7f76 commit 2c5b296
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/imgproc/src/bilateral_filter.dispatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
23 changes: 23 additions & 0 deletions modules/imgproc/src/hal_replacement.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2c5b296

Please sign in to comment.