diff --git a/adapters/opencv/opencv-4.11.patch b/adapters/opencv/opencv-4.11.patch index 85f8d786b695630e4d9c05181baa9c144deb809c..2d4163e9b48096f47b5d137a3565ed3c3a40cdce 100644 --- a/adapters/opencv/opencv-4.11.patch +++ b/adapters/opencv/opencv-4.11.patch @@ -228,3 +228,22 @@ index 673c6f03e6..56d9e0b554 100644 } void CV_ImageWarpBaseTest::validate_results() const +diff --git a/modules/imgproc/test/test_imgwarp.cpp b/modules/imgproc/test/test_imgwarp.cpp +index e8840d231b..adfaad38b0 100644 +--- a/modules/imgproc/test/test_imgwarp.cpp ++++ b/modules/imgproc/test/test_imgwarp.cpp +@@ -1371,7 +1371,13 @@ TEST_P(Imgproc_RemapRelative, validity) + cv::remap(src, dstRelative, mapRelativeX32F, mapRelativeY32F, interpolation | WARP_RELATIVE_MAP, borderType); + } + +- EXPECT_EQ(cvtest::norm(dstAbsolute, dstRelative, NORM_INF), 0); ++ if (interpolation != INTER_LINEAR) { ++ EXPECT_EQ(cvtest::norm(dstAbsolute, dstRelative, NORM_INF), 0); ++ } else { ++ // Absolute algorithm can be different from Relative, they can have different precision: ++ // Error between full float and integer interpolation with INTER_BITS can be estimated from above with this formula. ++ EXPECT_LT(cvtest::norm(dstAbsolute, dstRelative, NORM_INF), 1 << (src.elemSize1() * CHAR_BIT - INTER_BITS)); ++ } + }; + + INSTANTIATE_TEST_CASE_P(ImgProc, Imgproc_RemapRelative, testing::Combine( diff --git a/adapters/opencv/opencv-5.x.patch b/adapters/opencv/opencv-5.x.patch index bf7ce73b983c604397150284c24d1d973acb3f6a..1fe914954c03cc19f2feb16f17fe95dd4b151ab2 100644 --- a/adapters/opencv/opencv-5.x.patch +++ b/adapters/opencv/opencv-5.x.patch @@ -186,4 +186,23 @@ index aded7bb74e..adf6a67e2b 100644 + } }; + INSTANTIATE_TEST_CASE_P(ImgProc, Imgproc_RemapRelative, testing::Combine( +diff --git a/modules/imgproc/test/test_imgwarp.cpp b/modules/imgproc/test/test_imgwarp.cpp +index e8840d231b..adfaad38b0 100644 +--- a/modules/imgproc/test/test_imgwarp.cpp ++++ b/modules/imgproc/test/test_imgwarp.cpp +@@ -1371,7 +1371,12 @@ TEST_P(Imgproc_RemapRelative, validity) + cv::remap(src, dstRelative, mapRelativeX32F, mapRelativeY32F, interpolation | WARP_RELATIVE_MAP, borderType); + } + +- EXPECT_EQ(cvtest::norm(dstAbsolute, dstRelative, NORM_INF), 0); ++ if (interpolation != INTER_LINEAR) { ++ EXPECT_EQ(cvtest::norm(dstAbsolute, dstRelative, NORM_INF), 0); ++ } else { ++ // Absolute algorithm can be different from Relative, they can have different precision: ++ // Error between full float and integer interpolation with INTER_BITS can be estimated from above with this formula. ++ EXPECT_LT(cvtest::norm(dstAbsolute, dstRelative, NORM_INF), 1 << (src.elemSize1() * CHAR_BIT - INTER_BITS)); ++ } + }; + INSTANTIATE_TEST_CASE_P(ImgProc, Imgproc_RemapRelative, testing::Combine( diff --git a/scripts/ci-opencv.sh b/scripts/ci-opencv.sh index d34b557a073ff1e9692beb34824e1371caed93ac..b5343b1ac334757808fd90df202a4993286ea506 100755 --- a/scripts/ci-opencv.sh +++ b/scripts/ci-opencv.sh @@ -113,9 +113,7 @@ IMGPROC_TEST_PATTERNS=( '*Imgproc_Dilate*' '*Imgproc_Erode*' '*Imgproc_PyramidDown*' -# ImgProc_RemapRelative is not implemented so it's omitted - '*Imgproc_Remap.*' - '*Imgproc_Remap_Test*' + '*Imgproc_Remap*' '*Imgproc_Warp*' ) IMGPROC_TEST_PATTERNS_STR="$(join_strings_with_colon "${IMGPROC_TEST_PATTERNS[*]}")"