diff --git a/hal/ipp/src/warp_ipp.cpp b/hal/ipp/src/warp_ipp.cpp index 2f1cf87b7395..c72504a96830 100644 --- a/hal/ipp/src/warp_ipp.cpp +++ b/hal/ipp/src/warp_ipp.cpp @@ -287,6 +287,9 @@ 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) { return CV_HAL_ERROR_NOT_IMPLEMENTED; @@ -296,7 +299,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 +310,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 +330,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)