diff --git a/modules/gapi/perf/common/gapi_core_perf_tests.hpp b/modules/gapi/perf/common/gapi_core_perf_tests.hpp index f3f251167b..7a1568ad22 100644 --- a/modules/gapi/perf/common/gapi_core_perf_tests.hpp +++ b/modules/gapi/perf/common/gapi_core_perf_tests.hpp @@ -26,64 +26,62 @@ namespace opencv_test }; //------------------------------------------------------------------------------ - - class AddPerfTest : public TestPerfParams> {}; + class PhasePerfTest : public TestPerfParams> {}; + class SqrtPerfTest : public TestPerfParams> {}; + class AddPerfTest : public TestPerfParams> {}; class AddCPerfTest : public TestPerfParams> {}; - class SubPerfTest : public TestPerfParams> {}; + class SubPerfTest : public TestPerfParams> {}; class SubCPerfTest : public TestPerfParams> {}; - class SubRCPerfTest : public TestPerfParams> {}; + class SubRCPerfTest : public TestPerfParams> {}; class MulPerfTest : public TestPerfParams> {}; class MulDoublePerfTest : public TestPerfParams> {}; class MulCPerfTest : public TestPerfParams> {}; class DivPerfTest : public TestPerfParams> {}; - class DivCPerfTest : public TestPerfParams> {}; - class DivRCPerfTest : public TestPerfParams> {}; - class MaskPerfTest : public TestPerfParams> {}; - class MeanPerfTest : public TestPerfParams> {}; + class DivCPerfTest : public TestPerfParams> {}; + class DivRCPerfTest : public TestPerfParams> {}; + class MaskPerfTest : public TestPerfParams> {}; + class MeanPerfTest : public TestPerfParams> {}; class Polar2CartPerfTest : public TestPerfParams> {}; class Cart2PolarPerfTest : public TestPerfParams> {}; - class CmpPerfTest : public TestPerfParams> {}; + class CmpPerfTest : public TestPerfParams> {}; class CmpWithScalarPerfTest : public TestPerfParams> {}; - class BitwisePerfTest : public TestPerfParams> {}; - class BitwiseNotPerfTest : public TestPerfParams> {}; - class SelectPerfTest : public TestPerfParams> {}; - class MinPerfTest : public TestPerfParams> {}; - class MaxPerfTest : public TestPerfParams> {}; - class AbsDiffPerfTest : public TestPerfParams> {}; + class BitwisePerfTest : public TestPerfParams> {}; + class BitwiseNotPerfTest : public TestPerfParams> {}; + class SelectPerfTest : public TestPerfParams> {}; + class MinPerfTest : public TestPerfParams> {}; + class MaxPerfTest : public TestPerfParams> {}; + class AbsDiffPerfTest : public TestPerfParams> {}; class AbsDiffCPerfTest : public TestPerfParams> {}; class SumPerfTest : public TestPerfParams> {}; class CountNonZeroPerfTest : public TestPerfParams> {}; class AddWeightedPerfTest : public TestPerfParams> {}; class NormPerfTest : public TestPerfParams> {}; - class IntegralPerfTest : public TestPerfParams> {}; - class ThresholdPerfTest : public TestPerfParams> {}; - class ThresholdOTPerfTest : public TestPerfParams> {}; - class InRangePerfTest : public TestPerfParams> {}; - class Split3PerfTest : public TestPerfParams> {}; - class Split4PerfTest : public TestPerfParams> {}; - class Merge3PerfTest : public TestPerfParams> {}; - class Merge4PerfTest : public TestPerfParams> {}; - class RemapPerfTest : public TestPerfParams> {}; - class FlipPerfTest : public TestPerfParams> {}; - class CropPerfTest : public TestPerfParams> {}; - class CopyPerfTest : public TestPerfParams> {}; - class ConcatHorPerfTest : public TestPerfParams> {}; - class ConcatHorVecPerfTest : public TestPerfParams> {}; - class ConcatVertPerfTest : public TestPerfParams> {}; - class ConcatVertVecPerfTest : public TestPerfParams> {}; - class LUTPerfTest : public TestPerfParams> {}; + class IntegralPerfTest : public TestPerfParams> {}; + class ThresholdPerfTest : public TestPerfParams> {}; + class ThresholdOTPerfTest : public TestPerfParams> {}; + class InRangePerfTest : public TestPerfParams> {}; + class Split3PerfTest : public TestPerfParams> {}; + class Split4PerfTest : public TestPerfParams> {}; + class Merge3PerfTest : public TestPerfParams> {}; + class Merge4PerfTest : public TestPerfParams> {}; + class RemapPerfTest : public TestPerfParams> {}; + class FlipPerfTest : public TestPerfParams> {}; + class CropPerfTest : public TestPerfParams> {}; + class CopyPerfTest : public TestPerfParams> {}; + class ConcatHorPerfTest : public TestPerfParams> {}; + class ConcatHorVecPerfTest : public TestPerfParams> {}; + class ConcatVertPerfTest : public TestPerfParams> {}; + class ConcatVertVecPerfTest : public TestPerfParams> {}; + class LUTPerfTest : public TestPerfParams> {}; class ConvertToPerfTest : public TestPerfParams> {}; - class KMeansNDPerfTest : public TestPerfParams> {}; - class KMeans2DPerfTest : public TestPerfParams> {}; - class KMeans3DPerfTest : public TestPerfParams> {}; + class KMeansNDPerfTest : public TestPerfParams> {}; + class KMeans2DPerfTest : public TestPerfParams> {}; + class KMeans3DPerfTest : public TestPerfParams> {}; class TransposePerfTest : public TestPerfParams> {}; class ResizePerfTest : public TestPerfParams> {}; class BottleneckKernelsConstInputPerfTest : public TestPerfParams> {}; class ResizeFxFyPerfTest : public TestPerfParams> {}; - class ResizeInSimpleGraphPerfTest : public TestPerfParams> {}; + class ResizeInSimpleGraphPerfTest : public TestPerfParams> {}; class ParseSSDBLPerfTest : public TestPerfParams>, public ParserSSDTest {}; class ParseSSDPerfTest : public TestPerfParams>, public ParserSSDTest {}; class ParseYoloPerfTest : public TestPerfParams>, public ParserYoloTest {}; diff --git a/modules/gapi/perf/common/gapi_core_perf_tests_inl.hpp b/modules/gapi/perf/common/gapi_core_perf_tests_inl.hpp index 96ce369081..d5a8d95f46 100644 --- a/modules/gapi/perf/common/gapi_core_perf_tests_inl.hpp +++ b/modules/gapi/perf/common/gapi_core_perf_tests_inl.hpp @@ -20,12 +20,91 @@ using namespace perf; //------------------------------------------------------------------------------ +PERF_TEST_P_(PhasePerfTest, TestPerformance) +{ + compare_f cmpF; + cv::Size sz; + MatType type = -1; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, type, compile_args) = GetParam(); + + initMatsRandU(type, sz, type, false); + + // OpenCV code /////////////////////////////////////////////////////////// + + cv::phase(in_mat1, in_mat2, out_mat_ocv); + + // G-API code //////////////////////////////////////////////////////////// + cv::GMat in1, in2; + auto out = cv::gapi::phase(in1, in2); + cv::GComputation c(cv::GIn(in1, in2), cv::GOut(out)); + + // Warm-up graph engine: + auto cc = c.compile(descr_of(gin(in_mat1, in_mat2)), + std::move(compile_args)); + cc(gin(in_mat1, in_mat2), gout(out_mat_gapi)); + + TEST_CYCLE() + { + cc(gin(in_mat1, in_mat2), gout(out_mat_gapi)); + } + + // Comparison //////////////////////////////////////////////////////////// + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + } + + SANITY_CHECK_NOTHING(); +} + +//------------------------------------------------------------------------------ + +PERF_TEST_P_(SqrtPerfTest, TestPerformance) +{ + compare_f cmpF; + cv::Size sz; + MatType type = -1; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, type, compile_args) = GetParam(); + + initMatrixRandU(type, sz, false); + + // OpenCV code /////////////////////////////////////////////////////////// + cv::sqrt(in_mat1, out_mat_ocv); + + // G-API code //////////////////////////////////////////////////////////// + cv::GMat in; + auto out = cv::gapi::sqrt(in); + cv::GComputation c(cv::GIn(in), cv::GOut(out)); + + // Warm-up graph engine: + auto cc = c.compile(descr_of(gin(in_mat1)), + std::move(compile_args)); + cc(gin(in_mat1), gout(out_mat_gapi)); + + TEST_CYCLE() + { + cc(gin(in_mat1), gout(out_mat_gapi)); + } + + // Comparison //////////////////////////////////////////////////////////// + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + } + + SANITY_CHECK_NOTHING(); +} + +//------------------------------------------------------------------------------ + PERF_TEST_P_(AddPerfTest, TestPerformance) { - Size sz = get<0>(GetParam()); - MatType type = get<1>(GetParam()); - int dtype = get<2>(GetParam()); - cv::GCompileArgs compile_args = get<3>(GetParam()); + compare_f cmpF; + cv::Size sz; + MatType type = -1; + int dtype = -1; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, type, dtype, compile_args) = GetParam(); initMatsRandU(type, sz, dtype, false); @@ -51,8 +130,9 @@ PERF_TEST_P_(AddPerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - // FIXIT unrealiable check: EXPECT_EQ(0, cv::countNonZero(out_mat_gapi != out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + } SANITY_CHECK_NOTHING(); } @@ -102,10 +182,12 @@ PERF_TEST_P_(AddCPerfTest, TestPerformance) PERF_TEST_P_(SubPerfTest, TestPerformance) { - Size sz = get<0>(GetParam()); - MatType type = get<1>(GetParam()); - int dtype = get<2>(GetParam()); - cv::GCompileArgs compile_args = get<3>(GetParam()); + compare_f cmpF; + cv::Size sz; + MatType type = -1; + int dtype = -1; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, type, dtype, compile_args) = GetParam(); initMatsRandU(type, sz, dtype, false); @@ -128,8 +210,9 @@ PERF_TEST_P_(SubPerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - // FIXIT unrealiable check: EXPECT_EQ(0, cv::countNonZero(out_mat_gapi != out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + } SANITY_CHECK_NOTHING(); } @@ -179,10 +262,12 @@ PERF_TEST_P_(SubCPerfTest, TestPerformance) PERF_TEST_P_(SubRCPerfTest, TestPerformance) { - Size sz = get<0>(GetParam()); - MatType type = get<1>(GetParam()); - int dtype = get<2>(GetParam()); - cv::GCompileArgs compile_args = get<3>(GetParam()); + compare_f cmpF; + cv::Size sz; + MatType type = -1; + int dtype = -1; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, type, dtype, compile_args) = GetParam(); initMatsRandU(type, sz, dtype, false); @@ -206,8 +291,9 @@ PERF_TEST_P_(SubRCPerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - // FIXIT unrealiable check: EXPECT_EQ(0, cv::countNonZero(out_mat_gapi != out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + } SANITY_CHECK_NOTHING(); } @@ -222,7 +308,6 @@ PERF_TEST_P_(MulPerfTest, TestPerformance) int dtype = -1; double scale = 1.0; cv::GCompileArgs compile_args; - std::tie(cmpF, sz, type, dtype, scale, compile_args) = GetParam(); initMatsRandU(type, sz, dtype, false); @@ -263,7 +348,6 @@ PERF_TEST_P_(MulDoublePerfTest, TestPerformance) int dtype = -1; double scale = 1.0; cv::GCompileArgs compile_args; - std::tie(cmpF, sz, type, dtype, compile_args) = GetParam(); auto& rng = cv::theRNG(); @@ -306,7 +390,6 @@ PERF_TEST_P_(MulCPerfTest, TestPerformance) int dtype = -1; double scale = 1.0; cv::GCompileArgs compile_args; - std::tie(cmpF, sz, type, dtype, compile_args) = GetParam(); initMatsRandU(type, sz, dtype, false); @@ -342,12 +425,13 @@ PERF_TEST_P_(MulCPerfTest, TestPerformance) PERF_TEST_P_(DivPerfTest, TestPerformance) { - compare_f cmpF = get<0>(GetParam()); - Size sz = get<1>(GetParam()); - MatType type = get<2>(GetParam()); - int dtype = get<3>(GetParam()); - double scale = get<4>(GetParam()); - cv::GCompileArgs compile_args = get<5>(GetParam()); + compare_f cmpF; + cv::Size sz; + MatType type = -1; + int dtype = -1; + double scale = 1.0; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, type, dtype, scale, compile_args) = GetParam(); // FIXIT Unstable input data for divide initMatsRandU(type, sz, dtype, false); @@ -387,21 +471,24 @@ PERF_TEST_P_(DivPerfTest, TestPerformance) PERF_TEST_P_(DivCPerfTest, TestPerformance) { - Size sz = get<0>(GetParam()); - MatType type = get<1>(GetParam()); - int dtype = get<2>(GetParam()); - cv::GCompileArgs compile_args = get<3>(GetParam()); + compare_f cmpF; + cv::Size sz; + MatType type = -1; + int dtype = -1; + double scale = 1.0; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, type, dtype, scale, compile_args) = GetParam(); // FIXIT Unstable input data for divide initMatsRandU(type, sz, dtype, false); // OpenCV code /////////////////////////////////////////////////////////// - cv::divide(in_mat1, sc, out_mat_ocv, 1.0, dtype); + cv::divide(in_mat1, sc, out_mat_ocv, scale, dtype); // G-API code //////////////////////////////////////////////////////////// cv::GMat in1, out; cv::GScalar sc1; - out = cv::gapi::divC(in1, sc1, 1.0, dtype); + out = cv::gapi::divC(in1, sc1, scale, dtype); cv::GComputation c(GIn(in1, sc1), GOut(out)); // Warm-up graph engine: @@ -415,8 +502,9 @@ PERF_TEST_P_(DivCPerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - // FIXIT unrealiable check: EXPECT_EQ(0, cv::countNonZero(out_mat_gapi != out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + } SANITY_CHECK_NOTHING(); } @@ -425,22 +513,24 @@ PERF_TEST_P_(DivCPerfTest, TestPerformance) PERF_TEST_P_(DivRCPerfTest, TestPerformance) { - compare_f cmpF = get<0>(GetParam()); - Size sz = get<1>(GetParam()); - MatType type = get<2>(GetParam()); - int dtype = get<3>(GetParam()); - cv::GCompileArgs compile_args = get<4>(GetParam()); + compare_f cmpF; + cv::Size sz; + MatType type = -1; + int dtype = -1; + double scale = 1.0; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, type, dtype, scale, compile_args) = GetParam(); // FIXIT Unstable input data for divide initMatsRandU(type, sz, dtype, false); // OpenCV code /////////////////////////////////////////////////////////// - cv::divide(sc, in_mat1, out_mat_ocv, 1.0, dtype); + cv::divide(sc, in_mat1, out_mat_ocv, scale, dtype); // G-API code //////////////////////////////////////////////////////////// cv::GMat in1, out; cv::GScalar sc1; - out = cv::gapi::divRC(sc1, in1, 1.0, dtype); + out = cv::gapi::divRC(sc1, in1, scale, dtype); cv::GComputation c(GIn(in1, sc1), GOut(out)); // Warm-up graph engine: @@ -454,8 +544,9 @@ PERF_TEST_P_(DivRCPerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - // FIXIT unrealiable check: EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + } SANITY_CHECK_NOTHING(); } @@ -464,12 +555,14 @@ PERF_TEST_P_(DivRCPerfTest, TestPerformance) PERF_TEST_P_(MaskPerfTest, TestPerformance) { - Size sz_in = get<0>(GetParam()); - MatType type = get<1>(GetParam()); - cv::GCompileArgs compile_args = get<2>(GetParam()); + compare_f cmpF; + cv::Size sz; + MatType type = -1; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, type, compile_args) = GetParam(); - initMatrixRandU(type, sz_in, type, false); - in_mat2 = cv::Mat(sz_in, CV_8UC1); + initMatrixRandU(type, sz, type, false); + in_mat2 = cv::Mat(sz, CV_8UC1); cv::randu(in_mat2, cv::Scalar::all(0), cv::Scalar::all(255)); in_mat2 = in_mat2 > 128; @@ -493,7 +586,9 @@ PERF_TEST_P_(MaskPerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - EXPECT_EQ(0, cv::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + } SANITY_CHECK_NOTHING(); } @@ -502,11 +597,13 @@ PERF_TEST_P_(MaskPerfTest, TestPerformance) PERF_TEST_P_(MeanPerfTest, TestPerformance) { - Size sz_in = get<0>(GetParam()); - MatType type = get<1>(GetParam()); - cv::GCompileArgs compile_args = get<2>(GetParam()); + compare_scalar_f cmpF; + cv::Size sz; + MatType type = -1; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, type, compile_args) = GetParam(); - initMatrixRandU(type, sz_in, false); + initMatrixRandU(type, sz, false); cv::Scalar out_norm; cv::Scalar out_norm_ocv; @@ -529,7 +626,9 @@ PERF_TEST_P_(MeanPerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - // FIXIT unrealiable check: EXPECT_EQ(out_norm[0], out_norm_ocv[0]); + { + EXPECT_TRUE(cmpF(out_norm, out_norm_ocv)); + } SANITY_CHECK_NOTHING(); } @@ -538,11 +637,12 @@ PERF_TEST_P_(MeanPerfTest, TestPerformance) PERF_TEST_P_(Polar2CartPerfTest, TestPerformance) { - compare_f cmpF = get<0>(GetParam()); - Size sz_in = get<1>(GetParam()); - cv::GCompileArgs compile_args = get<2>(GetParam()); + compare_f cmpF; + cv::Size sz; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, compile_args) = GetParam(); - initMatsRandU(CV_32FC1, sz_in, CV_32FC1, false); + initMatsRandU(CV_32FC1, sz, CV_32FC1, false); cv::Mat out_mat2; cv::Mat out_mat_ocv2; @@ -564,9 +664,10 @@ PERF_TEST_P_(Polar2CartPerfTest, TestPerformance) cc(gin(in_mat1, in_mat2), gout(out_mat_gapi, out_mat2)); } // Comparison //////////////////////////////////////////////////////////// - EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_TRUE(cmpF(out_mat_ocv2, out_mat2)); - EXPECT_EQ(out_mat_gapi.size(), sz_in); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + EXPECT_TRUE(cmpF(out_mat2, out_mat_ocv2)); + } SANITY_CHECK_NOTHING(); } @@ -575,13 +676,14 @@ PERF_TEST_P_(Polar2CartPerfTest, TestPerformance) PERF_TEST_P_(Cart2PolarPerfTest, TestPerformance) { - compare_f cmpF = get<0>(GetParam()); - Size sz_in = get<1>(GetParam()); - cv::GCompileArgs compile_args = get<2>(GetParam()); + compare_f cmpF; + cv::Size sz; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, compile_args) = GetParam(); - initMatsRandU(CV_32FC1, sz_in, CV_32FC1, false); - cv::Mat out_mat2(sz_in, CV_32FC1); - cv::Mat out_mat_ocv2(sz_in, CV_32FC1); + initMatsRandU(CV_32FC1, sz, CV_32FC1, false); + cv::Mat out_mat2(sz, CV_32FC1); + cv::Mat out_mat_ocv2(sz, CV_32FC1); // OpenCV code /////////////////////////////////////////////////////////// cv::cartToPolar(in_mat1, in_mat2, out_mat_ocv, out_mat_ocv2); @@ -602,9 +704,10 @@ PERF_TEST_P_(Cart2PolarPerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_TRUE(cmpF(out_mat_ocv2, out_mat2)); - EXPECT_EQ(out_mat_gapi.size(), sz_in); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + EXPECT_TRUE(cmpF(out_mat2, out_mat_ocv2)); + } SANITY_CHECK_NOTHING(); } @@ -613,10 +716,12 @@ PERF_TEST_P_(Cart2PolarPerfTest, TestPerformance) PERF_TEST_P_(CmpPerfTest, TestPerformance) { - CmpTypes opType = get<0>(GetParam()); - cv::Size sz = get<1>(GetParam()); - MatType type = get<2>(GetParam()); - cv::GCompileArgs compile_args = get<3>(GetParam()); + compare_f cmpF; + CmpTypes opType = CMP_EQ; + cv::Size sz; + MatType type = -1; + cv::GCompileArgs compile_args; + std::tie(cmpF, opType, sz, type, compile_args) = GetParam(); initMatsRandU(type, sz, CV_8U, false); @@ -648,8 +753,9 @@ PERF_TEST_P_(CmpPerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - EXPECT_EQ(0, cvtest::norm(out_mat_gapi, out_mat_ocv, NORM_INF)); - EXPECT_EQ(out_mat_gapi.size(), sz); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + } SANITY_CHECK_NOTHING(); } @@ -658,10 +764,10 @@ PERF_TEST_P_(CmpPerfTest, TestPerformance) PERF_TEST_P_(CmpWithScalarPerfTest, TestPerformance) { - MatType type = -1; + compare_f cmpF; CmpTypes opType = CMP_EQ; cv::Size sz; - compare_f cmpF; + MatType type = -1; cv::GCompileArgs compile_args; std::tie(cmpF, opType, sz, type, compile_args) = GetParam(); @@ -696,8 +802,9 @@ PERF_TEST_P_(CmpWithScalarPerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - EXPECT_EQ(out_mat_gapi.size(), sz); - EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + } SANITY_CHECK_NOTHING(); } @@ -706,13 +813,13 @@ PERF_TEST_P_(CmpWithScalarPerfTest, TestPerformance) PERF_TEST_P_(BitwisePerfTest, TestPerformance) { - MatType type = -1; - bitwiseOp opType = AND; - bool testWithScalar = false; + compare_f cmpF; + bitwiseOp opType = AND; + bool testWithScalar = false; cv::Size sz; + MatType type = -1; cv::GCompileArgs compile_args; - - std::tie(opType, testWithScalar, sz, type, compile_args) = GetParam(); + std::tie(cmpF, opType, testWithScalar, sz, type, compile_args) = GetParam(); initMatsRandU(type, sz, type, false); @@ -779,8 +886,9 @@ PERF_TEST_P_(BitwisePerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - EXPECT_EQ(0, cv::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); - EXPECT_EQ(out_mat_gapi.size(), sz); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + } SANITY_CHECK_NOTHING(); } @@ -789,11 +897,13 @@ PERF_TEST_P_(BitwisePerfTest, TestPerformance) PERF_TEST_P_(BitwiseNotPerfTest, TestPerformance) { - cv::Size sz_in = get<0>(GetParam()); - MatType type = get<1>(GetParam()); - cv::GCompileArgs compile_args = get<2>(GetParam()); + compare_f cmpF; + cv::Size sz; + MatType type = -1; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, type, compile_args) = GetParam(); - initMatrixRandU(type, sz_in, type, false); + initMatrixRandU(type, sz, type, false); // OpenCV code /////////////////////////////////////////////////////////// cv::bitwise_not(in_mat1, out_mat_ocv); @@ -814,8 +924,9 @@ PERF_TEST_P_(BitwiseNotPerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - EXPECT_EQ(0, cv::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); - EXPECT_EQ(out_mat_gapi.size(), sz_in); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + } SANITY_CHECK_NOTHING(); } @@ -824,12 +935,14 @@ PERF_TEST_P_(BitwiseNotPerfTest, TestPerformance) PERF_TEST_P_(SelectPerfTest, TestPerformance) { - cv::Size sz_in = get<0>(GetParam()); - MatType type = get<1>(GetParam()); - cv::GCompileArgs compile_args = get<2>(GetParam()); + compare_f cmpF; + cv::Size sz; + MatType type = -1; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, type, compile_args) = GetParam(); - initMatsRandU(type, sz_in, type, false); - cv::Mat in_mask(sz_in, CV_8UC1); + initMatsRandU(type, sz, type, false); + cv::Mat in_mask(sz, CV_8UC1); cv::randu(in_mask, cv::Scalar::all(0), cv::Scalar::all(255)); // OpenCV code /////////////////////////////////////////////////////////// @@ -852,8 +965,9 @@ PERF_TEST_P_(SelectPerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - EXPECT_EQ(0, cv::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); - EXPECT_EQ(out_mat_gapi.size(), sz_in); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + } SANITY_CHECK_NOTHING(); } @@ -862,12 +976,13 @@ PERF_TEST_P_(SelectPerfTest, TestPerformance) PERF_TEST_P_(MinPerfTest, TestPerformance) { - cv::Size sz_in = get<0>(GetParam()); - MatType type = get<1>(GetParam()); - cv::GCompileArgs compile_args = get<2>(GetParam()); + compare_f cmpF; + cv::Size sz; + MatType type = -1; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, type, compile_args) = GetParam(); - - initMatsRandU(type, sz_in, type, false); + initMatsRandU(type, sz, type, false); // OpenCV code /////////////////////////////////////////////////////////// cv::min(in_mat1, in_mat2, out_mat_ocv); @@ -888,8 +1003,9 @@ PERF_TEST_P_(MinPerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - EXPECT_EQ(0, cv::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); - EXPECT_EQ(out_mat_gapi.size(), sz_in); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + } SANITY_CHECK_NOTHING(); } @@ -898,12 +1014,13 @@ PERF_TEST_P_(MinPerfTest, TestPerformance) PERF_TEST_P_(MaxPerfTest, TestPerformance) { - cv::Size sz_in = get<0>(GetParam()); - MatType type = get<1>(GetParam()); - cv::GCompileArgs compile_args = get<2>(GetParam()); + compare_f cmpF; + cv::Size sz; + MatType type = -1; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, type, compile_args) = GetParam(); - - initMatsRandU(type, sz_in, type, false); + initMatsRandU(type, sz, type, false); // OpenCV code /////////////////////////////////////////////////////////// cv::max(in_mat1, in_mat2, out_mat_ocv); @@ -924,8 +1041,9 @@ PERF_TEST_P_(MaxPerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - EXPECT_EQ(0, cv::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); - EXPECT_EQ(out_mat_gapi.size(), sz_in); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + } SANITY_CHECK_NOTHING(); } @@ -934,12 +1052,13 @@ PERF_TEST_P_(MaxPerfTest, TestPerformance) PERF_TEST_P_(AbsDiffPerfTest, TestPerformance) { - cv::Size sz_in = get<0>(GetParam()); - MatType type = get<1>(GetParam()); - cv::GCompileArgs compile_args = get<2>(GetParam()); + compare_f cmpF; + cv::Size sz; + MatType type = -1; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, type, compile_args) = GetParam(); - - initMatsRandU(type, sz_in, type, false); + initMatsRandU(type, sz, type, false); // OpenCV code /////////////////////////////////////////////////////////// cv::absdiff(in_mat1, in_mat2, out_mat_ocv); @@ -960,8 +1079,9 @@ PERF_TEST_P_(AbsDiffPerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - // FIXIT unrealiable check: EXPECT_EQ(0, cv::countNonZero(out_mat_gapi != out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz_in); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + } SANITY_CHECK_NOTHING(); } @@ -970,13 +1090,13 @@ PERF_TEST_P_(AbsDiffPerfTest, TestPerformance) PERF_TEST_P_(AbsDiffCPerfTest, TestPerformance) { - compare_f cmpF = get<0>(GetParam()); - cv::Size sz_in = get<1>(GetParam()); - MatType type = get<2>(GetParam()); - cv::GCompileArgs compile_args = get<3>(GetParam()); + compare_f cmpF; + cv::Size sz; + MatType type = -1; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, type, compile_args) = GetParam(); - - initMatsRandU(type, sz_in, type, false); + initMatsRandU(type, sz, type, false); // OpenCV code /////////////////////////////////////////////////////////// cv::absdiff(in_mat1, sc, out_mat_ocv); @@ -1009,13 +1129,13 @@ PERF_TEST_P_(AbsDiffCPerfTest, TestPerformance) PERF_TEST_P_(SumPerfTest, TestPerformance) { - compare_scalar_f cmpF = get<0>(GetParam()); - cv::Size sz_in = get<1>(GetParam()); - MatType type = get<2>(GetParam()); - cv::GCompileArgs compile_args = get<3>(GetParam()); + compare_scalar_f cmpF; + cv::Size sz; + MatType type = -1; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, type, compile_args) = GetParam(); - - initMatrixRandU(type, sz_in, type, false); + initMatrixRandU(type, sz, type, false); cv::Scalar out_sum; cv::Scalar out_sum_ocv; @@ -1051,12 +1171,12 @@ PERF_TEST_P_(SumPerfTest, TestPerformance) PERF_TEST_P_(CountNonZeroPerfTest, TestPerformance) { compare_scalar_f cmpF; - cv::Size sz_in; + cv::Size sz; MatType type = -1; cv::GCompileArgs compile_args; - std::tie(cmpF, sz_in, type, compile_args) = GetParam(); + std::tie(cmpF, sz, type, compile_args) = GetParam(); - initMatrixRandU(type, sz_in, type, false); + initMatrixRandU(type, sz, type, false); int out_cnz_gapi, out_cnz_ocv; // OpenCV code /////////////////////////////////////////////////////////// @@ -1087,17 +1207,18 @@ PERF_TEST_P_(CountNonZeroPerfTest, TestPerformance) PERF_TEST_P_(AddWeightedPerfTest, TestPerformance) { - compare_f cmpF = get<0>(GetParam()); - cv::Size sz_in = get<1>(GetParam()); - MatType type = get<2>(GetParam()); - int dtype = get<3>(GetParam()); - cv::GCompileArgs compile_args = get<4>(GetParam()); + compare_f cmpF; + cv::Size sz; + MatType type = -1; + int dtype = -1; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, type, dtype, compile_args) = GetParam(); auto& rng = cv::theRNG(); double alpha = rng.uniform(0.0, 1.0); double beta = rng.uniform(0.0, 1.0); double gamma = rng.uniform(0.0, 1.0); - initMatsRandU(type, sz_in, dtype, false); + initMatsRandU(type, sz, dtype, false); // OpenCV code /////////////////////////////////////////////////////////// cv::addWeighted(in_mat1, alpha, in_mat2, beta, gamma, out_mat_ocv, dtype); @@ -1118,9 +1239,9 @@ PERF_TEST_P_(AddWeightedPerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz_in); - + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + } SANITY_CHECK_NOTHING(); } @@ -1129,12 +1250,12 @@ PERF_TEST_P_(AddWeightedPerfTest, TestPerformance) PERF_TEST_P_(NormPerfTest, TestPerformance) { - compare_scalar_f cmpF = get<0>(GetParam()); - NormTypes opType = get<1>(GetParam()); - cv::Size sz = get<2>(GetParam()); - MatType type = get<3>(GetParam()); - cv::GCompileArgs compile_args = get<4>(GetParam()); - + compare_scalar_f cmpF; + NormTypes opType = NORM_INF; + cv::Size sz; + MatType type = -1; + cv::GCompileArgs compile_args; + std::tie(cmpF, opType, sz, type, compile_args) = GetParam(); initMatrixRandU(type, sz, type, false); cv::Scalar out_norm; @@ -1177,18 +1298,18 @@ PERF_TEST_P_(NormPerfTest, TestPerformance) PERF_TEST_P_(IntegralPerfTest, TestPerformance) { - cv::Size sz_in = get<0>(GetParam()); - MatType type = get<1>(GetParam()); - cv::GCompileArgs compile_args = get<2>(GetParam()); - + compare_f cmpF; + cv::Size sz; + MatType type = -1; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, type, compile_args) = GetParam(); MatType type_out = (type == CV_8U) ? CV_32SC1 : CV_64FC1; - - in_mat1 = cv::Mat(sz_in, type); + in_mat1 = cv::Mat(sz, type); cv::randu(in_mat1, cv::Scalar::all(0), cv::Scalar::all(255)); - cv::Size sz_out = cv::Size(sz_in.width + 1, sz_in.height + 1); + cv::Size sz_out = cv::Size(sz.width + 1, sz.height + 1); cv::Mat out_mat1(sz_out, type_out); cv::Mat out_mat_ocv1(sz_out, type_out); @@ -1214,8 +1335,10 @@ PERF_TEST_P_(IntegralPerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - // FIXIT unrealiable check: EXPECT_EQ(0, cv::countNonZero(out_mat_ocv1 != out_mat1)); - // FIXIT unrealiable check: EXPECT_EQ(0, cv::countNonZero(out_mat_ocv2 != out_mat2)); + { + EXPECT_TRUE(cmpF(out_mat1, out_mat_ocv1)); + EXPECT_TRUE(cmpF(out_mat2, out_mat_ocv2)); + } SANITY_CHECK_NOTHING(); } @@ -1224,14 +1347,16 @@ PERF_TEST_P_(IntegralPerfTest, TestPerformance) PERF_TEST_P_(ThresholdPerfTest, TestPerformance) { - cv::Size sz_in = get<0>(GetParam()); - MatType type = get<1>(GetParam()); - int tt = get<2>(GetParam()); - cv::GCompileArgs compile_args = get<3>(GetParam()); + compare_f cmpF; + cv::Size sz; + MatType type = -1; + int tt = 0; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, type, tt, compile_args) = GetParam(); cv::Scalar thr = initScalarRandU(50); cv::Scalar maxval = initScalarRandU(50) + cv::Scalar(50, 50, 50, 50); - initMatrixRandU(type, sz_in, type, false); + initMatrixRandU(type, sz, type, false); cv::Scalar out_scalar; // OpenCV code /////////////////////////////////////////////////////////// @@ -1254,8 +1379,9 @@ PERF_TEST_P_(ThresholdPerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - EXPECT_EQ(0, cv::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); - EXPECT_EQ(out_mat_gapi.size(), sz_in); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + } SANITY_CHECK_NOTHING(); } @@ -1264,13 +1390,15 @@ PERF_TEST_P_(ThresholdPerfTest, TestPerformance) PERF_TEST_P_(ThresholdOTPerfTest, TestPerformance) { - cv::Size sz_in = get<0>(GetParam()); - MatType type = get<1>(GetParam()); - int tt = get<2>(GetParam()); - cv::GCompileArgs compile_args = get<3>(GetParam()); + compare_f cmpF; + cv::Size sz; + MatType type = -1; + int tt = 0; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, type, tt, compile_args) = GetParam(); cv::Scalar maxval = initScalarRandU(50) + cv::Scalar(50, 50, 50, 50); - initMatrixRandU(type, sz_in, type, false); + initMatrixRandU(type, sz, type, false); cv::Scalar out_gapi_scalar; double ocv_res; @@ -1294,9 +1422,10 @@ PERF_TEST_P_(ThresholdOTPerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - // FIXIT unrealiable check: EXPECT_EQ(0, cv::countNonZero(out_mat_ocv != out_mat_gapi)); - EXPECT_EQ(out_mat_gapi.size(), sz_in); - EXPECT_EQ(ocv_res, out_gapi_scalar.val[0]); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + EXPECT_EQ(ocv_res, out_gapi_scalar.val[0]); + } SANITY_CHECK_NOTHING(); } @@ -1305,13 +1434,15 @@ PERF_TEST_P_(ThresholdOTPerfTest, TestPerformance) PERF_TEST_P_(InRangePerfTest, TestPerformance) { - cv::Size sz_in = get<0>(GetParam()); - MatType type = get<1>(GetParam()); - cv::GCompileArgs compile_args = get<2>(GetParam()); + compare_f cmpF; + cv::Size sz; + MatType type = -1; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, type, compile_args) = GetParam(); cv::Scalar thrLow = initScalarRandU(100); cv::Scalar thrUp = initScalarRandU(100) + cv::Scalar(100, 100, 100, 100); - initMatrixRandU(type, sz_in, type, false); + initMatrixRandU(type, sz, type, false); // OpenCV code /////////////////////////////////////////////////////////// cv::inRange(in_mat1, thrLow, thrUp, out_mat_ocv); @@ -1333,8 +1464,9 @@ PERF_TEST_P_(InRangePerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - EXPECT_EQ(0, cv::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); - EXPECT_EQ(out_mat_gapi.size(), sz_in); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + } SANITY_CHECK_NOTHING(); } @@ -1343,15 +1475,16 @@ PERF_TEST_P_(InRangePerfTest, TestPerformance) PERF_TEST_P_(Split3PerfTest, TestPerformance) { - Size sz_in = get<0>(GetParam()); - cv::GCompileArgs compile_args = get<1>(GetParam()); + compare_f cmpF; + cv::Size sz; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, compile_args) = GetParam(); - - initMatrixRandU(CV_8UC3, sz_in, CV_8UC1); - cv::Mat out_mat2 = cv::Mat(sz_in, CV_8UC1); - cv::Mat out_mat3 = cv::Mat(sz_in, CV_8UC1); - cv::Mat out_mat_ocv2 = cv::Mat(sz_in, CV_8UC1); - cv::Mat out_mat_ocv3 = cv::Mat(sz_in, CV_8UC1); + initMatrixRandU(CV_8UC3, sz, CV_8UC1); + cv::Mat out_mat2 = cv::Mat(sz, CV_8UC1); + cv::Mat out_mat3 = cv::Mat(sz, CV_8UC1); + cv::Mat out_mat_ocv2 = cv::Mat(sz, CV_8UC1); + cv::Mat out_mat_ocv3 = cv::Mat(sz, CV_8UC1); // OpenCV code /////////////////////////////////////////////////////////// std::vector out_mats_ocv = { out_mat_ocv, out_mat_ocv2, out_mat_ocv3 }; @@ -1373,9 +1506,11 @@ PERF_TEST_P_(Split3PerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - EXPECT_EQ(0, cv::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); - EXPECT_EQ(0, cv::norm(out_mat_ocv2, out_mat2, NORM_INF)); - EXPECT_EQ(0, cv::norm(out_mat_ocv3, out_mat3, NORM_INF)); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + EXPECT_TRUE(cmpF(out_mat2, out_mat_ocv2)); + EXPECT_TRUE(cmpF(out_mat3, out_mat_ocv3)); + } SANITY_CHECK_NOTHING(); } @@ -1384,16 +1519,18 @@ PERF_TEST_P_(Split3PerfTest, TestPerformance) PERF_TEST_P_(Split4PerfTest, TestPerformance) { - Size sz_in = get<0>(GetParam()); - cv::GCompileArgs compile_args = get<1>(GetParam()); + compare_f cmpF; + cv::Size sz; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, compile_args) = GetParam(); - initMatrixRandU(CV_8UC4, sz_in, CV_8UC1); - cv::Mat out_mat2 = cv::Mat(sz_in, CV_8UC1); - cv::Mat out_mat3 = cv::Mat(sz_in, CV_8UC1); - cv::Mat out_mat4 = cv::Mat(sz_in, CV_8UC1); - cv::Mat out_mat_ocv2 = cv::Mat(sz_in, CV_8UC1); - cv::Mat out_mat_ocv3 = cv::Mat(sz_in, CV_8UC1); - cv::Mat out_mat_ocv4 = cv::Mat(sz_in, CV_8UC1); + initMatrixRandU(CV_8UC4, sz, CV_8UC1); + cv::Mat out_mat2 = cv::Mat(sz, CV_8UC1); + cv::Mat out_mat3 = cv::Mat(sz, CV_8UC1); + cv::Mat out_mat4 = cv::Mat(sz, CV_8UC1); + cv::Mat out_mat_ocv2 = cv::Mat(sz, CV_8UC1); + cv::Mat out_mat_ocv3 = cv::Mat(sz, CV_8UC1); + cv::Mat out_mat_ocv4 = cv::Mat(sz, CV_8UC1); // OpenCV code /////////////////////////////////////////////////////////// std::vector out_mats_ocv = { out_mat_ocv, out_mat_ocv2, out_mat_ocv3, out_mat_ocv4 }; @@ -1415,10 +1552,12 @@ PERF_TEST_P_(Split4PerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - EXPECT_EQ(0, cv::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); - EXPECT_EQ(0, cv::norm(out_mat_ocv2, out_mat2, NORM_INF)); - EXPECT_EQ(0, cv::norm(out_mat_ocv3, out_mat3, NORM_INF)); - EXPECT_EQ(0, cv::norm(out_mat_ocv4, out_mat4, NORM_INF)); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + EXPECT_TRUE(cmpF(out_mat2, out_mat_ocv2)); + EXPECT_TRUE(cmpF(out_mat3, out_mat_ocv3)); + EXPECT_TRUE(cmpF(out_mat4, out_mat_ocv4)); + } SANITY_CHECK_NOTHING(); } @@ -1427,11 +1566,13 @@ PERF_TEST_P_(Split4PerfTest, TestPerformance) PERF_TEST_P_(Merge3PerfTest, TestPerformance) { - Size sz_in = get<0>(GetParam()); - cv::GCompileArgs compile_args = get<1>(GetParam()); + compare_f cmpF; + cv::Size sz; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, compile_args) = GetParam(); - initMatsRandU(CV_8UC1, sz_in, CV_8UC3); - cv::Mat in_mat3(sz_in, CV_8UC1); + initMatsRandU(CV_8UC1, sz, CV_8UC3); + cv::Mat in_mat3(sz, CV_8UC1); cv::Scalar mean = cv::Scalar::all(127); cv::Scalar stddev = cv::Scalar::all(40.f); cv::randn(in_mat3, mean, stddev); @@ -1456,7 +1597,9 @@ PERF_TEST_P_(Merge3PerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - EXPECT_EQ(0, cv::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + } SANITY_CHECK_NOTHING(); } @@ -1465,12 +1608,14 @@ PERF_TEST_P_(Merge3PerfTest, TestPerformance) PERF_TEST_P_(Merge4PerfTest, TestPerformance) { - Size sz_in = get<0>(GetParam()); - cv::GCompileArgs compile_args = get<1>(GetParam()); + compare_f cmpF; + cv::Size sz; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, compile_args) = GetParam(); - initMatsRandU(CV_8UC1, sz_in, CV_8UC3); - cv::Mat in_mat3(sz_in, CV_8UC1); - cv::Mat in_mat4(sz_in, CV_8UC1); + initMatsRandU(CV_8UC1, sz, CV_8UC3); + cv::Mat in_mat3(sz, CV_8UC1); + cv::Mat in_mat4(sz, CV_8UC1); cv::Scalar mean = cv::Scalar::all(127); cv::Scalar stddev = cv::Scalar::all(40.f); cv::randn(in_mat3, mean, stddev); @@ -1496,7 +1641,9 @@ PERF_TEST_P_(Merge4PerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - EXPECT_EQ(0, cv::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + } SANITY_CHECK_NOTHING(); } @@ -1505,12 +1652,14 @@ PERF_TEST_P_(Merge4PerfTest, TestPerformance) PERF_TEST_P_(RemapPerfTest, TestPerformance) { - cv::Size sz_in = get<0>(GetParam()); - MatType type = get<1>(GetParam()); - cv::GCompileArgs compile_args = get<2>(GetParam()); + compare_f cmpF; + cv::Size sz; + MatType type = -1; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, type, compile_args) = GetParam(); - initMatrixRandU(type, sz_in, type, false); - cv::Mat in_map1(sz_in, CV_16SC2); + initMatrixRandU(type, sz, type, false); + cv::Mat in_map1(sz, CV_16SC2); cv::Mat in_map2 = cv::Mat(); cv::randu(in_map1, cv::Scalar::all(0), cv::Scalar::all(255)); cv::Scalar bv = cv::Scalar(); @@ -1534,8 +1683,9 @@ PERF_TEST_P_(RemapPerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - // FIXIT unrealiable check: EXPECT_EQ(0, cv::countNonZero(out_mat_ocv != out_mat_gapi)); - EXPECT_EQ(out_mat_gapi.size(), sz_in); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + } SANITY_CHECK_NOTHING(); } @@ -1544,12 +1694,14 @@ PERF_TEST_P_(RemapPerfTest, TestPerformance) PERF_TEST_P_(FlipPerfTest, TestPerformance) { - cv::Size sz_in = get<0>(GetParam()); - MatType type = get<1>(GetParam()); - int flipCode = get<2>(GetParam()); - cv::GCompileArgs compile_args = get<3>(GetParam()); + compare_f cmpF; + cv::Size sz; + MatType type = -1; + int flipCode = -1; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, type, flipCode, compile_args) = GetParam(); - initMatrixRandU(type, sz_in, type, false); + initMatrixRandU(type, sz, type, false); // OpenCV code /////////////////////////////////////////////////////////// cv::flip(in_mat1, out_mat_ocv, flipCode); @@ -1570,8 +1722,9 @@ PERF_TEST_P_(FlipPerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - EXPECT_EQ(0, cv::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); - EXPECT_EQ(out_mat_gapi.size(), sz_in); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + } SANITY_CHECK_NOTHING(); } @@ -1580,13 +1733,14 @@ PERF_TEST_P_(FlipPerfTest, TestPerformance) PERF_TEST_P_(CropPerfTest, TestPerformance) { - cv::Size sz_in = get<0>(GetParam()); - MatType type = get<1>(GetParam()); - cv::Rect rect_to = get<2>(GetParam()); - cv::GCompileArgs compile_args = get<3>(GetParam()); + compare_f cmpF; + cv::Size sz; + MatType type = -1; + cv::Rect rect_to; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, type, rect_to, compile_args) = GetParam(); - initMatrixRandU(type, sz_in, type, false); - cv::Size sz_out = cv::Size(rect_to.width, rect_to.height); + initMatrixRandU(type, sz, type, false); // OpenCV code /////////////////////////////////////////////////////////// cv::Mat(in_mat1, rect_to).copyTo(out_mat_ocv); @@ -1607,8 +1761,9 @@ PERF_TEST_P_(CropPerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - EXPECT_EQ(0, cv::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); - EXPECT_EQ(out_mat_gapi.size(), sz_out); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + } SANITY_CHECK_NOTHING(); } @@ -1617,12 +1772,13 @@ PERF_TEST_P_(CropPerfTest, TestPerformance) PERF_TEST_P_(CopyPerfTest, TestPerformance) { - cv::Size sz_in = get<0>(GetParam()); - MatType type = get<1>(GetParam()); - cv::GCompileArgs compile_args = get<2>(GetParam()); + compare_f cmpF; + cv::Size sz; + MatType type = -1; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, type, compile_args) = GetParam(); - initMatrixRandU(type, sz_in, type, false); - cv::Size sz_out = sz_in; + initMatrixRandU(type, sz, type, false); // OpenCV code /////////////////////////////////////////////////////////// cv::Mat(in_mat1).copyTo(out_mat_ocv); @@ -1643,8 +1799,9 @@ PERF_TEST_P_(CopyPerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - EXPECT_EQ(0, cv::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); - EXPECT_EQ(out_mat_gapi.size(), sz_out); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + } SANITY_CHECK_NOTHING(); } @@ -1653,14 +1810,16 @@ PERF_TEST_P_(CopyPerfTest, TestPerformance) PERF_TEST_P_(ConcatHorPerfTest, TestPerformance) { - cv::Size sz_out = get<0>(GetParam()); - MatType type = get<1>(GetParam()); - cv::GCompileArgs compile_args = get<2>(GetParam()); + compare_f cmpF; + cv::Size sz; + MatType type = -1; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, type, compile_args) = GetParam(); - int wpart = sz_out.width / 4; + int wpart = sz.width / 4; - cv::Size sz_in1 = cv::Size(wpart, sz_out.height); - cv::Size sz_in2 = cv::Size(sz_out.width - wpart, sz_out.height); + cv::Size sz_in1 = cv::Size(wpart, sz.height); + cv::Size sz_in2 = cv::Size(sz.width - wpart, sz.height); in_mat1 = cv::Mat(sz_in1, type); in_mat2 = cv::Mat(sz_in2, type); @@ -1671,8 +1830,8 @@ PERF_TEST_P_(ConcatHorPerfTest, TestPerformance) cv::randn(in_mat1, mean, stddev); cv::randn(in_mat2, mean, stddev); - out_mat_gapi = cv::Mat(sz_out, type); - out_mat_ocv = cv::Mat(sz_out, type); + out_mat_gapi = cv::Mat(sz, type); + out_mat_ocv = cv::Mat(sz, type); // OpenCV code /////////////////////////////////////////////////////////// cv::hconcat(in_mat1, in_mat2, out_mat_ocv); @@ -1693,7 +1852,9 @@ PERF_TEST_P_(ConcatHorPerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - EXPECT_EQ(0, cv::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + } SANITY_CHECK_NOTHING(); } @@ -1702,16 +1863,18 @@ PERF_TEST_P_(ConcatHorPerfTest, TestPerformance) PERF_TEST_P_(ConcatHorVecPerfTest, TestPerformance) { - cv::Size sz_out = get<0>(GetParam()); - MatType type = get<1>(GetParam()); - cv::GCompileArgs compile_args = get<2>(GetParam()); + compare_f cmpF; + cv::Size sz; + MatType type = -1; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, type, compile_args) = GetParam(); - int wpart1 = sz_out.width / 3; - int wpart2 = sz_out.width / 2; + int wpart1 = sz.width / 3; + int wpart2 = sz.width / 2; - cv::Size sz_in1 = cv::Size(wpart1, sz_out.height); - cv::Size sz_in2 = cv::Size(wpart2, sz_out.height); - cv::Size sz_in3 = cv::Size(sz_out.width - wpart1 - wpart2, sz_out.height); + cv::Size sz_in1 = cv::Size(wpart1, sz.height); + cv::Size sz_in2 = cv::Size(wpart2, sz.height); + cv::Size sz_in3 = cv::Size(sz.width - wpart1 - wpart2, sz.height); in_mat1 = cv::Mat(sz_in1, type); in_mat2 = cv::Mat(sz_in2, type); @@ -1724,8 +1887,8 @@ PERF_TEST_P_(ConcatHorVecPerfTest, TestPerformance) cv::randn(in_mat2, mean, stddev); cv::randn(in_mat3, mean, stddev); - out_mat_gapi = cv::Mat(sz_out, type); - out_mat_ocv = cv::Mat(sz_out, type); + out_mat_gapi = cv::Mat(sz, type); + out_mat_ocv = cv::Mat(sz, type); std::vector cvmats = { in_mat1, in_mat2, in_mat3 }; @@ -1748,7 +1911,9 @@ PERF_TEST_P_(ConcatHorVecPerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - EXPECT_EQ(0, cv::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + } SANITY_CHECK_NOTHING(); } @@ -1757,14 +1922,16 @@ PERF_TEST_P_(ConcatHorVecPerfTest, TestPerformance) PERF_TEST_P_(ConcatVertPerfTest, TestPerformance) { - cv::Size sz_out = get<0>(GetParam()); - MatType type = get<1>(GetParam()); - cv::GCompileArgs compile_args = get<2>(GetParam()); + compare_f cmpF; + cv::Size sz; + MatType type = -1; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, type, compile_args) = GetParam(); - int hpart = sz_out.height * 2 / 3; + int hpart = sz.height * 2 / 3; - cv::Size sz_in1 = cv::Size(sz_out.width, hpart); - cv::Size sz_in2 = cv::Size(sz_out.width, sz_out.height - hpart); + cv::Size sz_in1 = cv::Size(sz.width, hpart); + cv::Size sz_in2 = cv::Size(sz.width, sz.height - hpart); in_mat1 = cv::Mat(sz_in1, type); in_mat2 = cv::Mat(sz_in2, type); @@ -1775,8 +1942,8 @@ PERF_TEST_P_(ConcatVertPerfTest, TestPerformance) cv::randn(in_mat1, mean, stddev); cv::randn(in_mat2, mean, stddev); - out_mat_gapi = cv::Mat(sz_out, type); - out_mat_ocv = cv::Mat(sz_out, type); + out_mat_gapi = cv::Mat(sz, type); + out_mat_ocv = cv::Mat(sz, type); // OpenCV code /////////////////////////////////////////////////////////// cv::vconcat(in_mat1, in_mat2, out_mat_ocv); @@ -1797,7 +1964,9 @@ PERF_TEST_P_(ConcatVertPerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - EXPECT_EQ(0, cv::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + } SANITY_CHECK_NOTHING(); } @@ -1806,16 +1975,18 @@ PERF_TEST_P_(ConcatVertPerfTest, TestPerformance) PERF_TEST_P_(ConcatVertVecPerfTest, TestPerformance) { - cv::Size sz_out = get<0>(GetParam()); - MatType type = get<1>(GetParam()); - cv::GCompileArgs compile_args = get<2>(GetParam()); + compare_f cmpF; + cv::Size sz; + MatType type = -1; + cv::GCompileArgs compile_args; + std::tie(cmpF, sz, type, compile_args) = GetParam(); - int hpart1 = sz_out.height * 2 / 5; - int hpart2 = sz_out.height / 5; + int hpart1 = sz.height * 2 / 5; + int hpart2 = sz.height / 5; - cv::Size sz_in1 = cv::Size(sz_out.width, hpart1); - cv::Size sz_in2 = cv::Size(sz_out.width, hpart2); - cv::Size sz_in3 = cv::Size(sz_out.width, sz_out.height - hpart1 - hpart2); + cv::Size sz_in1 = cv::Size(sz.width, hpart1); + cv::Size sz_in2 = cv::Size(sz.width, hpart2); + cv::Size sz_in3 = cv::Size(sz.width, sz.height - hpart1 - hpart2); in_mat1 = cv::Mat(sz_in1, type); in_mat2 = cv::Mat(sz_in2, type); @@ -1828,8 +1999,8 @@ PERF_TEST_P_(ConcatVertVecPerfTest, TestPerformance) cv::randn(in_mat2, mean, stddev); cv::randn(in_mat3, mean, stddev); - out_mat_gapi = cv::Mat(sz_out, type); - out_mat_ocv = cv::Mat(sz_out, type); + out_mat_gapi = cv::Mat(sz, type); + out_mat_ocv = cv::Mat(sz, type); std::vector cvmats = { in_mat1, in_mat2, in_mat3 }; @@ -1852,7 +2023,9 @@ PERF_TEST_P_(ConcatVertVecPerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - EXPECT_EQ(0, cv::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + } SANITY_CHECK_NOTHING(); } @@ -1861,13 +2034,16 @@ PERF_TEST_P_(ConcatVertVecPerfTest, TestPerformance) PERF_TEST_P_(LUTPerfTest, TestPerformance) { - MatType type_mat = get<0>(GetParam()); - MatType type_lut = get<1>(GetParam()); - MatType type_out = CV_MAKETYPE(CV_MAT_DEPTH(type_lut), CV_MAT_CN(type_mat)); - cv::Size sz_in = get<2>(GetParam()); - cv::GCompileArgs compile_args = get<3>(GetParam()); + compare_f cmpF; + MatType type_mat = -1; + MatType type_lut = -1; + cv::Size sz; + cv::GCompileArgs compile_args; + std::tie(cmpF, type_mat, type_lut, sz, compile_args) = GetParam(); - initMatrixRandU(type_mat, sz_in, type_out); + MatType type_out = CV_MAKETYPE(CV_MAT_DEPTH(type_lut), CV_MAT_CN(type_mat)); + + initMatrixRandU(type_mat, sz, type_out); cv::Size sz_lut = cv::Size(1, 256); cv::Mat in_lut(sz_lut, type_lut); cv::randu(in_lut, cv::Scalar::all(0), cv::Scalar::all(255)); @@ -1891,8 +2067,9 @@ PERF_TEST_P_(LUTPerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - EXPECT_EQ(0, cv::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); - EXPECT_EQ(out_mat_gapi.size(), sz_in); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + } SANITY_CHECK_NOTHING(); } @@ -1904,13 +2081,13 @@ PERF_TEST_P_(ConvertToPerfTest, TestPerformance) int depth_to = -1; MatType type_mat = -1; double alpha = 0., beta = 0.; - cv::Size sz_in; + cv::Size sz; compare_f cmpF; cv::GCompileArgs compile_args; - std::tie(cmpF, type_mat, depth_to, sz_in, alpha, beta, compile_args) = GetParam(); + std::tie(cmpF, type_mat, depth_to, sz, alpha, beta, compile_args) = GetParam(); MatType type_out = CV_MAKETYPE(depth_to, CV_MAT_CN(type_mat)); - initMatrixRandU(type_mat, sz_in, type_out); + initMatrixRandU(type_mat, sz, type_out); // OpenCV code /////////////////////////////////////////////////////////// in_mat1.convertTo(out_mat_ocv, depth_to, alpha, beta); @@ -1931,8 +2108,9 @@ PERF_TEST_P_(ConvertToPerfTest, TestPerformance) } // Comparison //////////////////////////////////////////////////////////// - EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz_in); + { + EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); + } SANITY_CHECK_NOTHING(); } @@ -2071,12 +2249,12 @@ PERF_TEST_P_(KMeans3DPerfTest, TestPerformance) PERF_TEST_P_(TransposePerfTest, TestPerformance) { compare_f cmpF; - cv::Size sz_in; + cv::Size sz; MatType type = -1; cv::GCompileArgs compile_args; - std::tie(cmpF, sz_in, type, compile_args) = GetParam(); + std::tie(cmpF, sz, type, compile_args) = GetParam(); - initMatrixRandU(type, sz_in, type, false); + initMatrixRandU(type, sz, type, false); // OpenCV code /////////////////////////////////////////////////////////// cv::transpose(in_mat1, out_mat_ocv); @@ -2106,14 +2284,15 @@ PERF_TEST_P_(TransposePerfTest, TestPerformance) PERF_TEST_P_(ResizePerfTest, TestPerformance) { - compare_f cmpF = get<0>(GetParam()); - MatType type = get<1>(GetParam()); - int interp = get<2>(GetParam()); - cv::Size sz_in = get<3>(GetParam()); - cv::Size sz_out = get<4>(GetParam()); - cv::GCompileArgs compile_args = get<5>(GetParam()); + compare_f cmpF; + MatType type = -1; + int interp = 1; + cv::Size sz; + cv::Size sz_out; + cv::GCompileArgs compile_args; + std::tie(cmpF, type, interp, sz, sz_out, compile_args) = GetParam(); - in_mat1 = cv::Mat(sz_in, type); + in_mat1 = cv::Mat(sz, type); cv::Scalar mean = cv::Scalar::all(127); cv::Scalar stddev = cv::Scalar::all(40.f); cv::randn(in_mat1, mean, stddev); @@ -2150,19 +2329,20 @@ PERF_TEST_P_(ResizePerfTest, TestPerformance) PERF_TEST_P_(ResizeFxFyPerfTest, TestPerformance) { - compare_f cmpF = get<0>(GetParam()); - MatType type = get<1>(GetParam()); - int interp = get<2>(GetParam()); - cv::Size sz_in = get<3>(GetParam()); - double fx = get<4>(GetParam()); - double fy = get<5>(GetParam()); - cv::GCompileArgs compile_args = get<6>(GetParam()); + compare_f cmpF; + MatType type = -1; + int interp = 1; + cv::Size sz; + double fx = 0.0; + double fy = 0.0; + cv::GCompileArgs compile_args; + std::tie(cmpF, type, interp, sz, fx, fy, compile_args) = GetParam(); - in_mat1 = cv::Mat(sz_in, type); + in_mat1 = cv::Mat(sz, type); cv::Scalar mean = cv::Scalar::all(127); cv::Scalar stddev = cv::Scalar::all(40.f); cv::randn(in_mat1, mean, stddev); - cv::Size sz_out = cv::Size(saturate_cast(sz_in.width *fx), saturate_cast(sz_in.height*fy)); + cv::Size sz_out = cv::Size(saturate_cast(sz.width *fx), saturate_cast(sz.height*fy)); out_mat_gapi = cv::Mat(sz_out, type); out_mat_ocv = cv::Mat(sz_out, type); @@ -2198,9 +2378,12 @@ PERF_TEST_P_(ResizeFxFyPerfTest, TestPerformance) PERF_TEST_P_(BottleneckKernelsConstInputPerfTest, TestPerformance) { - compare_f cmpF = get<0>(GetParam()); - std::string fileName = get<1>(GetParam()); - cv::GCompileArgs compile_args = get<2>(GetParam()); + compare_f cmpF; + std::string fileName = ""; + cv::GCompileArgs compile_args; + double fx = 0.5; + double fy = 0.5; + std::tie(cmpF, fileName, compile_args) = GetParam(); in_mat1 = cv::imread(findDataFile(fileName)); @@ -2208,13 +2391,13 @@ PERF_TEST_P_(BottleneckKernelsConstInputPerfTest, TestPerformance) cv::Mat cvgray; cv::Mat cvblurred; - cv::resize(in_mat1, cvvga, cv::Size(), 0.5, 0.5); + cv::resize(in_mat1, cvvga, cv::Size(), fx, fy); cv::cvtColor(cvvga, cvgray, cv::COLOR_BGR2GRAY); cv::blur(cvgray, cvblurred, cv::Size(3, 3)); cv::Canny(cvblurred, out_mat_ocv, 32, 128, 3); cv::GMat in; - cv::GMat vga = cv::gapi::resize(in, cv::Size(), 0.5, 0.5, INTER_LINEAR); + cv::GMat vga = cv::gapi::resize(in, cv::Size(), fx, fy, INTER_LINEAR); cv::GMat gray = cv::gapi::BGR2Gray(vga); cv::GMat blurred = cv::gapi::blur(gray, cv::Size(3, 3)); cv::GMat out = cv::gapi::Canny(blurred, 32, 128, 3); @@ -2241,21 +2424,24 @@ PERF_TEST_P_(BottleneckKernelsConstInputPerfTest, TestPerformance) PERF_TEST_P_(ResizeInSimpleGraphPerfTest, TestPerformance) { - compare_f cmpF = get<0>(GetParam()); - MatType type = get<1>(GetParam()); - cv::Size sz_in = get<2>(GetParam()); - cv::GCompileArgs compile_args = get<3>(GetParam()); + compare_f cmpF; + MatType type = -1; + cv::Size sz; + double fx = 0.5; + double fy = 0.5; + cv::GCompileArgs compile_args; + std::tie(cmpF, type, sz, fx, fy, compile_args) = GetParam(); - initMatsRandU(type, sz_in, type, false); + initMatsRandU(type, sz, type, false); cv::Mat add_res_ocv; cv::add(in_mat1, in_mat2, add_res_ocv); - cv::resize(add_res_ocv, out_mat_ocv, cv::Size(), 0.5, 0.5); + cv::resize(add_res_ocv, out_mat_ocv, cv::Size(), fx, fy); cv::GMat in1, in2; cv::GMat add_res_gapi = cv::gapi::add(in1, in2); - cv::GMat out = cv::gapi::resize(add_res_gapi, cv::Size(), 0.5, 0.5, INTER_LINEAR); + cv::GMat out = cv::gapi::resize(add_res_gapi, cv::Size(), fx, fy, INTER_LINEAR); cv::GComputation ac(GIn(in1, in2), GOut(out)); auto cc = ac.compile(descr_of(gin(in_mat1, in_mat2)), @@ -2284,6 +2470,7 @@ PERF_TEST_P_(ParseSSDBLPerfTest, TestPerformance) int filter_label = 0; cv::GCompileArgs compile_args; std::tie(sz, confidence_threshold, filter_label, compile_args) = GetParam(); + cv::Mat in_mat = generateSSDoutput(sz); std::vector boxes_gapi, boxes_ref; std::vector labels_gapi, labels_ref; @@ -2324,6 +2511,7 @@ PERF_TEST_P_(ParseSSDPerfTest, TestPerformance) bool alignment_to_square = false, filter_out_of_bounds = false; cv::GCompileArgs compile_args; std::tie(sz, confidence_threshold, alignment_to_square, filter_out_of_bounds, compile_args) = GetParam(); + cv::Mat in_mat = generateSSDoutput(sz); std::vector boxes_gapi, boxes_ref; @@ -2362,6 +2550,7 @@ PERF_TEST_P_(ParseYoloPerfTest, TestPerformance) int num_classes = 0; cv::GCompileArgs compile_args; std::tie(sz, confidence_threshold, nms_threshold, num_classes, compile_args) = GetParam(); + cv::Mat in_mat = generateYoloOutput(num_classes); auto anchors = cv::gapi::nn::parsers::GParseYolo::defaultAnchors(); std::vector boxes_gapi, boxes_ref; @@ -2398,7 +2587,7 @@ PERF_TEST_P_(ParseYoloPerfTest, TestPerformance) PERF_TEST_P_(SizePerfTest, TestPerformance) { - MatType type; + MatType type = -1; cv::Size sz; cv::GCompileArgs compile_args; std::tie(type, sz, compile_args) = GetParam(); @@ -2408,20 +2597,20 @@ PERF_TEST_P_(SizePerfTest, TestPerformance) cv::GMat in; auto out = cv::gapi::streaming::size(in); cv::GComputation c(cv::GIn(in), cv::GOut(out)); - cv::Size out_sz; + cv::Size sz_out; // Warm-up graph engine: auto cc = c.compile(descr_of(in_mat1), std::move(compile_args)); - cc(cv::gin(in_mat1), cv::gout(out_sz)); + cc(cv::gin(in_mat1), cv::gout(sz_out)); TEST_CYCLE() { - cc(cv::gin(in_mat1), cv::gout(out_sz)); + cc(cv::gin(in_mat1), cv::gout(sz_out)); } // Comparison //////////////////////////////////////////////////////////// { - EXPECT_EQ(out_sz, sz); + EXPECT_EQ(sz_out, sz); } SANITY_CHECK_NOTHING(); @@ -2440,20 +2629,20 @@ PERF_TEST_P_(SizeRPerfTest, TestPerformance) cv::GOpaque op_rect; auto out = cv::gapi::streaming::size(op_rect); cv::GComputation c(cv::GIn(op_rect), cv::GOut(out)); - cv::Size out_sz; + cv::Size sz_out; // Warm-up graph engine: auto cc = c.compile(descr_of(rect), std::move(compile_args)); - cc(cv::gin(rect), cv::gout(out_sz)); + cc(cv::gin(rect), cv::gout(sz_out)); TEST_CYCLE() { - cc(cv::gin(rect), cv::gout(out_sz)); + cc(cv::gin(rect), cv::gout(sz_out)); } // Comparison //////////////////////////////////////////////////////////// { - EXPECT_EQ(out_sz, sz); + EXPECT_EQ(sz_out, sz); } SANITY_CHECK_NOTHING(); diff --git a/modules/gapi/perf/cpu/gapi_core_perf_tests_cpu.cpp b/modules/gapi/perf/cpu/gapi_core_perf_tests_cpu.cpp index c110de4fdd..5323ea8f08 100644 --- a/modules/gapi/perf/cpu/gapi_core_perf_tests_cpu.cpp +++ b/modules/gapi/perf/cpu/gapi_core_perf_tests_cpu.cpp @@ -14,46 +14,60 @@ namespace opencv_test { +INSTANTIATE_TEST_CASE_P(PhasePerfTestFluid, PhasePerfTest, + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_32FC1, CV_64FC1), + Values(cv::compile_args(CORE_CPU)))); + +INSTANTIATE_TEST_CASE_P(SqrtPerfTestFluid, SqrtPerfTest, + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_32FC1, CV_64FC1), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(AddPerfTestCPU, AddPerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(-1, CV_8U, CV_16U, CV_32F), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(-1, CV_8U, CV_16U, CV_32F), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(AddCPerfTestCPU, AddCPerfTest, Combine(Values(AbsExact().to_compare_f()), - Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(-1, CV_8U, CV_16U, CV_32F), - Values(cv::compile_args(CORE_CPU)))); + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(-1, CV_8U, CV_16U, CV_32F), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(SubPerfTestCPU, SubPerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(-1, CV_8U, CV_16U, CV_32F), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(-1, CV_8U, CV_16U, CV_32F), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(SubCPerfTestCPU, SubCPerfTest, Combine(Values(AbsExact().to_compare_f()), - Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(-1, CV_8U, CV_16U, CV_32F), - Values(cv::compile_args(CORE_CPU)))); + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(-1, CV_8U, CV_16U, CV_32F), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(SubRCPerfTestCPU, SubRCPerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(-1, CV_8U, CV_16U, CV_32F), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(-1, CV_8U, CV_16U, CV_32F), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(MulPerfTestCPU, MulPerfTest, Combine(Values(AbsExact().to_compare_f()), - Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(-1, CV_8U, CV_16U, CV_32F), - Values(2.0), - Values(cv::compile_args(CORE_CPU)))); + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(-1, CV_8U, CV_16U, CV_32F), + Values(2.0), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(MulDoublePerfTestCPU, MulDoublePerfTest, Combine(Values(AbsExact().to_compare_f()), @@ -64,57 +78,63 @@ INSTANTIATE_TEST_CASE_P(MulDoublePerfTestCPU, MulDoublePerfTest, INSTANTIATE_TEST_CASE_P(MulCPerfTestCPU, MulCPerfTest, Combine(Values(AbsExact().to_compare_f()), - Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(-1, CV_8U, CV_16U, CV_32F), - Values(cv::compile_args(CORE_CPU)))); + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(-1, CV_8U, CV_16U, CV_32F), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(DivPerfTestCPU, DivPerfTest, Combine(Values(AbsExact().to_compare_f()), - Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(-1, CV_8U, CV_16U, CV_16S, CV_32F), - Values(2.3), - Values(cv::compile_args(CORE_CPU)))); + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(-1, CV_8U, CV_16U, CV_16S, CV_32F), + Values(2.3), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(DivCPerfTestCPU, DivCPerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(-1, CV_8U, CV_16U, CV_32F), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(-1, CV_8U, CV_16U, CV_32F), + Values(1.0), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(DivRCPerfTestCPU, DivRCPerfTest, Combine(Values(AbsExact().to_compare_f()), - Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(-1, CV_8U, CV_16U, CV_32F), - Values(cv::compile_args(CORE_CPU)))); + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(-1, CV_8U, CV_16U, CV_32F), + Values(1.0), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(MaskPerfTestCPU, MaskPerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_16UC1, CV_16SC1), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_16UC1, CV_16SC1), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(MeanPerfTestCPU, MeanPerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(AbsToleranceScalar(0.0).to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(Polar2CartPerfTestCPU, Polar2CartPerfTest, Combine(Values(AbsExact().to_compare_f()), - Values(szSmall128, szVGA, sz720p, sz1080p), - Values(cv::compile_args(CORE_CPU)))); + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(Cart2PolarPerfTestCPU, Cart2PolarPerfTest, Combine(Values(AbsExact().to_compare_f()), - Values(szSmall128, szVGA, sz720p, sz1080p), - Values(cv::compile_args(CORE_CPU)))); + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(CmpPerfTestCPU, CmpPerfTest, - Combine(Values(CMP_EQ, CMP_GE, CMP_NE, CMP_GT, CMP_LT, CMP_LE), - Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(CMP_EQ, CMP_GE, CMP_NE, CMP_GT, CMP_LT, CMP_LE), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(CmpWithScalarPerfTestCPU, CmpWithScalarPerfTest, Combine(Values(AbsExact().to_compare_f()), @@ -124,162 +144,184 @@ INSTANTIATE_TEST_CASE_P(CmpWithScalarPerfTestCPU, CmpWithScalarPerfTest, Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(BitwisePerfTestCPU, BitwisePerfTest, - Combine(Values(AND, OR, XOR), + Combine(Values(AbsExact().to_compare_f()), + Values(AND, OR, XOR), testing::Bool(), Values(szSmall128, szVGA, sz720p, sz1080p), Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1), Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(BitwiseNotPerfTestCPU, BitwiseNotPerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(SelectPerfTestCPU, SelectPerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(MinPerfTestCPU, MinPerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(MaxPerfTestCPU, MaxPerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(AbsDiffPerfTestCPU, AbsDiffPerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(AbsDiffCPerfTestCPU, AbsDiffCPerfTest, Combine(Values(AbsExact().to_compare_f()), - Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(cv::compile_args(CORE_CPU)))); + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(SumPerfTestCPU, SumPerfTest, Combine(Values(AbsToleranceScalar(0.0).to_compare_f()), - Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - //Values(0.0), - Values(cv::compile_args(CORE_CPU)))); + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(CountNonZeroPerfTestCPU, CountNonZeroPerfTest, - Combine(Values(AbsToleranceScalar(0.0).to_compare_f()), - Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_16UC1, CV_16SC1, CV_32FC1), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(AbsToleranceScalar(0.0).to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(AddWeightedPerfTestCPU, AddWeightedPerfTest, - Combine(Values(Tolerance_FloatRel_IntAbs(1e-6, 1).to_compare_f()), - Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(-1, CV_8U, CV_16U, CV_32F), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(-1, CV_8U, CV_16U, CV_32F), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(NormPerfTestCPU, NormPerfTest, Combine(Values(AbsToleranceScalar(0.0).to_compare_f()), - Values(NORM_INF, NORM_L1, NORM_L2), - Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(cv::compile_args(CORE_CPU)))); + Values(NORM_INF, NORM_L1, NORM_L2), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(IntegralPerfTestCPU, IntegralPerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_16UC1, CV_16SC1, CV_32FC1), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(ThresholdPerfTestCPU, ThresholdPerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(cv::THRESH_BINARY, cv::THRESH_BINARY_INV, cv::THRESH_TRUNC, cv::THRESH_TOZERO, cv::THRESH_TOZERO_INV), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::THRESH_BINARY, cv::THRESH_BINARY_INV, cv::THRESH_TRUNC, cv::THRESH_TOZERO, cv::THRESH_TOZERO_INV), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(ThresholdPerfTestCPU, ThresholdOTPerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1), - Values(cv::THRESH_OTSU, cv::THRESH_TRIANGLE), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1), + Values(cv::THRESH_OTSU, cv::THRESH_TRIANGLE), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(InRangePerfTestCPU, InRangePerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(Split3PerfTestCPU, Split3PerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(Split4PerfTestCPU, Split4PerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(Merge3PerfTestCPU, Merge3PerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(Merge4PerfTestCPU, Merge4PerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(RemapPerfTestCPU, RemapPerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(FlipPerfTestCPU, FlipPerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(0, 1, -1), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(0, 1, -1), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(CropPerfTestCPU, CropPerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(cv::Rect(10, 8, 20, 35), cv::Rect(4, 10, 37, 50)), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::Rect(10, 8, 20, 35), cv::Rect(4, 10, 37, 50)), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(CopyPerfTestCPU, CopyPerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(ConcatHorPerfTestCPU, ConcatHorPerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(ConcatHorVecPerfTestCPU, ConcatHorVecPerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(ConcatVertPerfTestCPU, ConcatVertPerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(ConcatVertVecPerfTestCPU, ConcatVertVecPerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(LUTPerfTestCPU, LUTPerfTest, - Combine(Values(CV_8UC1, CV_8UC3), - Values(CV_8UC1), - Values(szSmall128, szVGA, sz720p, sz1080p), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(CV_8UC1, CV_8UC3), + Values(CV_8UC1), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(LUTPerfTestCustomCPU, LUTPerfTest, - Combine(Values(CV_8UC3), - Values(CV_8UC3), - Values(szSmall128, szVGA, sz720p, sz1080p), - Values(cv::compile_args(CORE_CPU)))); - + Combine(Values(AbsExact().to_compare_f()), + Values(CV_8UC3), + Values(CV_8UC3), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(ConvertToPerfTestCPU, ConvertToPerfTest, Combine(Values(AbsExact().to_compare_f()), @@ -291,98 +333,100 @@ INSTANTIATE_TEST_CASE_P(ConvertToPerfTestCPU, ConvertToPerfTest, Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(KMeansNDPerfTestCPU, KMeansNDPerfTest, - Combine(Values(cv::Size(1, 20), - cv::Size(16, 4096)), - Values(AbsTolerance(0.01).to_compare_obj()), - Values(5, 15), - Values(cv::KMEANS_RANDOM_CENTERS, - cv::KMEANS_PP_CENTERS, - cv::KMEANS_RANDOM_CENTERS | cv::KMEANS_USE_INITIAL_LABELS, - cv::KMEANS_PP_CENTERS | cv::KMEANS_USE_INITIAL_LABELS), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(cv::Size(1, 20), + cv::Size(16, 4096)), + Values(AbsTolerance(0.01).to_compare_obj()), + Values(5, 15), + Values(cv::KMEANS_RANDOM_CENTERS, + cv::KMEANS_PP_CENTERS, + cv::KMEANS_RANDOM_CENTERS | cv::KMEANS_USE_INITIAL_LABELS, + cv::KMEANS_PP_CENTERS | cv::KMEANS_USE_INITIAL_LABELS), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(KMeans2DPerfTestCPU, KMeans2DPerfTest, - Combine(Values(20, 4096), - Values(5, 15), - Values(cv::KMEANS_RANDOM_CENTERS, - cv::KMEANS_PP_CENTERS, - cv::KMEANS_RANDOM_CENTERS | cv::KMEANS_USE_INITIAL_LABELS, - cv::KMEANS_PP_CENTERS | cv::KMEANS_USE_INITIAL_LABELS), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(20, 4096), + Values(5, 15), + Values(cv::KMEANS_RANDOM_CENTERS, + cv::KMEANS_PP_CENTERS, + cv::KMEANS_RANDOM_CENTERS | cv::KMEANS_USE_INITIAL_LABELS, + cv::KMEANS_PP_CENTERS | cv::KMEANS_USE_INITIAL_LABELS), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(KMeans3DPerfTestCPU, KMeans3DPerfTest, - Combine(Values(20, 4096), - Values(5, 15), - Values(cv::KMEANS_RANDOM_CENTERS, - cv::KMEANS_PP_CENTERS, - cv::KMEANS_RANDOM_CENTERS | cv::KMEANS_USE_INITIAL_LABELS, - cv::KMEANS_PP_CENTERS | cv::KMEANS_USE_INITIAL_LABELS), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(20, 4096), + Values(5, 15), + Values(cv::KMEANS_RANDOM_CENTERS, + cv::KMEANS_PP_CENTERS, + cv::KMEANS_RANDOM_CENTERS | cv::KMEANS_USE_INITIAL_LABELS, + cv::KMEANS_PP_CENTERS | cv::KMEANS_USE_INITIAL_LABELS), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(TransposePerfTestCPU, TransposePerfTest, - Combine(Values(AbsExact().to_compare_f()), - Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_16UC1, CV_16SC1, CV_32FC1, - CV_8UC2, CV_16UC2, CV_16SC2, CV_32FC2, - CV_8UC3, CV_16UC3, CV_16SC3, CV_32FC3), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_16UC1, CV_16SC1, CV_32FC1, + CV_8UC2, CV_16UC2, CV_16SC2, CV_32FC2, + CV_8UC3, CV_16UC3, CV_16SC3, CV_32FC3), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(ResizePerfTestCPU, ResizePerfTest, Combine(Values(AbsExact().to_compare_f()), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1), - Values(cv::INTER_NEAREST, cv::INTER_LINEAR, cv::INTER_AREA), - Values(szSmall128, szVGA, sz720p, sz1080p), - Values(cv::Size(64, 64), - cv::Size(32, 32)), - Values(cv::compile_args(CORE_CPU)))); + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1), + Values(cv::INTER_NEAREST, cv::INTER_LINEAR, cv::INTER_AREA), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values( cv::Size(64, 64), + cv::Size(32, 32)), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(BottleneckKernelsPerfTestCPU, BottleneckKernelsConstInputPerfTest, Combine(Values(AbsExact().to_compare_f()), - Values("cv/optflow/frames/1080p_00.png", "cv/optflow/frames/720p_00.png", - "cv/optflow/frames/VGA_00.png", "cv/dnn_face/recognition/Aaron_Tippin_0001.jpg"), - Values(cv::compile_args(CORE_CPU)))); + Values( "cv/optflow/frames/1080p_00.png", "cv/optflow/frames/720p_00.png", + "cv/optflow/frames/VGA_00.png", "cv/dnn_face/recognition/Aaron_Tippin_0001.jpg"), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(ResizeInSimpleGraphPerfTestCPU, ResizeInSimpleGraphPerfTest, Combine(Values(AbsExact().to_compare_f()), - Values(CV_8UC3), - Values(szSmall128, szVGA, sz720p, sz1080p), - Values(cv::compile_args(CORE_CPU)))); + Values(CV_8UC3), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(0.5), + Values(0.5), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(ResizeFxFyPerfTestCPU, ResizeFxFyPerfTest, Combine(Values(AbsExact().to_compare_f()), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1), - Values(cv::INTER_NEAREST, cv::INTER_LINEAR, cv::INTER_AREA), - Values(szSmall128, szVGA, sz720p, sz1080p), - Values(0.5, 0.1), - Values(0.5, 0.1), - Values(cv::compile_args(CORE_CPU)))); + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1), + Values(cv::INTER_NEAREST, cv::INTER_LINEAR, cv::INTER_AREA), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(0.5, 0.1), + Values(0.5, 0.1), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(ParseSSDBLPerfTestCPU, ParseSSDBLPerfTest, - Combine(Values(sz720p, sz1080p), - Values(0.3f, 0.7f), - Values(0, 1), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(sz720p, sz1080p), + Values(0.3f, 0.7f), + Values(0, 1), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(ParseSSDPerfTestCPU, ParseSSDPerfTest, - Combine(Values(sz720p, sz1080p), - Values(0.3f, 0.7f), - testing::Bool(), - testing::Bool(), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(sz720p, sz1080p), + Values(0.3f, 0.7f), + testing::Bool(), + testing::Bool(), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(ParseYoloPerfTestCPU, ParseYoloPerfTest, - Combine(Values(sz720p, sz1080p), - Values(0.3f, 0.7f), - Values(0.5), - Values(7, 80), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(sz720p, sz1080p), + Values(0.3f, 0.7f), + Values(0.5), + Values(7, 80), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(SizePerfTestCPU, SizePerfTest, - Combine(Values(CV_8UC1, CV_8UC3, CV_32FC1), - Values(szSmall128, szVGA, sz720p, sz1080p), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(CV_8UC1, CV_8UC3, CV_32FC1), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(cv::compile_args(CORE_CPU)))); INSTANTIATE_TEST_CASE_P(SizeRPerfTestCPU, SizeRPerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), - Values(cv::compile_args(CORE_CPU)))); + Combine(Values(szSmall128, szVGA, sz720p, sz1080p), + Values(cv::compile_args(CORE_CPU)))); } // opencv_test diff --git a/modules/gapi/perf/cpu/gapi_core_perf_tests_fluid.cpp b/modules/gapi/perf/cpu/gapi_core_perf_tests_fluid.cpp index 442d9efa7a..e25029b835 100644 --- a/modules/gapi/perf/cpu/gapi_core_perf_tests_fluid.cpp +++ b/modules/gapi/perf/cpu/gapi_core_perf_tests_fluid.cpp @@ -12,106 +12,128 @@ namespace opencv_test { + +INSTANTIATE_TEST_CASE_P(PhasePerfTestFluid, PhasePerfTest, + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_32FC1, CV_64FC1), + Values(cv::compile_args(CORE_FLUID)))); + +INSTANTIATE_TEST_CASE_P(SqrtPerfTestFluid, SqrtPerfTest, + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_32FC1, CV_64FC1), + Values(cv::compile_args(CORE_FLUID)))); + INSTANTIATE_TEST_CASE_P(AddPerfTestFluid, AddPerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), + Combine(Values(Tolerance_FloatRel_IntAbs(1e-6, 1).to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), Values(CV_8UC1, CV_8UC3, CV_16SC1, CV_32FC1), Values(-1, CV_8U, CV_32F), Values(cv::compile_args(CORE_FLUID)))); - INSTANTIATE_TEST_CASE_P(AddCPerfTestFluid, AddCPerfTest, - Combine(Values(Tolerance_FloatRel_IntAbs(1e-6, 1).to_compare_f()), - Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(-1, CV_8U, CV_16U, CV_16S, CV_32F), - Values(cv::compile_args(CORE_FLUID)))); +INSTANTIATE_TEST_CASE_P(AddCPerfTestFluid, AddCPerfTest, + Combine(Values(Tolerance_FloatRel_IntAbs(1e-6, 1).to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(-1, CV_8U, CV_16U, CV_16S, CV_32F), + Values(cv::compile_args(CORE_FLUID)))); INSTANTIATE_TEST_CASE_P(SubPerfTestFluid, SubPerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), Values(CV_8UC1, CV_8UC3, CV_16SC1, CV_32FC1), Values(-1, CV_8U, CV_32F), Values(cv::compile_args(CORE_FLUID)))); - INSTANTIATE_TEST_CASE_P(SubCPerfTestFluid, SubCPerfTest, - Combine(Values(Tolerance_FloatRel_IntAbs(1e-6, 1).to_compare_f()), - Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(-1, CV_8U, CV_16U, CV_16S, CV_32F), - Values(cv::compile_args(CORE_FLUID)))); +INSTANTIATE_TEST_CASE_P(SubCPerfTestFluid, SubCPerfTest, + Combine(Values(Tolerance_FloatRel_IntAbs(1e-6, 1).to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16SC1, CV_32FC1), + Values(-1, CV_8U, CV_32F), + Values(cv::compile_args(CORE_FLUID)))); -// INSTANTIATE_TEST_CASE_P(SubRCPerfTestFluid, SubRCPerfTest, -// Combine(Values(szSmall128, szVGA, sz720p, sz1080p), -// Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), -// Values(-1, CV_8U, CV_16U, CV_32F), -// Values(cv::compile_args(CORE_FLUID)))); +INSTANTIATE_TEST_CASE_P(SubRCPerfTestFluid, SubRCPerfTest, + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16SC1, CV_32FC1), + Values(-1, CV_8U, CV_32F), + Values(cv::compile_args(CORE_FLUID)))); - INSTANTIATE_TEST_CASE_P(MulPerfTestFluid, MulPerfTest, - Combine(Values(AbsExact().to_compare_f()), - Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(-1, CV_8U, CV_16U, CV_16S, CV_32F), - Values(2.0), - Values(cv::compile_args(CORE_FLUID)))); +INSTANTIATE_TEST_CASE_P(MulPerfTestFluid, MulPerfTest, + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(-1, CV_8U, CV_16U, CV_16S, CV_32F), + Values(2.0), + Values(cv::compile_args(CORE_FLUID)))); - INSTANTIATE_TEST_CASE_P(MulDoublePerfTestFluid, MulDoublePerfTest, - Combine(Values(Tolerance_FloatRel_IntAbs(1e-6, 1).to_compare_f()), - Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16SC1, CV_32FC1), - Values(-1, CV_8U, CV_32F), - Values(cv::compile_args(CORE_FLUID)))); +INSTANTIATE_TEST_CASE_P(MulDoublePerfTestFluid, MulDoublePerfTest, + Combine(Values(Tolerance_FloatRel_IntAbs(1e-6, 1).to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16SC1, CV_32FC1), + Values(-1, CV_8U, CV_32F), + Values(cv::compile_args(CORE_FLUID)))); - INSTANTIATE_TEST_CASE_P(MulCPerfTestFluid, MulCPerfTest, - Combine(Values(Tolerance_FloatRel_IntAbs(1e-6, 1).to_compare_f()), - Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(-1, CV_8U, CV_16U, CV_16S, CV_32F), - Values(cv::compile_args(CORE_FLUID)))); +INSTANTIATE_TEST_CASE_P(MulCPerfTestFluid, MulCPerfTest, + Combine(Values(Tolerance_FloatRel_IntAbs(1e-6, 1).to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16SC1, CV_32FC1), + Values(-1, CV_8U, CV_32F), + Values(cv::compile_args(CORE_FLUID)))); - INSTANTIATE_TEST_CASE_P(DivPerfTestFluid, DivPerfTest, - Combine(Values(AbsExact().to_compare_f()), - Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(-1, CV_8U, CV_16U, CV_16S, CV_32F), - Values(2.3), - Values(cv::compile_args(CORE_FLUID)))); +INSTANTIATE_TEST_CASE_P(DivPerfTestFluid, DivPerfTest, + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(-1, CV_8U, CV_16U, CV_16S, CV_32F), + Values(2.3), + Values(cv::compile_args(CORE_FLUID)))); -// INSTANTIATE_TEST_CASE_P(DivCPerfTestFluid, DivCPerfTest, -// Combine(Values(szSmall128, szVGA, sz720p, sz1080p), -// Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), -// Values(-1, CV_8U, CV_16U, CV_32F), -// Values(cv::compile_args(CORE_FLUID)))); +INSTANTIATE_TEST_CASE_P(DivCPerfTestFluid, DivCPerfTest, + Combine(Values(Tolerance_FloatRel_IntAbs(1e-6, 1).to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16SC1, CV_32FC1), + Values(-1, CV_8U, CV_32F), + Values(1.0), + Values(cv::compile_args(CORE_FLUID)))); -// INSTANTIATE_TEST_CASE_P(DivRCPerfTestFluid, DivRCPerfTest, -// Combine(Values(AbsExact().to_compare_f()), -// Values(szSmall128, szVGA, sz720p, sz1080p), -// Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), -// Values(-1, CV_8U, CV_16U, CV_32F), -// Values(cv::compile_args(CORE_FLUID)))); +INSTANTIATE_TEST_CASE_P(DivRCPerfTestFluid, DivRCPerfTest, + Combine(Values(Tolerance_FloatRel_IntAbs(1e-5, 1).to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_32FC1), + Values(-1, CV_8U, CV_32F), + Values(1.0), + Values(cv::compile_args(CORE_FLUID)))); INSTANTIATE_TEST_CASE_P(MaskPerfTestFluid, MaskPerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), Values(CV_8UC1, CV_16UC1, CV_16SC1), Values(cv::compile_args(CORE_FLUID)))); -// INSTANTIATE_TEST_CASE_P(MeanPerfTestFluid, MeanPerfTest, -// Combine(Values(szSmall128, szVGA, sz720p, sz1080p), -// Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), -// Values(cv::compile_args(CORE_FLUID)))); +INSTANTIATE_TEST_CASE_P(MeanPerfTestFluid, MeanPerfTest, + Combine(Values(AbsToleranceScalar(0.0).to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::compile_args(CORE_FLUID)))); -// INSTANTIATE_TEST_CASE_P(Polar2CartPerfTestFluid, Polar2CartPerfTest, -// Combine(Values(AbsExact().to_compare_f()), -// Values(szSmall128, szVGA, sz720p, sz1080p), -// Values(cv::compile_args(CORE_FLUID)))); +INSTANTIATE_TEST_CASE_P(Polar2CartPerfTestFluid, Polar2CartPerfTest, + Combine(Values(Tolerance_FloatRel_IntAbs(1e-6, 1).to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(cv::compile_args(CORE_FLUID)))); -// INSTANTIATE_TEST_CASE_P(Cart2PolarPerfTestFluid, Cart2PolarPerfTest, -// Combine(Values(AbsExact().to_compare_f()), -// Values(szSmall128, szVGA, sz720p, sz1080p), -// Values(cv::compile_args(CORE_FLUID)))); +INSTANTIATE_TEST_CASE_P(Cart2PolarPerfTestFluid, Cart2PolarPerfTest, + Combine(Values(Tolerance_FloatRel_IntAbs(1e-04, 1).to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(cv::compile_args(CORE_FLUID)))); -// INSTANTIATE_TEST_CASE_P(CmpPerfTestFluid, CmpPerfTest, -// Combine(Values(CMP_EQ, CMP_GE, CMP_NE, CMP_GT, CMP_LT, CMP_LE), -// Values(szSmall128, szVGA, sz720p, sz1080p), -// Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), -// Values(cv::compile_args(CORE_FLUID)))); +INSTANTIATE_TEST_CASE_P(CmpPerfTestFluid, CmpPerfTest, + Combine(Values(AbsExact().to_compare_f()), + Values(CMP_EQ, CMP_GE, CMP_NE, CMP_GT, CMP_LT, CMP_LE), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16SC1, CV_32FC1), + Values(cv::compile_args(CORE_FLUID)))); INSTANTIATE_TEST_CASE_P(CmpWithScalarPerfTestFluid, CmpWithScalarPerfTest, Combine(Values(AbsSimilarPoints(1, 0.01).to_compare_f()), @@ -121,34 +143,40 @@ INSTANTIATE_TEST_CASE_P(CmpWithScalarPerfTestFluid, CmpWithScalarPerfTest, Values(cv::compile_args(CORE_FLUID)))); INSTANTIATE_TEST_CASE_P(BitwisePerfTestFluid, BitwisePerfTest, - Combine(Values(AND, OR, XOR), + Combine(Values(AbsExact().to_compare_f()), + Values(AND, OR, XOR), testing::Bool(), Values(szSmall128, szVGA, sz720p, sz1080p), Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1), Values(cv::compile_args(CORE_FLUID)))); INSTANTIATE_TEST_CASE_P(BitwiseNotPerfTestFluid, BitwiseNotPerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1), Values(cv::compile_args(CORE_FLUID)))); -// INSTANTIATE_TEST_CASE_P(SelectPerfTestFluid, SelectPerfTest, -// Combine(Values(szSmall128, szVGA, sz720p, sz1080p), -// Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), -// Values(cv::compile_args(CORE_FLUID)))); +INSTANTIATE_TEST_CASE_P(SelectPerfTestFluid, SelectPerfTest, + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1), + Values(cv::compile_args(CORE_FLUID)))); -// INSTANTIATE_TEST_CASE_P(MinPerfTestFluid, MinPerfTest, -// Combine(Values(szSmall128, szVGA, sz720p, sz1080p), -// Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), -// Values(cv::compile_args(CORE_FLUID)))); +INSTANTIATE_TEST_CASE_P(MinPerfTestFluid, MinPerfTest, + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::compile_args(CORE_FLUID)))); -// INSTANTIATE_TEST_CASE_P(MaxPerfTestFluid, MaxPerfTest, -// Combine(Values(szSmall128, szVGA, sz720p, sz1080p), -// Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), -// Values(cv::compile_args(CORE_FLUID)))); +INSTANTIATE_TEST_CASE_P(MaxPerfTestFluid, MaxPerfTest, + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::compile_args(CORE_FLUID)))); INSTANTIATE_TEST_CASE_P(AbsDiffPerfTestFluid, AbsDiffPerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), Values(cv::compile_args(CORE_FLUID)))); @@ -158,12 +186,11 @@ INSTANTIATE_TEST_CASE_P(AbsDiffCPerfTestFluid, AbsDiffCPerfTest, Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), Values(cv::compile_args(CORE_FLUID)))); -// INSTANTIATE_TEST_CASE_P(SumPerfTestFluid, SumPerfTest, -// Combine(Values(AbsToleranceScalar(0.0).to_compare_f()), -// Values(szSmall128, szVGA, sz720p, sz1080p), -// Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), -// //Values(0.0), -// Values(cv::compile_args(CORE_FLUID)))); +INSTANTIATE_TEST_CASE_P(SumPerfTestFluid, SumPerfTest, + Combine(Values(AbsToleranceScalar(0.0).to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::compile_args(CORE_FLUID)))); INSTANTIATE_TEST_CASE_P(AddWeightedPerfTestFluid, AddWeightedPerfTest, Combine(Values(Tolerance_FloatRel_IntAbs(1e-6, 1).to_compare_f()), @@ -179,102 +206,121 @@ INSTANTIATE_TEST_CASE_P(AddWeightedPerfTestFluid_short, AddWeightedPerfTest, Values(-1), Values(cv::compile_args(CORE_FLUID)))); -// INSTANTIATE_TEST_CASE_P(NormPerfTestFluid, NormPerfTest, -// Combine(Values(AbsToleranceScalar(0.0).to_compare_f()), -// Values(NORM_INF, NORM_L1, NORM_L2), -// Values(szSmall128, szVGA, sz720p, sz1080p), -// Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), -// Values(cv::compile_args(CORE_FLUID)))); - -// INSTANTIATE_TEST_CASE_P(IntegralPerfTestFluid, IntegralPerfTest, -// Combine(Values(szSmall128, szVGA, sz720p, sz1080p), -// Values(CV_8UC1, CV_16UC1, CV_16SC1, CV_32FC1), -// Values(cv::compile_args(CORE_FLUID)))); - -// INSTANTIATE_TEST_CASE_P(ThresholdPerfTestFluid, ThresholdPerfTest, -// Combine(Values(szSmall128, szVGA, sz720p, sz1080p), -// Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), -// Values(cv::THRESH_BINARY, cv::THRESH_BINARY_INV, cv::THRESH_TRUNC, cv::THRESH_TOZERO, cv::THRESH_TOZERO_INV), -// Values(cv::compile_args(CORE_FLUID)))); - -// INSTANTIATE_TEST_CASE_P(ThresholdPerfTestFluid, ThresholdOTPerfTest, -// Combine(Values(szSmall128, szVGA, sz720p, sz1080p), -// Values(CV_8UC1), -// Values(cv::THRESH_OTSU, cv::THRESH_TRIANGLE), -// Values(cv::compile_args(CORE_FLUID)))); - -// INSTANTIATE_TEST_CASE_P(InRangePerfTestFluid, InRangePerfTest, -// Combine(Values(szSmall128, szVGA, sz720p, sz1080p), -// Values(CV_8UC1), -// Values(cv::compile_args(CORE_FLUID)))); - -INSTANTIATE_TEST_CASE_P(Split3PerfTestFluid, Split3PerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), +INSTANTIATE_TEST_CASE_P(NormPerfTestFluid, NormPerfTest, + Combine(Values(AbsToleranceScalar(0.0).to_compare_f()), + Values(NORM_INF, NORM_L1, NORM_L2), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), Values(cv::compile_args(CORE_FLUID)))); -// INSTANTIATE_TEST_CASE_P(Split4PerfTestFluid, Split4PerfTest, -// Combine(Values(szSmall128, szVGA, sz720p, sz1080p), -// Values(cv::compile_args(CORE_FLUID)))); +INSTANTIATE_TEST_CASE_P(IntegralPerfTestFluid, IntegralPerfTest, + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::compile_args(CORE_FLUID)))); -// INSTANTIATE_TEST_CASE_P(Merge3PerfTestFluid, Merge3PerfTest, -// Combine(Values(szSmall128, szVGA, sz720p, sz1080p), -// Values(cv::compile_args(CORE_FLUID)))); +INSTANTIATE_TEST_CASE_P(ThresholdPerfTestFluid, ThresholdPerfTest, + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1), + Values(cv::THRESH_BINARY, cv::THRESH_BINARY_INV, cv::THRESH_TRUNC, + cv::THRESH_TOZERO, cv::THRESH_TOZERO_INV), + Values(cv::compile_args(CORE_FLUID)))); -// INSTANTIATE_TEST_CASE_P(Merge4PerfTestFluid, Merge4PerfTest, -// Combine(Values(szSmall128, szVGA, sz720p, sz1080p), -// Values(cv::compile_args(CORE_FLUID)))); +INSTANTIATE_TEST_CASE_P(ThresholdPerfTestFluid, ThresholdOTPerfTest, + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1), + Values(cv::THRESH_OTSU, cv::THRESH_TRIANGLE), + Values(cv::compile_args(CORE_FLUID)))); -// INSTANTIATE_TEST_CASE_P(RemapPerfTestFluid, RemapPerfTest, -// Combine(Values(szSmall128, szVGA, sz720p, sz1080p), -// Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), -// Values(cv::compile_args(CORE_FLUID)))); +INSTANTIATE_TEST_CASE_P(InRangePerfTestFluid, InRangePerfTest, + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1), + Values(cv::compile_args(CORE_FLUID)))); -// INSTANTIATE_TEST_CASE_P(FlipPerfTestFluid, FlipPerfTest, -// Combine(Values(szSmall128, szVGA, sz720p, sz1080p), -// Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), -// Values(0, 1, -1), -// Values(cv::compile_args(CORE_FLUID)))); +INSTANTIATE_TEST_CASE_P(Split3PerfTestFluid, Split3PerfTest, + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(cv::compile_args(CORE_FLUID)))); -// INSTANTIATE_TEST_CASE_P(CropPerfTestFluid, CropPerfTest, -// Combine(Values(szSmall128, szVGA, sz720p, sz1080p), -// Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), -// Values(cv::Rect(10, 8, 20, 35), cv::Rect(4, 10, 37, 50)), -// Values(cv::compile_args(CORE_FLUID)))); +INSTANTIATE_TEST_CASE_P(Split4PerfTestFluid, Split4PerfTest, + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(cv::compile_args(CORE_FLUID)))); -// INSTANTIATE_TEST_CASE_P(ConcatHorPerfTestFluid, ConcatHorPerfTest, -// Combine(Values(szSmall128, szVGA, sz720p, sz1080p), -// Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), -// Values(cv::compile_args(CORE_FLUID)))); +INSTANTIATE_TEST_CASE_P(Merge3PerfTestFluid, Merge3PerfTest, + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(cv::compile_args(CORE_FLUID)))); -// INSTANTIATE_TEST_CASE_P(ConcatHorVecPerfTestFluid, ConcatHorVecPerfTest, -// Combine(Values(szSmall128, szVGA, sz720p, sz1080p), -// Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), -// Values(cv::compile_args(CORE_FLUID)))); +INSTANTIATE_TEST_CASE_P(Merge4PerfTestFluid, Merge4PerfTest, + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(cv::compile_args(CORE_FLUID)))); -// INSTANTIATE_TEST_CASE_P(ConcatVertPerfTestFluid, ConcatVertPerfTest, -// Combine(Values(szSmall128, szVGA, sz720p, sz1080p), -// Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), -// Values(cv::compile_args(CORE_FLUID)))); +INSTANTIATE_TEST_CASE_P(RemapPerfTestFluid, RemapPerfTest, + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::compile_args(CORE_FLUID)))); -// INSTANTIATE_TEST_CASE_P(ConcatVertVecPerfTestFluid, ConcatVertVecPerfTest, -// Combine(Values(szSmall128, szVGA, sz720p, sz1080p), -// Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), -// Values(cv::compile_args(CORE_FLUID)))); +INSTANTIATE_TEST_CASE_P(FlipPerfTestFluid, FlipPerfTest, + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(0, 1, -1), + Values(cv::compile_args(CORE_FLUID)))); -// INSTANTIATE_TEST_CASE_P(LUTPerfTestFluid, LUTPerfTest, -// Combine(Values(CV_8UC1, CV_8UC3), -// Values(CV_8UC1), -// Values(szSmall128, szVGA, sz720p, sz1080p), -// Values(cv::compile_args(CORE_FLUID)))); +INSTANTIATE_TEST_CASE_P(CropPerfTestFluid, CropPerfTest, + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::Rect(10, 8, 20, 35), cv::Rect(4, 10, 37, 50)), + Values(cv::compile_args(CORE_FLUID)))); +INSTANTIATE_TEST_CASE_P(ConcatHorPerfTestFluid, ConcatHorPerfTest, + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::compile_args(CORE_FLUID)))); + +INSTANTIATE_TEST_CASE_P(ConcatHorVecPerfTestFluid, ConcatHorVecPerfTest, + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::compile_args(CORE_FLUID)))); + +INSTANTIATE_TEST_CASE_P(ConcatVertPerfTestFluid, ConcatVertPerfTest, + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::compile_args(CORE_FLUID)))); + +INSTANTIATE_TEST_CASE_P(ConcatVertVecPerfTestFluid, ConcatVertVecPerfTest, + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::compile_args(CORE_FLUID)))); + +INSTANTIATE_TEST_CASE_P(LUTPerfTestFluid, LUTPerfTest, + Combine(Values(AbsExact().to_compare_f()), + Values(CV_8UC1, CV_8UC3), + Values(CV_8UC1), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(cv::compile_args(CORE_FLUID)))); + +// FIXIT: This test case doesn't work [3030] // INSTANTIATE_TEST_CASE_P(LUTPerfTestCustomFluid, LUTPerfTest, -// Combine(Values(CV_8UC3), -// Values(CV_8UC3), -// Values(szSmall128, szVGA, sz720p, sz1080p), -// Values(cv::compile_args(CORE_FLUID)))); +// Combine(Values(AbsExact().to_compare_f()), +// Values(CV_8UC3), +// Values(CV_8UC3), +// Values(szSmall128, szVGA, sz720p, sz1080p), +// Values(cv::compile_args(CORE_FLUID)))); INSTANTIATE_TEST_CASE_P(ConvertToPerfTestFluid, ConvertToPerfTest, - Combine(Values(Tolerance_FloatRel_IntAbs(1e-5, 2).to_compare_f()), + Combine(Values(Tolerance_FloatRel_IntAbs(1e-5, 1).to_compare_f()), Values(CV_8UC3, CV_8UC1, CV_16UC1, CV_16SC1, CV_32FC1), Values(CV_8U, CV_16U, CV_16S, CV_32F), Values(szSmall128, szVGA, sz720p, sz1080p), @@ -284,32 +330,34 @@ INSTANTIATE_TEST_CASE_P(ConvertToPerfTestFluid, ConvertToPerfTest, INSTANTIATE_TEST_CASE_P(ResizePerfTestFluid, ResizePerfTest, Combine(Values(Tolerance_FloatRel_IntAbs(1e-5, 1).to_compare_f()), - Values(CV_8UC3), - Values(cv::INTER_LINEAR), - Values(szSmall128, szVGA, sz720p, sz1080p), - Values(cv::Size(64, 64), - cv::Size(30, 30)), - Values(cv::compile_args(CORE_FLUID)))); + Values(CV_8UC3), + Values(cv::INTER_LINEAR), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(cv::Size(64, 64), + cv::Size(30, 30)), + Values(cv::compile_args(CORE_FLUID)))); #define IMGPROC_FLUID cv::gapi::imgproc::fluid::kernels() INSTANTIATE_TEST_CASE_P(BottleneckKernelsPerfTestFluid, BottleneckKernelsConstInputPerfTest, Combine(Values(AbsSimilarPoints(0, 1).to_compare_f()), - Values("cv/optflow/frames/1080p_00.png", "cv/optflow/frames/720p_00.png", - "cv/optflow/frames/VGA_00.png", "cv/dnn_face/recognition/Aaron_Tippin_0001.jpg"), - Values(cv::compile_args(CORE_FLUID, IMGPROC_FLUID)))); + Values("cv/optflow/frames/1080p_00.png", "cv/optflow/frames/720p_00.png", + "cv/optflow/frames/VGA_00.png", "cv/dnn_face/recognition/Aaron_Tippin_0001.jpg"), + Values(cv::compile_args(CORE_FLUID, IMGPROC_FLUID)))); INSTANTIATE_TEST_CASE_P(ResizeInSimpleGraphPerfTestFluid, ResizeInSimpleGraphPerfTest, Combine(Values(Tolerance_FloatRel_IntAbs(1e-5, 1).to_compare_f()), - Values(CV_8UC3), - Values(szSmall128, szVGA, sz720p, sz1080p), - Values(cv::compile_args(CORE_FLUID, IMGPROC_FLUID)))); + Values(CV_8UC3), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(0.5), + Values(0.5), + Values(cv::compile_args(CORE_FLUID, IMGPROC_FLUID)))); INSTANTIATE_TEST_CASE_P(ResizeFxFyPerfTestFluid, ResizeFxFyPerfTest, Combine(Values(Tolerance_FloatRel_IntAbs(1e-5, 1).to_compare_f()), - Values(CV_8UC3), - Values(cv::INTER_LINEAR), - Values(szSmall128, szVGA, sz720p, sz1080p), - Values(0.5, 0.1), - Values(0.5, 0.1), - Values(cv::compile_args(CORE_FLUID)))); + Values(CV_8UC3), + Values(cv::INTER_LINEAR), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(0.5, 0.1), + Values(0.5, 0.1), + Values(cv::compile_args(CORE_FLUID)))); } // opencv_test diff --git a/modules/gapi/perf/gpu/gapi_core_perf_tests_gpu.cpp b/modules/gapi/perf/gpu/gapi_core_perf_tests_gpu.cpp index fd00f1caea..6aaec4d79a 100644 --- a/modules/gapi/perf/gpu/gapi_core_perf_tests_gpu.cpp +++ b/modules/gapi/perf/gpu/gapi_core_perf_tests_gpu.cpp @@ -14,299 +14,331 @@ namespace opencv_test { INSTANTIATE_TEST_CASE_P(AddPerfTestGPU, AddPerfTest, - Combine(Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), - Values( -1, CV_8U, CV_16U, CV_32F ), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), + Values( -1, CV_8U, CV_16U, CV_32F ), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(AddCPerfTestGPU, AddCPerfTest, - Combine(Values(AbsExact().to_compare_f()), - Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), - Values( -1, CV_8U, CV_16U, CV_32F ), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), + Values( -1, CV_8U, CV_16U, CV_32F ), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(SubPerfTestGPU, SubPerfTest, - Combine(Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), - Values( -1, CV_8U, CV_16U, CV_32F ), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), + Values( -1, CV_8U, CV_16U, CV_32F ), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(SubCPerfTestGPU, SubCPerfTest, - Combine(Values(AbsExact().to_compare_f()), - Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), - Values( -1, CV_8U, CV_16U, CV_32F ), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), + Values( -1, CV_8U, CV_16U, CV_32F ), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(SubRCPerfTestGPU, SubRCPerfTest, - Combine(Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), - Values( -1, CV_8U, CV_16U, CV_32F ), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), + Values( -1, CV_8U, CV_16U, CV_32F ), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(MulPerfTestGPU, MulPerfTest, - Combine(Values(AbsExact().to_compare_f()), - Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), - Values( -1, CV_8U, CV_16U, CV_32F ), - Values(2.0), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), + Values( -1, CV_8U, CV_16U, CV_32F ), + Values(2.0), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(MulDoublePerfTestGPU, MulDoublePerfTest, - Combine(Values(Tolerance_FloatRel_IntAbs(1e-5, 1).to_compare_f()), - Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), - Values( -1, CV_8U, CV_16U, CV_32F ), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(Tolerance_FloatRel_IntAbs(1e-5, 1).to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), + Values( -1, CV_8U, CV_16U, CV_32F ), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(MulCPerfTestGPU, MulCPerfTest, - Combine(Values(Tolerance_FloatRel_IntAbs(1e-5, 1).to_compare_f()), - Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), - Values( -1, CV_8U, CV_16U, CV_32F ), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(Tolerance_FloatRel_IntAbs(1e-5, 1).to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), + Values( -1, CV_8U, CV_16U, CV_32F ), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(DivPerfTestGPU, DivPerfTest, - Combine(Values(AbsTolerance(2).to_compare_f()), - Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), - Values( -1, CV_8U, CV_16U, CV_32F ), - Values(2.3), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsTolerance(2).to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), + Values( -1, CV_8U, CV_16U, CV_32F ), + Values(2.3), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(DivCPerfTestGPU, DivCPerfTest, - Combine(Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), - Values( -1, CV_8U, CV_16U, CV_32F ), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), + Values( -1, CV_8U, CV_16U, CV_32F ), + Values(1.0), + Values(cv::compile_args(CORE_GPU)))); +// FIXIT: CV_16SC1 test case doesn't work with OpenCL [3031] INSTANTIATE_TEST_CASE_P(DivRCPerfTestGPU, DivRCPerfTest, - Combine(Values(Tolerance_FloatRel_IntAbs(1e-5, 2).to_compare_f()), - Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), - Values( -1, CV_8U, CV_16U, CV_32F ), - Values(cv::compile_args(CORE_GPU)))); -//TODO: mask test doesn't work + Combine(Values(Tolerance_FloatRel_IntAbs(1e-6, 1).to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_16UC1, /*CV_16SC1,*/ CV_32FC1 ), + Values( -1, CV_8U, CV_16U, CV_32F ), + Values(1.0), + Values(cv::compile_args(CORE_GPU)))); + +// FIXIT: mask test on GPU doesn't work [3032] INSTANTIATE_TEST_CASE_P(DISABLED_MaskPerfTestGPU, MaskPerfTest, - Combine(Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_16UC1, CV_16SC1), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_16UC1, CV_16SC1), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(MeanPerfTestGPU, MeanPerfTest, - Combine(Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsToleranceScalar(0.0).to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(Polar2CartPerfTestGPU, Polar2CartPerfTest, - Combine(Values(Tolerance_FloatRel_IntAbs(1e-5, 2).to_compare_f()), - Values( szSmall128, szVGA, sz720p, sz1080p ), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(Tolerance_FloatRel_IntAbs(1e-5, 2).to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(Cart2PolarPerfTestGPU, Cart2PolarPerfTest, - Combine(Values(Tolerance_FloatRel_IntAbs(1e-2, 2).to_compare_f()), - Values( szSmall128, szVGA, sz720p, sz1080p ), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(Tolerance_FloatRel_IntAbs(1e-2, 2).to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(CmpPerfTestGPU, CmpPerfTest, - Combine(Values(CMP_EQ, CMP_GE, CMP_NE, CMP_GT, CMP_LT, CMP_LE), - Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(CMP_EQ, CMP_GE, CMP_NE, CMP_GT, CMP_LT, CMP_LE), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(CmpWithScalarPerfTestGPU, CmpWithScalarPerfTest, - Combine(Values(AbsExact().to_compare_f()), - Values(CMP_EQ, CMP_GE, CMP_NE, CMP_GT, CMP_LT, CMP_LE), - Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(CMP_EQ, CMP_GE, CMP_NE, CMP_GT, CMP_LT, CMP_LE), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(BitwisePerfTestGPU, BitwisePerfTest, - Combine(Values(AND, OR, XOR), - testing::Bool(), - Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(AND, OR, XOR), + testing::Bool(), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(BitwiseNotPerfTestGPU, BitwiseNotPerfTest, - Combine(Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(SelectPerfTestGPU, SelectPerfTest, - Combine(Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(MinPerfTestGPU, MinPerfTest, - Combine(Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(MaxPerfTestGPU, MaxPerfTest, - Combine(Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(AbsDiffPerfTestGPU, AbsDiffPerfTest, - Combine(Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(AbsDiffCPerfTestGPU, AbsDiffCPerfTest, - Combine(Values(AbsExact().to_compare_f()), - Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(SumPerfTestGPU, SumPerfTest, - Combine(Values(AbsToleranceScalar(1e-5).to_compare_f()), - Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsToleranceScalar(1e-5).to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(CountNonZeroPerfTestGPU, CountNonZeroPerfTest, - Combine(Values(AbsToleranceScalar(0.0).to_compare_f()), - Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_16UC1, CV_16SC1, CV_32FC1), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsToleranceScalar(0.0).to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(AddWeightedPerfTestGPU, AddWeightedPerfTest, - Combine(Values(Tolerance_FloatRel_IntAbs(1e-6, 1).to_compare_f()), - Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), - Values( -1, CV_8U, CV_16U, CV_32F ), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(Tolerance_FloatRel_IntAbs(1e-6, 1).to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), + Values( -1, CV_8U, CV_16U, CV_32F ), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(NormPerfTestGPU, NormPerfTest, - Combine(Values(AbsToleranceScalar(1e-5).to_compare_f()), - Values(NORM_INF, NORM_L1, NORM_L2), - Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsToleranceScalar(1e-5).to_compare_f()), + Values(NORM_INF, NORM_L1, NORM_L2), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(IntegralPerfTestGPU, IntegralPerfTest, - Combine(Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_16UC1, CV_16SC1, CV_32FC1 ), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_16UC1, CV_16SC1, CV_32FC1 ), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(ThresholdPerfTestGPU, ThresholdPerfTest, - Combine(Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), - Values(cv::THRESH_BINARY, cv::THRESH_BINARY_INV, cv::THRESH_TRUNC, cv::THRESH_TOZERO, cv::THRESH_TOZERO_INV), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), + Values(cv::THRESH_BINARY, cv::THRESH_BINARY_INV, + cv::THRESH_TRUNC, cv::THRESH_TOZERO, cv::THRESH_TOZERO_INV), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(ThresholdPerfTestGPU, ThresholdOTPerfTest, - Combine(Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1 ), - Values(cv::THRESH_OTSU, cv::THRESH_TRIANGLE), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1 ), + Values(cv::THRESH_OTSU, cv::THRESH_TRIANGLE), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(InRangePerfTestGPU, InRangePerfTest, - Combine(Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1 ), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1 ), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(Split3PerfTestGPU, Split3PerfTest, - Combine(Values( szSmall128, szVGA, sz720p, sz1080p ), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(Split4PerfTestGPU, Split4PerfTest, - Combine(Values( szSmall128, szVGA, sz720p, sz1080p ), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(Merge3PerfTestGPU, Merge3PerfTest, - Combine(Values( szSmall128, szVGA, sz720p, sz1080p ), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(Merge4PerfTestGPU, Merge4PerfTest, - Combine(Values( szSmall128, szVGA, sz720p, sz1080p ), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(RemapPerfTestGPU, RemapPerfTest, - Combine(Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(FlipPerfTestGPU, FlipPerfTest, - Combine(Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), - Values(0,1,-1), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), + Values(0,1,-1), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(CropPerfTestGPU, CropPerfTest, - Combine(Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), - Values(cv::Rect(10, 8, 20, 35), cv::Rect(4, 10, 37, 50)), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), + Values(cv::Rect(10, 8, 20, 35), cv::Rect(4, 10, 37, 50)), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(ConcatHorPerfTestGPU, ConcatHorPerfTest, - Combine(Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(ConcatVertPerfTestGPU, ConcatVertPerfTest, - Combine(Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), + Values(cv::compile_args(CORE_GPU)))); -//TODO: fix this backend to allow ConcatVertVec ConcatHorVec -INSTANTIATE_TEST_CASE_P(DISABLED_ConcatHorVecPerfTestGPU, ConcatHorVecPerfTest, - Combine(Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), - Values(cv::compile_args(CORE_GPU)))); +INSTANTIATE_TEST_CASE_P(ConcatHorVecPerfTestGPU, ConcatHorVecPerfTest, + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1), + Values(cv::compile_args(CORE_GPU)))); - -INSTANTIATE_TEST_CASE_P(DISABLED_ConcatVertVecPerfTestGPU, ConcatVertVecPerfTest, - Combine(Values( szSmall128, szVGA, sz720p, sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), - Values(cv::compile_args(CORE_GPU)))); +INSTANTIATE_TEST_CASE_P(ConcatVertVecPerfTestGPU, ConcatVertVecPerfTest, + Combine(Values(AbsExact().to_compare_f()), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(LUTPerfTestGPU, LUTPerfTest, - Combine(Values(CV_8UC1, CV_8UC3), - Values(CV_8UC1), - Values( szSmall128, szVGA, sz720p, sz1080p ), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(CV_8UC1, CV_8UC3), + Values(CV_8UC1), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(LUTPerfTestCustomGPU, LUTPerfTest, - Combine(Values(CV_8UC3), - Values(CV_8UC3), - Values( szSmall128, szVGA, sz720p, sz1080p ), - Values(cv::compile_args(CORE_GPU)))); - + Combine(Values(AbsExact().to_compare_f()), + Values(CV_8UC3), + Values(CV_8UC3), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(ConvertToPerfTestGPU, ConvertToPerfTest, - Combine(Values(AbsExact().to_compare_f()), - Values(CV_8UC3, CV_8UC1, CV_16UC1, CV_32FC1), - Values(CV_8U, CV_16U, CV_16S, CV_32F), - Values( szSmall128, szVGA, sz720p, sz1080p ), - Values(2.5, 1.0), - Values(0.0), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(CV_8UC3, CV_8UC1, CV_16UC1, CV_32FC1), + Values(CV_8U, CV_16U, CV_16S, CV_32F), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values(2.5, 1.0), + Values(0.0), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(TransposePerfTestGPU, TransposePerfTest, - Combine(Values(AbsExact().to_compare_f()), - Values(szSmall128, szVGA, sz720p, sz1080p), - Values(CV_8UC1, CV_16UC1, CV_16SC1, CV_32FC1, - CV_8UC2, CV_16UC2, CV_16SC2, CV_32FC2, - CV_8UC3, CV_16UC3, CV_16SC3, CV_32FC3), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsExact().to_compare_f()), + Values(szSmall128, szVGA, sz720p, sz1080p), + Values(CV_8UC1, CV_16UC1, CV_16SC1, CV_32FC1, + CV_8UC2, CV_16UC2, CV_16SC2, CV_32FC2, + CV_8UC3, CV_16UC3, CV_16SC3, CV_32FC3), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(ResizePerfTestGPU, ResizePerfTest, - Combine(Values(AbsSimilarPoints(2, 0.05).to_compare_f()), - Values(CV_8UC1, CV_16UC1, CV_16SC1), - Values(cv::INTER_NEAREST, cv::INTER_LINEAR, cv::INTER_AREA), - Values( szSmall128, szVGA, sz720p, sz1080p ), - Values(cv::Size(64,64), - cv::Size(30,30)), - Values(cv::compile_args(CORE_GPU)))); + Combine(Values(AbsSimilarPoints(2, 0.05).to_compare_f()), + Values(CV_8UC1, CV_16UC1, CV_16SC1), + Values(cv::INTER_NEAREST, cv::INTER_LINEAR, cv::INTER_AREA), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values(cv::Size(64,64), + cv::Size(30,30)), + Values(cv::compile_args(CORE_GPU)))); INSTANTIATE_TEST_CASE_P(ResizeFxFyPerfTestGPU, ResizeFxFyPerfTest, - Combine(Values(AbsSimilarPoints(2, 0.05).to_compare_f()), - Values(CV_8UC1, CV_16UC1, CV_16SC1), - Values(cv::INTER_NEAREST, cv::INTER_LINEAR, cv::INTER_AREA), - Values( szSmall128, szVGA, sz720p, sz1080p ), - Values(0.5, 0.1), - Values(0.5, 0.1), - Values(cv::compile_args(CORE_GPU)))); -} + Combine(Values(AbsSimilarPoints(2, 0.05).to_compare_f()), + Values(CV_8UC1, CV_16UC1, CV_16SC1), + Values(cv::INTER_NEAREST, cv::INTER_LINEAR, cv::INTER_AREA), + Values( szSmall128, szVGA, sz720p, sz1080p ), + Values(0.5, 0.1), + Values(0.5, 0.1), + Values(cv::compile_args(CORE_GPU)))); +} // opencv_test