From 19ebcfb4ab0d80ae2b7be2f0d3781624e78843d0 Mon Sep 17 00:00:00 2001 From: "Fedorov, Andrey" Date: Wed, 19 Aug 2026 08:51:31 -0700 Subject: [PATCH 1/5] workaround for current icv issue --- hal/ipp/src/warp_ipp.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hal/ipp/src/warp_ipp.cpp b/hal/ipp/src/warp_ipp.cpp index 2f1cf87b7395..14f960058155 100644 --- a/hal/ipp/src/warp_ipp.cpp +++ b/hal/ipp/src/warp_ipp.cpp @@ -287,6 +287,7 @@ int ipp_hal_warpPerspective(int src_type, const uchar *src_data, size_t src_step ::ipp::IwiImage iwDst(IwiSize{dst_width, dst_height}, ippiGetDataType(src_type), CV_MAT_CN(src_type), IwiBorderSize(), dst_data, IwSize(dst_step)); ::ipp::IwiBorderType ippBorder(ippiGetBorderType(borderType), {borderValue, 4}); IwTransDirection iwTransDirection = iwTransInverse; //fixed for IPP + const IppiRect localRectInfinite = {IPP_MIN_32S / 2, IPP_MIN_32S / 2, IPP_MAX_32S, IPP_MAX_32S}; if ((int)ippBorder == -1) { return CV_HAL_ERROR_NOT_IMPLEMENTED; @@ -296,7 +297,7 @@ int ipp_hal_warpPerspective(int src_type, const uchar *src_data, size_t src_step // The function is exception safe and sets the 'ok' flag to false if any exception occurs during processing. // The 'ok' flag is checked before and after parallel processing to determine // if the operation was successful or if it should fall back to a non-IPP implementation. - auto IPPWarpPerspectiveInvokerLambda = [&iwSrc, &iwDst, dst_width, ippInter, &coeffs, ippBorder, iwTransDirection, &ok](const cv::Range& range) + auto IPPWarpPerspectiveInvokerLambda = [&iwSrc, &iwDst, dst_width, ippInter, &coeffs, ippBorder, iwTransDirection, localRectInfinite, &ok](const cv::Range& range) { //CV_INSTRUMENT_REGION_IPP(); if (!ok.load(std::memory_order_relaxed)) @@ -307,7 +308,7 @@ int ipp_hal_warpPerspective(int src_type, const uchar *src_data, size_t src_step try { ::ipp::IwiTile tile = ::ipp::IwiRoi(0, range.start, dst_width, range.end - range.start); - CV_INSTRUMENT_FUN_IPP(::ipp::iwiWarpPerspective, iwSrc, iwDst, ippRectInfinite, coeffs, iwTransDirection, ippInter, ::ipp::IwiWarpPerspectiveParams(), ippBorder, tile); + CV_INSTRUMENT_FUN_IPP(::ipp::iwiWarpPerspective, iwSrc, iwDst, localRectInfinite, coeffs, iwTransDirection, ippInter, ::ipp::IwiWarpPerspectiveParams(), ippBorder, tile); } catch (const ::ipp::IwException &) { @@ -327,7 +328,7 @@ int ipp_hal_warpPerspective(int src_type, const uchar *src_data, size_t src_step } else { - CV_INSTRUMENT_FUN_IPP(::ipp::iwiWarpPerspective, iwSrc, iwDst, ippRectInfinite, coeffs, iwTransDirection, ippInter, ::ipp::IwiWarpPerspectiveParams(), ippBorder); + CV_INSTRUMENT_FUN_IPP(::ipp::iwiWarpPerspective, iwSrc, iwDst, localRectInfinite, coeffs, iwTransDirection, ippInter, ::ipp::IwiWarpPerspectiveParams(), ippBorder); } if (!ok) From f0d4423953dd6bd2d7458790eaa77a165af9e001 Mon Sep 17 00:00:00 2001 From: "Fedorov, Andrey" Date: Thu, 20 Aug 2026 04:52:58 -0700 Subject: [PATCH 2/5] added constexpr --- hal/ipp/src/warp_ipp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hal/ipp/src/warp_ipp.cpp b/hal/ipp/src/warp_ipp.cpp index 14f960058155..28132a06aaf6 100644 --- a/hal/ipp/src/warp_ipp.cpp +++ b/hal/ipp/src/warp_ipp.cpp @@ -287,7 +287,7 @@ int ipp_hal_warpPerspective(int src_type, const uchar *src_data, size_t src_step ::ipp::IwiImage iwDst(IwiSize{dst_width, dst_height}, ippiGetDataType(src_type), CV_MAT_CN(src_type), IwiBorderSize(), dst_data, IwSize(dst_step)); ::ipp::IwiBorderType ippBorder(ippiGetBorderType(borderType), {borderValue, 4}); IwTransDirection iwTransDirection = iwTransInverse; //fixed for IPP - const IppiRect localRectInfinite = {IPP_MIN_32S / 2, IPP_MIN_32S / 2, IPP_MAX_32S, IPP_MAX_32S}; + constexpr IppiRect localRectInfinite = {IPP_MIN_32S / 2, IPP_MIN_32S / 2, IPP_MAX_32S, IPP_MAX_32S}; if ((int)ippBorder == -1) { return CV_HAL_ERROR_NOT_IMPLEMENTED; @@ -297,7 +297,7 @@ int ipp_hal_warpPerspective(int src_type, const uchar *src_data, size_t src_step // The function is exception safe and sets the 'ok' flag to false if any exception occurs during processing. // The 'ok' flag is checked before and after parallel processing to determine // if the operation was successful or if it should fall back to a non-IPP implementation. - auto IPPWarpPerspectiveInvokerLambda = [&iwSrc, &iwDst, dst_width, ippInter, &coeffs, ippBorder, iwTransDirection, localRectInfinite, &ok](const cv::Range& range) + auto IPPWarpPerspectiveInvokerLambda = [&iwSrc, &iwDst, dst_width, ippInter, &coeffs, ippBorder, iwTransDirection, &ok](const cv::Range& range) { //CV_INSTRUMENT_REGION_IPP(); if (!ok.load(std::memory_order_relaxed)) From 69c121ea7d04fb1fd2f5aa4f825e74f78a743059 Mon Sep 17 00:00:00 2001 From: Fedorov Date: Thu, 20 Aug 2026 04:58:23 -0700 Subject: [PATCH 3/5] cpature list has changed --- hal/ipp/src/warp_ipp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hal/ipp/src/warp_ipp.cpp b/hal/ipp/src/warp_ipp.cpp index 28132a06aaf6..552f662c12b1 100644 --- a/hal/ipp/src/warp_ipp.cpp +++ b/hal/ipp/src/warp_ipp.cpp @@ -297,7 +297,7 @@ int ipp_hal_warpPerspective(int src_type, const uchar *src_data, size_t src_step // The function is exception safe and sets the 'ok' flag to false if any exception occurs during processing. // The 'ok' flag is checked before and after parallel processing to determine // if the operation was successful or if it should fall back to a non-IPP implementation. - auto IPPWarpPerspectiveInvokerLambda = [&iwSrc, &iwDst, dst_width, ippInter, &coeffs, ippBorder, iwTransDirection, &ok](const cv::Range& range) + auto IPPWarpPerspectiveInvokerLambda = [&iwSrc, &iwDst, dst_width, ippInter, &coeffs, ippBorder, iwTransDirection, localRectInfinite, &ok](const cv::Range& range) { //CV_INSTRUMENT_REGION_IPP(); if (!ok.load(std::memory_order_relaxed)) From 899dae8ff9bc5dcfb5bc56aa22b18e509a0e1ca4 Mon Sep 17 00:00:00 2001 From: Andrei Fedorov Date: Fri, 21 Aug 2026 14:32:08 +0200 Subject: [PATCH 4/5] constexpr to const --- hal/ipp/src/warp_ipp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hal/ipp/src/warp_ipp.cpp b/hal/ipp/src/warp_ipp.cpp index 552f662c12b1..14f960058155 100644 --- a/hal/ipp/src/warp_ipp.cpp +++ b/hal/ipp/src/warp_ipp.cpp @@ -287,7 +287,7 @@ int ipp_hal_warpPerspective(int src_type, const uchar *src_data, size_t src_step ::ipp::IwiImage iwDst(IwiSize{dst_width, dst_height}, ippiGetDataType(src_type), CV_MAT_CN(src_type), IwiBorderSize(), dst_data, IwSize(dst_step)); ::ipp::IwiBorderType ippBorder(ippiGetBorderType(borderType), {borderValue, 4}); IwTransDirection iwTransDirection = iwTransInverse; //fixed for IPP - constexpr IppiRect localRectInfinite = {IPP_MIN_32S / 2, IPP_MIN_32S / 2, IPP_MAX_32S, IPP_MAX_32S}; + const IppiRect localRectInfinite = {IPP_MIN_32S / 2, IPP_MIN_32S / 2, IPP_MAX_32S, IPP_MAX_32S}; if ((int)ippBorder == -1) { return CV_HAL_ERROR_NOT_IMPLEMENTED; From b662390a2a4b25707f71023e3114217fd794b139 Mon Sep 17 00:00:00 2001 From: Andrei Fedorov Date: Mon, 24 Aug 2026 10:02:00 +0200 Subject: [PATCH 5/5] Added a comment --- hal/ipp/src/warp_ipp.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hal/ipp/src/warp_ipp.cpp b/hal/ipp/src/warp_ipp.cpp index 14f960058155..c72504a96830 100644 --- a/hal/ipp/src/warp_ipp.cpp +++ b/hal/ipp/src/warp_ipp.cpp @@ -287,6 +287,8 @@ int ipp_hal_warpPerspective(int src_type, const uchar *src_data, size_t src_step ::ipp::IwiImage iwDst(IwiSize{dst_width, dst_height}, ippiGetDataType(src_type), CV_MAT_CN(src_type), IwiBorderSize(), dst_data, IwSize(dst_step)); ::ipp::IwiBorderType ippBorder(ippiGetBorderType(borderType), {borderValue, 4}); IwTransDirection iwTransDirection = iwTransInverse; //fixed for IPP + // This is the workaround for the ICV issue + // TODO: remove the workaround when the issue is gone const IppiRect localRectInfinite = {IPP_MIN_32S / 2, IPP_MIN_32S / 2, IPP_MAX_32S, IPP_MAX_32S}; if ((int)ippBorder == -1) {