extend imgwarp tests to cover BORDER_TRANSPARENT

Previously were covering only BORDER_REPLICATE and BORDER_REFLECT.

Signed-off-by: Arne Baeyens <mail@arnebaeyens.com>
This commit is contained in:
Arne Baeyens
2026-08-22 19:09:20 +02:00
parent f5cce0bdc4
commit e451f59cda

View File

@@ -1079,6 +1079,10 @@ void CV_WarpAffine_Test::generate_test_data()
// warp_matrix is inverse // warp_matrix is inverse
if (rng.uniform(0., 1.) > 0) if (rng.uniform(0., 1.) > 0)
interpolation |= cv::WARP_INVERSE_MAP; 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() 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 }; static const int depths[] = { CV_32F, CV_64F };
int depth = depths[rng.uniform(0, 2)]; int depth = depths[rng.uniform(0, 2)];
M.clone().convertTo(M, depth); 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() void CV_WarpPerspective_Test::run_func()