diff --git a/modules/hal/include/opencv2/hal.hpp b/modules/hal/include/opencv2/hal.hpp index d1ec73b429..125bbc8248 100644 --- a/modules/hal/include/opencv2/hal.hpp +++ b/modules/hal/include/opencv2/hal.hpp @@ -247,15 +247,7 @@ template struct OpAbsDiff typedef T type1; typedef T type2; typedef T rtype; - T operator()(T a, T b) const { return (T)std::abs(a - b); } -}; - -template struct OpAbsDiffS -{ - typedef T type1; - typedef WT type2; - typedef T rtype; - T operator()(T a, WT b) const { return saturate_cast(std::abs(a - b)); } + T operator()(T a, T b) const { return a > b ? a - b : b - a; } }; template struct OpAnd diff --git a/modules/hal/samples/simple_hal/CMakeLists.txt b/modules/hal/samples/simple_hal/CMakeLists.txt index ee4ac22be9..dd0be70f2f 100644 --- a/modules/hal/samples/simple_hal/CMakeLists.txt +++ b/modules/hal/samples/simple_hal/CMakeLists.txt @@ -9,4 +9,3 @@ endif() add_library(simple_hal simple.cpp) set(OPENCV_HAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../..") target_include_directories(simple_hal PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${OPENCV_HAL_DIR}/include) - diff --git a/modules/hal/samples/simple_hal/simple.cpp b/modules/hal/samples/simple_hal/simple.cpp index 49d77b02ac..564a611a5a 100644 --- a/modules/hal/samples/simple_hal/simple.cpp +++ b/modules/hal/samples/simple_hal/simple.cpp @@ -31,4 +31,3 @@ int slow_not8u(const uchar* src1, size_t step1, const uchar* src2, size_t step2, dst[x] = ~src1[x]; return cv::hal::Error::Ok; } -