Added perf test for warpPerpsective with large resolutions

This commit is contained in:
Kirill Kornyakov 2012-10-12 17:10:58 +04:00
parent fa368d6202
commit 84176fa027
2 changed files with 46 additions and 0 deletions

View File

@ -80,6 +80,50 @@ PERF_TEST_P( TestWarpPerspective, WarpPerspective,
SANITY_CHECK(dst);
}
PERF_TEST_P( TestWarpPerspective, WarpPerspectiveLarge,
Combine(
Values( sz3MP, sz5MP ),
ValuesIn( InterType::all() ),
ValuesIn( BorderMode::all() )
)
)
{
Size sz;
int borderMode, interType;
sz = get<0>(GetParam());
borderMode = get<1>(GetParam());
interType = get<2>(GetParam());
string resolution;
if (sz == sz3MP)
resolution = "3MP";
else if (sz == sz5MP)
resolution = "5MP";
else
FAIL();
Mat src, img = imread(getDataPath("cv/shared/" + resolution + ".png"));
cvtColor(img, src, COLOR_BGR2BGRA, 4);
int shift = 103;
Mat srcVertices = (Mat_<Vec2f>(1, 4) << Vec2f(0, 0), Vec2f(sz.width-1, 0),
Vec2f(sz.width-1, sz.height-1), Vec2f(0, sz.height-1));
Mat dstVertices = (Mat_<Vec2f>(1, 4) << Vec2f(0, shift), Vec2f(sz.width-shift/2, 0),
Vec2f(sz.width-shift, sz.height-shift), Vec2f(shift/2, sz.height-1));
Mat warpMat = getPerspectiveTransform(srcVertices, dstVertices);
Mat dst(sz, CV_8UC4);
declare.in(src).out(dst);
TEST_CYCLE()
warpPerspective( src, dst, warpMat, sz, interType, borderMode, Scalar::all(150) );
SANITY_CHECK(dst);
imwrite("/home/kir/temp/dst" + resolution + ".png", dst);
}
PERF_TEST_P( TestRemap, remap,
Combine(
Values( TYPICAL_MAT_TYPES ),

View File

@ -49,6 +49,8 @@ const cv::Size sz1440p = szWQHD;
const cv::Size sz2160p = cv::Size(3840, 2160);//UHDTV1 4K
const cv::Size sz4320p = cv::Size(7680, 4320);//UHDTV2 8K
const cv::Size sz3MP = cv::Size(2048, 1536);
const cv::Size sz5MP = cv::Size(2592, 1944);
const cv::Size sz2K = cv::Size(2048, 2048);
const cv::Size szODD = cv::Size(127, 61);