Skip to content

Commit badc3bd

Browse files
committed
Merge pull request opencv#10348 from ElenaGvozdeva:Canny_HAL
2 parents b1ed8bc + b0e9d76 commit badc3bd

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

modules/imgproc/src/canny.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,11 @@ void Canny( InputArray _src, OutputArray _dst,
956956
CV_OCL_RUN(_dst.isUMat() && (_src.channels() == 1 || _src.channels() == 3),
957957
ocl_Canny<false>(_src, UMat(), UMat(), _dst, (float)low_thresh, (float)high_thresh, aperture_size, L2gradient, _src.channels(), size))
958958

959-
Mat src = _src.getMat(), dst = _dst.getMat();
959+
Mat src0 = _src.getMat(), dst = _dst.getMat();
960+
Mat src(src0.size(), src0.type(), src0.data, src0.step);
961+
962+
CALL_HAL(canny, cv_hal_canny, src.data, src.step, dst.data, dst.step, src.cols, src.rows, src.channels(),
963+
low_thresh, high_thresh, aperture_size, L2gradient);
960964

961965
CV_OVX_RUN(
962966
false && /* disabling due to accuracy issues */

modules/imgproc/src/hal_replacement.hpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,22 @@ inline int hal_ni_pyrdown(const uchar* src_data, size_t src_step, int src_width,
756756
#define cv_hal_pyrdown hal_ni_pyrdown
757757
//! @endcond
758758

759+
/**
760+
@brief Canny edge detector
761+
@param src_data,src_step Source image
762+
@param dst_data,dst_step Destination image
763+
@param width,height Source image dimensions
764+
@param cn Number of channels
765+
@param lowThreshold, highThreshold Thresholds value
766+
@param ksize Kernel size for Sobel operator.
767+
@param L2gradient Flag, indicating use L2 or L1 norma.
768+
*/
769+
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; }
770+
771+
//! @cond IGNORED
772+
#define cv_hal_canny hal_ni_canny
773+
//! @endcond
774+
759775
//! @}
760776

761777
#if defined __GNUC__

0 commit comments

Comments
 (0)