Skip to content

Commit e5790c0

Browse files
authored
Merge pull request opencv#26116 from savuor:rv/warp_affine_perf_types
Added more data types for warpAffine() perf tests
2 parents a7d942b + c0a0852 commit e5790c0

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

modules/imgproc/perf/perf_warp.cpp

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ CV_ENUM(InterType, INTER_NEAREST, INTER_LINEAR)
1212
CV_ENUM(InterTypeExtended, INTER_NEAREST, INTER_LINEAR, WARP_RELATIVE_MAP)
1313
CV_ENUM(RemapMode, HALF_SIZE, UPSIDE_DOWN, REFLECTION_X, REFLECTION_BOTH)
1414

15-
typedef TestBaseWithParam< tuple<Size, InterType, BorderMode> > TestWarpAffine;
15+
typedef TestBaseWithParam< tuple<MatType, Size, InterType, BorderMode> > TestWarpAffine;
1616
typedef TestBaseWithParam< tuple<Size, InterType, BorderMode, int> > TestWarpPerspective;
1717
typedef TestBaseWithParam< tuple<Size, InterType, BorderMode, MatType> > TestWarpPerspectiveNear_t;
1818
typedef TestBaseWithParam< tuple<MatType, Size, InterTypeExtended, BorderMode, RemapMode> > TestRemap;
@@ -21,20 +21,22 @@ void update_map(const Mat& src, Mat& map_x, Mat& map_y, const int remapMode, boo
2121

2222
PERF_TEST_P( TestWarpAffine, WarpAffine,
2323
Combine(
24+
Values(CV_8UC1, CV_8UC4),
2425
Values( szVGA, sz720p, sz1080p ),
2526
InterType::all(),
2627
BorderMode::all()
2728
)
2829
)
2930
{
3031
Size sz, szSrc(512, 512);
31-
int borderMode, interType;
32-
sz = get<0>(GetParam());
33-
interType = get<1>(GetParam());
34-
borderMode = get<2>(GetParam());
32+
int borderMode, interType, dataType;
33+
dataType = get<0>(GetParam());
34+
sz = get<1>(GetParam());
35+
interType = get<2>(GetParam());
36+
borderMode = get<3>(GetParam());
3537
Scalar borderColor = Scalar::all(150);
3638

37-
Mat src(szSrc,CV_8UC4), dst(sz, CV_8UC4);
39+
Mat src(szSrc, dataType), dst(sz, dataType);
3840
cvtest::fillGradient(src);
3941
if(borderMode == BORDER_CONSTANT) cvtest::smoothBorder(src, borderColor, 1);
4042
Mat warpMat = getRotationMatrix2D(Point2f(src.cols/2.f, src.rows/2.f), 30., 2.2);
@@ -47,20 +49,24 @@ PERF_TEST_P( TestWarpAffine, WarpAffine,
4749

4850
PERF_TEST_P(TestWarpAffine, DISABLED_WarpAffine_ovx,
4951
Combine(
52+
Values(CV_8UC1, CV_8UC4),
5053
Values(szVGA, sz720p, sz1080p),
5154
InterType::all(),
5255
BorderMode::all()
5356
)
5457
)
5558
{
5659
Size sz, szSrc(512, 512);
57-
int borderMode, interType;
58-
sz = get<0>(GetParam());
59-
interType = get<1>(GetParam());
60-
borderMode = get<2>(GetParam());
60+
int borderMode, interType, dataType;
61+
62+
dataType = get<0>(GetParam());
63+
sz = get<1>(GetParam());
64+
interType = get<2>(GetParam());
65+
borderMode = get<3>(GetParam());
66+
6167
Scalar borderColor = Scalar::all(150);
6268

63-
Mat src(szSrc, CV_8UC1), dst(sz, CV_8UC1);
69+
Mat src(szSrc, dataType), dst(sz, dataType);
6470
cvtest::fillGradient(src);
6571
if (borderMode == BORDER_CONSTANT) cvtest::smoothBorder(src, borderColor, 1);
6672
Mat warpMat = getRotationMatrix2D(Point2f(src.cols / 2.f, src.rows / 2.f), 30., 2.2);

0 commit comments

Comments
 (0)