1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

fix performance tests in tiny mode

This commit is contained in:
Vladislav Vinogradov
2015-03-06 15:45:14 +03:00
parent f1bec940b1
commit 9d294cbcf5
5 changed files with 282 additions and 82 deletions
+188 -72
View File
@@ -46,7 +46,11 @@ using namespace std;
using namespace testing;
using namespace perf;
#ifdef OPENCV_TINY_GPU_MODULE
#define ARITHM_MAT_DEPTH Values(CV_8U, CV_32F)
#else
#define ARITHM_MAT_DEPTH Values(CV_8U, CV_16U, CV_32F, CV_64F)
#endif
//////////////////////////////////////////////////////////////////////
// Merge
@@ -524,9 +528,14 @@ PERF_TEST_P(Sz_Depth, Core_AbsDiffScalar,
//////////////////////////////////////////////////////////////////////
// Abs
PERF_TEST_P(Sz_Depth, Core_Abs,
Combine(GPU_TYPICAL_MAT_SIZES,
Values(CV_16S, CV_32F)))
PERF_TEST_P(Sz_Depth, Core_Abs, Combine(
GPU_TYPICAL_MAT_SIZES,
#ifdef OPENCV_TINY_GPU_MODULE
Values(MatDepth(CV_32F))
#else
Values(CV_16S, CV_32F)
#endif
))
{
const cv::Size size = GET_PARAM(0);
const int depth = GET_PARAM(1);
@@ -552,9 +561,14 @@ PERF_TEST_P(Sz_Depth, Core_Abs,
//////////////////////////////////////////////////////////////////////
// Sqr
PERF_TEST_P(Sz_Depth, Core_Sqr,
Combine(GPU_TYPICAL_MAT_SIZES,
Values(CV_8U, CV_16S, CV_32F)))
PERF_TEST_P(Sz_Depth, Core_Sqr, Combine(
GPU_TYPICAL_MAT_SIZES,
#ifdef OPENCV_TINY_GPU_MODULE
Values(MatDepth(CV_32F))
#else
Values(CV_8U, CV_16S, CV_32F)
#endif
))
{
const cv::Size size = GET_PARAM(0);
const int depth = GET_PARAM(1);
@@ -580,9 +594,14 @@ PERF_TEST_P(Sz_Depth, Core_Sqr,
//////////////////////////////////////////////////////////////////////
// Sqrt
PERF_TEST_P(Sz_Depth, Core_Sqrt,
Combine(GPU_TYPICAL_MAT_SIZES,
Values(CV_8U, CV_16S, CV_32F)))
PERF_TEST_P(Sz_Depth, Core_Sqrt, Combine(
GPU_TYPICAL_MAT_SIZES,
#ifdef OPENCV_TINY_GPU_MODULE
Values(MatDepth(CV_32F))
#else
Values(CV_8U, CV_16S, CV_32F)
#endif
))
{
const cv::Size size = GET_PARAM(0);
const int depth = GET_PARAM(1);
@@ -612,9 +631,14 @@ PERF_TEST_P(Sz_Depth, Core_Sqrt,
//////////////////////////////////////////////////////////////////////
// Log
PERF_TEST_P(Sz_Depth, Core_Log,
Combine(GPU_TYPICAL_MAT_SIZES,
Values(CV_8U, CV_16S, CV_32F)))
PERF_TEST_P(Sz_Depth, Core_Log, Combine(
GPU_TYPICAL_MAT_SIZES,
#ifdef OPENCV_TINY_GPU_MODULE
Values(MatDepth(CV_32F))
#else
Values(CV_8U, CV_16S, CV_32F)
#endif
))
{
const cv::Size size = GET_PARAM(0);
const int depth = GET_PARAM(1);
@@ -644,9 +668,14 @@ PERF_TEST_P(Sz_Depth, Core_Log,
//////////////////////////////////////////////////////////////////////
// Exp
PERF_TEST_P(Sz_Depth, Core_Exp,
Combine(GPU_TYPICAL_MAT_SIZES,
Values(CV_8U, CV_16S, CV_32F)))
PERF_TEST_P(Sz_Depth, Core_Exp, Combine(
GPU_TYPICAL_MAT_SIZES,
#ifdef OPENCV_TINY_GPU_MODULE
Values(MatDepth(CV_32F))
#else
Values(CV_8U, CV_16S, CV_32F)
#endif
))
{
const cv::Size size = GET_PARAM(0);
const int depth = GET_PARAM(1);
@@ -678,10 +707,15 @@ PERF_TEST_P(Sz_Depth, Core_Exp,
DEF_PARAM_TEST(Sz_Depth_Power, cv::Size, MatDepth, double);
PERF_TEST_P(Sz_Depth_Power, Core_Pow,
Combine(GPU_TYPICAL_MAT_SIZES,
Values(CV_8U, CV_16S, CV_32F),
Values(0.3, 2.0, 2.4)))
PERF_TEST_P(Sz_Depth_Power, Core_Pow, Combine(
GPU_TYPICAL_MAT_SIZES,
#ifdef OPENCV_TINY_GPU_MODULE
Values(MatDepth(CV_32F)),
#else
Values(CV_8U, CV_16S, CV_32F),
#endif
Values(0.3, 2.0, 2.4)
))
{
const cv::Size size = GET_PARAM(0);
const int depth = GET_PARAM(1);
@@ -859,10 +893,16 @@ PERF_TEST_P(Sz_Depth, Core_BitwiseAndMat,
//////////////////////////////////////////////////////////////////////
// BitwiseAndScalar
PERF_TEST_P(Sz_Depth_Cn, Core_BitwiseAndScalar,
Combine(GPU_TYPICAL_MAT_SIZES,
Values(CV_8U, CV_16U, CV_32S),
GPU_CHANNELS_1_3_4))
PERF_TEST_P(Sz_Depth_Cn, Core_BitwiseAndScalar, Combine(
GPU_TYPICAL_MAT_SIZES,
#ifdef OPENCV_TINY_GPU_MODULE
Values(MatDepth(CV_8U)),
testing::Values(MatCn(Gray))
#else
Values(CV_8U, CV_16U, CV_32S),
GPU_CHANNELS_1_3_4
#endif
))
{
const cv::Size size = GET_PARAM(0);
const int depth = GET_PARAM(1);
@@ -935,10 +975,16 @@ PERF_TEST_P(Sz_Depth, Core_BitwiseOrMat,
//////////////////////////////////////////////////////////////////////
// BitwiseOrScalar
PERF_TEST_P(Sz_Depth_Cn, Core_BitwiseOrScalar,
Combine(GPU_TYPICAL_MAT_SIZES,
Values(CV_8U, CV_16U, CV_32S),
GPU_CHANNELS_1_3_4))
PERF_TEST_P(Sz_Depth_Cn, Core_BitwiseOrScalar, Combine(
GPU_TYPICAL_MAT_SIZES,
#ifdef OPENCV_TINY_GPU_MODULE
Values(MatDepth(CV_8U)),
testing::Values(MatCn(Gray))
#else
Values(CV_8U, CV_16U, CV_32S),
GPU_CHANNELS_1_3_4
#endif
))
{
const cv::Size size = GET_PARAM(0);
const int depth = GET_PARAM(1);
@@ -1011,10 +1057,16 @@ PERF_TEST_P(Sz_Depth, Core_BitwiseXorMat,
//////////////////////////////////////////////////////////////////////
// BitwiseXorScalar
PERF_TEST_P(Sz_Depth_Cn, Core_BitwiseXorScalar,
Combine(GPU_TYPICAL_MAT_SIZES,
Values(CV_8U, CV_16U, CV_32S),
GPU_CHANNELS_1_3_4))
PERF_TEST_P(Sz_Depth_Cn, Core_BitwiseXorScalar, Combine(
GPU_TYPICAL_MAT_SIZES,
#ifdef OPENCV_TINY_GPU_MODULE
Values(MatDepth(CV_8U)),
testing::Values(MatCn(Gray))
#else
Values(CV_8U, CV_16U, CV_32S),
GPU_CHANNELS_1_3_4
#endif
))
{
const cv::Size size = GET_PARAM(0);
const int depth = GET_PARAM(1);
@@ -1155,9 +1207,14 @@ PERF_TEST_P(Sz_Depth, Core_MinMat,
//////////////////////////////////////////////////////////////////////
// MinScalar
PERF_TEST_P(Sz_Depth, Core_MinScalar,
Combine(GPU_TYPICAL_MAT_SIZES,
Values(CV_8U, CV_16U, CV_32F)))
PERF_TEST_P(Sz_Depth, Core_MinScalar, Combine(
GPU_TYPICAL_MAT_SIZES,
#ifdef OPENCV_TINY_GPU_MODULE
Values(CV_8U, CV_32F)
#else
Values(CV_8U, CV_16U, CV_32F)
#endif
))
{
const cv::Size size = GET_PARAM(0);
const int depth = GET_PARAM(1);
@@ -1226,9 +1283,14 @@ PERF_TEST_P(Sz_Depth, Core_MaxMat,
//////////////////////////////////////////////////////////////////////
// MaxScalar
PERF_TEST_P(Sz_Depth, Core_MaxScalar,
Combine(GPU_TYPICAL_MAT_SIZES,
Values(CV_8U, CV_16U, CV_32F)))
PERF_TEST_P(Sz_Depth, Core_MaxScalar, Combine(
GPU_TYPICAL_MAT_SIZES,
#ifdef OPENCV_TINY_GPU_MODULE
Values(CV_8U, CV_32F)
#else
Values(CV_8U, CV_16U, CV_32F)
#endif
))
{
const cv::Size size = GET_PARAM(0);
const int depth = GET_PARAM(1);
@@ -1265,9 +1327,16 @@ DEF_PARAM_TEST(Sz_3Depth, cv::Size, MatDepth, MatDepth, MatDepth);
PERF_TEST_P(Sz_3Depth, Core_AddWeighted,
Combine(GPU_TYPICAL_MAT_SIZES,
#ifdef OPENCV_TINY_GPU_MODULE
Values(MatDepth(CV_32F)),
Values(MatDepth(CV_32F)),
Values(MatDepth(CV_32F))
#else
Values(CV_8U, CV_16U, CV_32F, CV_64F),
Values(CV_8U, CV_16U, CV_32F, CV_64F),
Values(CV_8U, CV_16U, CV_32F, CV_64F)))
Values(CV_8U, CV_16U, CV_32F, CV_64F)
#endif
))
{
const cv::Size size = GET_PARAM(0);
const int depth1 = GET_PARAM(1);
@@ -1784,7 +1853,11 @@ DEF_PARAM_TEST(Sz_Depth_Norm, cv::Size, MatDepth, NormType);
PERF_TEST_P(Sz_Depth_Norm, Core_Norm,
Combine(GPU_TYPICAL_MAT_SIZES,
#ifdef OPENCV_TINY_GPU_MODULE
Values(CV_8U, CV_32F),
#else
Values(CV_8U, CV_16U, CV_32S, CV_32F),
#endif
Values(NormType(cv::NORM_INF), NormType(cv::NORM_L1), NormType(cv::NORM_L2))))
{
const cv::Size size = GET_PARAM(0);
@@ -1859,10 +1932,16 @@ PERF_TEST_P(Sz_Norm, Core_NormDiff,
//////////////////////////////////////////////////////////////////////
// Sum
PERF_TEST_P(Sz_Depth_Cn, Core_Sum,
Combine(GPU_TYPICAL_MAT_SIZES,
Values(CV_8U, CV_16U, CV_32F),
GPU_CHANNELS_1_3_4))
PERF_TEST_P(Sz_Depth_Cn, Core_Sum, Combine(
GPU_TYPICAL_MAT_SIZES,
#ifdef OPENCV_TINY_GPU_MODULE
Values(CV_8U, CV_32F),
testing::Values(MatCn(Gray))
#else
Values(CV_8U, CV_16U, CV_32F),
GPU_CHANNELS_1_3_4
#endif
))
{
const cv::Size size = GET_PARAM(0);
const int depth = GET_PARAM(1);
@@ -1896,10 +1975,16 @@ PERF_TEST_P(Sz_Depth_Cn, Core_Sum,
//////////////////////////////////////////////////////////////////////
// SumAbs
PERF_TEST_P(Sz_Depth_Cn, Core_SumAbs,
Combine(GPU_TYPICAL_MAT_SIZES,
Values(CV_8U, CV_16U, CV_32F),
GPU_CHANNELS_1_3_4))
PERF_TEST_P(Sz_Depth_Cn, Core_SumAbs, Combine(
GPU_TYPICAL_MAT_SIZES,
#ifdef OPENCV_TINY_GPU_MODULE
Values(CV_8U, CV_32F),
testing::Values(MatCn(Gray))
#else
Values(CV_8U, CV_16U, CV_32F),
GPU_CHANNELS_1_3_4
#endif
))
{
const cv::Size size = GET_PARAM(0);
const int depth = GET_PARAM(1);
@@ -1929,10 +2014,16 @@ PERF_TEST_P(Sz_Depth_Cn, Core_SumAbs,
//////////////////////////////////////////////////////////////////////
// SumSqr
PERF_TEST_P(Sz_Depth_Cn, Core_SumSqr,
Combine(GPU_TYPICAL_MAT_SIZES,
Values<MatDepth>(CV_8U, CV_16U, CV_32F),
GPU_CHANNELS_1_3_4))
PERF_TEST_P(Sz_Depth_Cn, Core_SumSqr, Combine(
GPU_TYPICAL_MAT_SIZES,
#ifdef OPENCV_TINY_GPU_MODULE
Values(CV_8U, CV_32F),
testing::Values(MatCn(Gray))
#else
Values(CV_8U, CV_16U, CV_32F),
GPU_CHANNELS_1_3_4
#endif
))
{
const cv::Size size = GET_PARAM(0);
const int depth = GET_PARAM(1);
@@ -1962,9 +2053,14 @@ PERF_TEST_P(Sz_Depth_Cn, Core_SumSqr,
//////////////////////////////////////////////////////////////////////
// MinMax
PERF_TEST_P(Sz_Depth, Core_MinMax,
Combine(GPU_TYPICAL_MAT_SIZES,
Values(CV_8U, CV_16U, CV_32F, CV_64F)))
PERF_TEST_P(Sz_Depth, Core_MinMax, Combine(
GPU_TYPICAL_MAT_SIZES,
#ifdef OPENCV_TINY_GPU_MODULE
Values(CV_8U, CV_32F)
#else
Values(CV_8U, CV_16U, CV_32F, CV_64F)
#endif
))
{
const cv::Size size = GET_PARAM(0);
const int depth = GET_PARAM(1);
@@ -2000,9 +2096,14 @@ PERF_TEST_P(Sz_Depth, Core_MinMax,
//////////////////////////////////////////////////////////////////////
// MinMaxLoc
PERF_TEST_P(Sz_Depth, Core_MinMaxLoc,
Combine(GPU_TYPICAL_MAT_SIZES,
Values(CV_8U, CV_16U, CV_32F, CV_64F)))
PERF_TEST_P(Sz_Depth, Core_MinMaxLoc, Combine(
GPU_TYPICAL_MAT_SIZES,
#ifdef OPENCV_TINY_GPU_MODULE
Values(CV_8U, CV_32F)
#else
Values(CV_8U, CV_16U, CV_32F, CV_64F)
#endif
))
{
const cv::Size size = GET_PARAM(0);
const int depth = GET_PARAM(1);
@@ -2040,9 +2141,14 @@ PERF_TEST_P(Sz_Depth, Core_MinMaxLoc,
//////////////////////////////////////////////////////////////////////
// CountNonZero
PERF_TEST_P(Sz_Depth, Core_CountNonZero,
Combine(GPU_TYPICAL_MAT_SIZES,
Values(CV_8U, CV_16U, CV_32F, CV_64F)))
PERF_TEST_P(Sz_Depth, Core_CountNonZero, Combine(
GPU_TYPICAL_MAT_SIZES,
#ifdef OPENCV_TINY_GPU_MODULE
Values(CV_8U, CV_32F)
#else
Values(CV_8U, CV_16U, CV_32F, CV_64F)
#endif
))
{
const cv::Size size = GET_PARAM(0);
const int depth = GET_PARAM(1);
@@ -2079,12 +2185,17 @@ CV_ENUM(ReduceDim, Rows, Cols)
DEF_PARAM_TEST(Sz_Depth_Cn_Code_Dim, cv::Size, MatDepth, MatCn, ReduceCode, ReduceDim);
PERF_TEST_P(Sz_Depth_Cn_Code_Dim, Core_Reduce,
Combine(GPU_TYPICAL_MAT_SIZES,
Values(CV_8U, CV_16U, CV_16S, CV_32F),
Values(1, 2, 3, 4),
ReduceCode::all(),
ReduceDim::all()))
PERF_TEST_P(Sz_Depth_Cn_Code_Dim, Core_Reduce, Combine(
GPU_TYPICAL_MAT_SIZES,
#ifdef OPENCV_TINY_GPU_MODULE
Values(CV_8U, CV_32F),
#else
Values(CV_8U, CV_16U, CV_16S, CV_32F),
#endif
Values(1, 2, 3, 4),
ReduceCode::all(),
ReduceDim::all()
))
{
const cv::Size size = GET_PARAM(0);
const int depth = GET_PARAM(1);
@@ -2120,13 +2231,18 @@ PERF_TEST_P(Sz_Depth_Cn_Code_Dim, Core_Reduce,
DEF_PARAM_TEST(Sz_Depth_NormType, cv::Size, MatDepth, NormType);
PERF_TEST_P(Sz_Depth_NormType, Core_Normalize,
Combine(GPU_TYPICAL_MAT_SIZES,
Values(CV_8U, CV_16U, CV_32F, CV_64F),
Values(NormType(cv::NORM_INF),
NormType(cv::NORM_L1),
NormType(cv::NORM_L2),
NormType(cv::NORM_MINMAX))))
PERF_TEST_P(Sz_Depth_NormType, Core_Normalize, Combine(
GPU_TYPICAL_MAT_SIZES,
#ifdef OPENCV_TINY_GPU_MODULE
Values(CV_8U, CV_32F),
#else
Values(CV_8U, CV_16U, CV_32F, CV_64F),
#endif
Values(NormType(cv::NORM_INF),
NormType(cv::NORM_L1),
NormType(cv::NORM_L2),
NormType(cv::NORM_MINMAX))
))
{
const cv::Size size = GET_PARAM(0);
const int type = GET_PARAM(1);