diff --git a/hal/ipp/src/warp_ipp.cpp b/hal/ipp/src/warp_ipp.cpp index fe283c4271..531698c0e0 100644 --- a/hal/ipp/src/warp_ipp.cpp +++ b/hal/ipp/src/warp_ipp.cpp @@ -112,7 +112,7 @@ int ipp_hal_warpAffine(int src_type, const uchar *src_data, size_t src_step, int iwSrc.Init({src_width, src_height}, ippiGetDataType(src_type), CV_MAT_CN(src_type), NULL, src_data, IwSize(src_step)); ::ipp::IwiImage iwDst({dst_width, dst_height}, ippiGetDataType(src_type), CV_MAT_CN(src_type), NULL, dst_data, dst_step); ::ipp::IwiBorderType ippBorder(ippiGetBorderType(borderType), {borderValue[0], borderValue[1], borderValue[2], borderValue[3]}); - IwTransDirection iwTransDirection = iwTransForward; + IwTransDirection iwTransDirection = iwTransInverse; if((int)ippBorder == -1) return CV_HAL_ERROR_NOT_IMPLEMENTED; diff --git a/modules/imgproc/test/test_imgwarp.cpp b/modules/imgproc/test/test_imgwarp.cpp index 3372380413..382b74de4d 100644 --- a/modules/imgproc/test/test_imgwarp.cpp +++ b/modules/imgproc/test/test_imgwarp.cpp @@ -1561,6 +1561,33 @@ TEST(Imgproc_Warp, regression_19566) // valgrind should detect problem if any } +TEST(Imgproc_Warp, regression_28554) +{ + const Size inSize(128, 128); + const Size outSize(256, 256); + + Mat inMat = Mat::ones(inSize, CV_16S); + Mat outMat = Mat(outSize, CV_16S); + Mat coeffs = Mat::eye(2, 3, CV_64F); + coeffs.at(0, 2) = 64.; + coeffs.at(1, 2) = 64.; + + warpAffine( + inMat, + outMat, + coeffs, + outSize, + INTER_NEAREST, + cv::BORDER_CONSTANT, + 0.0 + ); + + Mat reference = Mat::zeros(outSize, CV_16S); + reference(cv::Rect(64, 64, 128, 128)) = 1; + ASSERT_EQ(0.0, cvtest::norm(reference, outMat, NORM_INF)); +} + + TEST(Imgproc_GetAffineTransform, singularity) { Point2f A_sample[3];