mirror of
https://github.com/opencv/opencv.git
synced 2026-09-11 04:43:22 -05:00
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:
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user