Merge pull request #26313 from FantasqueX:ipp-warp-affine-border-value

Use border value in ipp version of warp affine #26313

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [ ] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
FantasqueX 2024-10-17 13:50:30 +08:00 committed by GitHub
parent d20c456ab7
commit 489df18a13
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2599,7 +2599,7 @@ private:
#endif #endif
static bool ipp_warpAffine( InputArray _src, OutputArray _dst, int interpolation, int borderType, InputArray _M, int flags ) static bool ipp_warpAffine( InputArray _src, OutputArray _dst, int interpolation, int borderType, const Scalar & borderValue, InputArray _M, int flags )
{ {
#ifdef HAVE_IPP_IW #ifdef HAVE_IPP_IW
CV_INSTRUMENT_REGION_IPP(); CV_INSTRUMENT_REGION_IPP();
@ -2618,7 +2618,7 @@ static bool ipp_warpAffine( InputArray _src, OutputArray _dst, int interpolation
Mat dst = _dst.getMat(); Mat dst = _dst.getMat();
::ipp::IwiImage iwSrc = ippiGetImage(src); ::ipp::IwiImage iwSrc = ippiGetImage(src);
::ipp::IwiImage iwDst = ippiGetImage(dst); ::ipp::IwiImage iwDst = ippiGetImage(dst);
::ipp::IwiBorderType ippBorder(ippiGetBorderType(borderType)); ::ipp::IwiBorderType ippBorder(ippiGetBorderType(borderType), ippiGetValue(borderValue));
IwTransDirection iwTransDirection; IwTransDirection iwTransDirection;
if(!ippBorder) if(!ippBorder)
return false; return false;
@ -2661,7 +2661,7 @@ static bool ipp_warpAffine( InputArray _src, OutputArray _dst, int interpolation
return true; return true;
#else #else
CV_UNUSED(_src); CV_UNUSED(_dst); CV_UNUSED(interpolation); CV_UNUSED(_src); CV_UNUSED(_dst); CV_UNUSED(interpolation);
CV_UNUSED(borderType); CV_UNUSED(_M); CV_UNUSED(flags); CV_UNUSED(borderType); CV_UNUSED(borderValue); CV_UNUSED(_M); CV_UNUSED(flags);
return false; return false;
#endif #endif
} }
@ -2828,7 +2828,7 @@ void cv::warpAffine( InputArray _src, OutputArray _dst,
CV_Assert( (M0.type() == CV_32F || M0.type() == CV_64F) && M0.rows == 2 && M0.cols == 3 ); CV_Assert( (M0.type() == CV_32F || M0.type() == CV_64F) && M0.rows == 2 && M0.cols == 3 );
M0.convertTo(matM, matM.type()); M0.convertTo(matM, matM.type());
CV_IPP_RUN_FAST(ipp_warpAffine(src, dst, interpolation, borderType, matM, flags)); CV_IPP_RUN_FAST(ipp_warpAffine(src, dst, interpolation, borderType, borderValue, matM, flags));
if( !(flags & WARP_INVERSE_MAP) ) if( !(flags & WARP_INVERSE_MAP) )
{ {