diff --git a/modules/imgproc/src/canny.cpp b/modules/imgproc/src/canny.cpp index 6558f16923..23bb40eebc 100644 --- a/modules/imgproc/src/canny.cpp +++ b/modules/imgproc/src/canny.cpp @@ -956,7 +956,11 @@ void Canny( InputArray _src, OutputArray _dst, CV_OCL_RUN(_dst.isUMat() && (_src.channels() == 1 || _src.channels() == 3), ocl_Canny(_src, UMat(), UMat(), _dst, (float)low_thresh, (float)high_thresh, aperture_size, L2gradient, _src.channels(), size)) - Mat src = _src.getMat(), dst = _dst.getMat(); + Mat src0 = _src.getMat(), dst = _dst.getMat(); + Mat src(src0.size(), src0.type(), src0.data, src0.step); + + CALL_HAL(canny, cv_hal_canny, src.data, src.step, dst.data, dst.step, src.cols, src.rows, src.channels(), + low_thresh, high_thresh, aperture_size, L2gradient); CV_OVX_RUN( false && /* disabling due to accuracy issues */ diff --git a/modules/imgproc/src/hal_replacement.hpp b/modules/imgproc/src/hal_replacement.hpp index 0921a84940..d6b1d78273 100644 --- a/modules/imgproc/src/hal_replacement.hpp +++ b/modules/imgproc/src/hal_replacement.hpp @@ -756,6 +756,22 @@ inline int hal_ni_pyrdown(const uchar* src_data, size_t src_step, int src_width, #define cv_hal_pyrdown hal_ni_pyrdown //! @endcond +/** + @brief Canny edge detector + @param src_data,src_step Source image + @param dst_data,dst_step Destination image + @param width,height Source image dimensions + @param cn Number of channels + @param lowThreshold, highThreshold Thresholds value + @param ksize Kernel size for Sobel operator. + @param L2gradient Flag, indicating use L2 or L1 norma. +*/ +inline int hal_ni_canny(const uchar* src_data, size_t src_step, uchar* dst_data, size_t dst_step, int width, int height, int cn, double lowThreshold, double highThreshold, int ksize, bool L2gradient) { return CV_HAL_ERROR_NOT_IMPLEMENTED; } + +//! @cond IGNORED +#define cv_hal_canny hal_ni_canny +//! @endcond + //! @} #if defined __GNUC__