Merge pull request #440 from AnnaKogan8:fixed-perfomance-tests

This commit is contained in:
Andrey Kamaev
2013-02-21 12:29:57 +04:00
committed by OpenCV Buildbot
10 changed files with 23 additions and 16 deletions

View File

@@ -52,7 +52,8 @@ PERF_TEST_P( Size_MatType_CmpType, compareScalar,
declare.in(src1, src2, WARMUP_RNG).out(dst);
TEST_CYCLE() cv::compare(src1, src2, dst, cmpType);
int runs = (sz.width <= 640) ? 8 : 1;
TEST_CYCLE_MULTIRUN(runs) cv::compare(src1, src2, dst, cmpType);
SANITY_CHECK(dst);
}

View File

@@ -29,9 +29,9 @@ PERF_TEST_P( Size_DepthSrc_DepthDst_Channels_alpha, convertTo,
Mat src(sz, CV_MAKETYPE(depthSrc, channels));
randu(src, 0, 255);
Mat dst(sz, CV_MAKETYPE(depthDst, channels));
declare.iterations(500);
TEST_CYCLE() src.convertTo(dst, depthDst, alpha);
int runs = (sz.width <= 640) ? 8 : 1;
TEST_CYCLE_MULTIRUN(runs) src.convertTo(dst, depthDst, alpha);
SANITY_CHECK(dst, alpha == 1.0 ? 1e-12 : 1e-7);
}

View File

@@ -18,7 +18,8 @@ PERF_TEST_P(Size_MatType, Mat_Eye,
declare.out(diagonalMatrix);
TEST_CYCLE()
int runs = (size.width <= 640) ? 15 : 5;
TEST_CYCLE_MULTIRUN(runs)
{
diagonalMatrix = Mat::eye(size, type);
}
@@ -38,7 +39,8 @@ PERF_TEST_P(Size_MatType, Mat_Zeros,
declare.out(zeroMatrix);
TEST_CYCLE()
int runs = (size.width <= 640) ? 15 : 5;
TEST_CYCLE_MULTIRUN(runs)
{
zeroMatrix = Mat::zeros(size, type);
}

View File

@@ -30,7 +30,8 @@ PERF_TEST_P( Size_SrcDepth_DstChannels, merge,
}
Mat dst;
TEST_CYCLE() merge( (vector<Mat> &)mv, dst );
int runs = (sz.width <= 640) ? 8 : 1;
TEST_CYCLE_MULTIRUN(runs) merge( (vector<Mat> &)mv, dst );
SANITY_CHECK(dst, 1e-12);
}

View File

@@ -26,8 +26,8 @@ PERF_TEST_P( Size_Depth_Channels, split,
randu(m, 0, 255);
vector<Mat> mv;
TEST_CYCLE() split(m, (vector<Mat>&)mv);
int runs = (sz.width <= 640) ? 8 : 1;
TEST_CYCLE_MULTIRUN(runs) split(m, (vector<Mat>&)mv);
SANITY_CHECK(mv, 1e-12);
}

View File

@@ -97,7 +97,8 @@ PERF_TEST_P(Size_MatType, countNonZero, testing::Combine( testing::Values( TYPIC
declare.in(src, WARMUP_RNG);
TEST_CYCLE() cnt = countNonZero(src);
int runs = (sz.width <= 640) ? 8 : 1;
TEST_CYCLE_MULTIRUN(runs) cnt = countNonZero(src);
SANITY_CHECK(cnt);
}