From e451f59cdabf88660119410b4117c46488ec02a6 Mon Sep 17 00:00:00 2001 From: Arne Baeyens Date: Sat, 22 Aug 2026 19:09:20 +0200 Subject: [PATCH] extend imgwarp tests to cover BORDER_TRANSPARENT Previously were covering only BORDER_REPLICATE and BORDER_REFLECT. Signed-off-by: Arne Baeyens --- modules/imgproc/test/test_imgwarp_strict.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/imgproc/test/test_imgwarp_strict.cpp b/modules/imgproc/test/test_imgwarp_strict.cpp index 673c6f03e6..bec1d8a05e 100644 --- a/modules/imgproc/test/test_imgwarp_strict.cpp +++ b/modules/imgproc/test/test_imgwarp_strict.cpp @@ -1079,6 +1079,10 @@ void CV_WarpAffine_Test::generate_test_data() // warp_matrix is inverse if (rng.uniform(0., 1.) > 0) interpolation |= cv::WARP_INVERSE_MAP; + + // base sets only REPLICATE and REFLECT while want to test TRANSPARENT as well + static const int borderTypes[] = { BORDER_REPLICATE, BORDER_REFLECT, BORDER_TRANSPARENT }; + borderType = borderTypes[rng.uniform(0, sizeof(borderTypes) / sizeof(borderTypes[0]))]; } void CV_WarpAffine_Test::run_func() @@ -1201,6 +1205,10 @@ void CV_WarpPerspective_Test::generate_test_data() static const int depths[] = { CV_32F, CV_64F }; int depth = depths[rng.uniform(0, 2)]; M.clone().convertTo(M, depth); + + // base sets only REPLICATE and REFLECT while want to test TRANSPARENT as well + static const int borderTypes[] = { BORDER_REPLICATE, BORDER_REFLECT, BORDER_TRANSPARENT }; + borderType = borderTypes[rng.uniform(0, sizeof(borderTypes) / sizeof(borderTypes[0]))]; } void CV_WarpPerspective_Test::run_func()