Commit c9bd43c0 authored by Andrey Golubev's avatar Andrey Golubev Committed by Alexander Alekhin

Merge pull request #14945 from andrey-golubev:delete_bool

G-API: clean up accuracy tests (#14945)

* Delete createOutputMatrices flag

Update the way compile args function is created

Fix instantiation suffix print function

* Update comment (NB)

* Make printable comparison functions

* Use defines instead of objects for compile args

* Remove custom printers, use operator<< overload

* Remove SAME_TYPE and use -1 instead

* Delete createOutputMatrices flag in new tests

* Fix GetParam() printed values

* Update Resize tests: use CompareF object

* Address code review feedback

* Add default cases for operator<< overloads

* change throw to GAPI_Assert
parent c11423df
...@@ -30,91 +30,37 @@ enum bitwiseOp ...@@ -30,91 +30,37 @@ enum bitwiseOp
NOT = 3 NOT = 3
}; };
namespace // Note: namespace must match the namespace of the type of the printed object
inline std::ostream& operator<<(std::ostream& os, mathOp op)
{ {
const char *MathOperations[] = {"ADD", "SUB", "MUL", "DIV"}; #define CASE(v) case mathOp::v: os << #v; break
const char *BitwiseOperations[] = {"And", "Or", "Xor"}; switch (op)
const char *CompareOperations[] = {"CMP_EQ", "CMP_GT", "CMP_GE", "CMP_LT", "CMP_LE", "CMP_NE"};
//corresponds to OpenCV
const char *NormOperations[] = {"", "NORM_INF", "NORM_L1", "","NORM_L2"};
}
struct PrintMathOpCoreParams
{
template <class TestParams>
std::string operator()(const ::testing::TestParamInfo<TestParams>& info) const
{
std::stringstream ss;
using AllParams = Params<mathOp,bool,double,bool>;
const AllParams::params_t& params = info.param;
cv::Size sz = AllParams::getCommon<1>(params); // size
ss<<MathOperations[AllParams::getSpecific<0>(params)] // mathOp
<<"_"<<AllParams::getSpecific<1>(params) // testWithScalar
<<"_"<<AllParams::getCommon<0>(params) // type
<<"_"<<(int)AllParams::getSpecific<2>(params) // scale
<<"_"<<sz.width
<<"x"<<sz.height
<<"_"<<(AllParams::getCommon<2>(params)+1) // dtype
<<"_"<<AllParams::getCommon<3>(params) // createOutputMatrices
<<"_"<<AllParams::getSpecific<3>(params); // doReverseOp
return ss.str();
}
};
struct PrintCmpCoreParams
{
template <class TestParams>
std::string operator()(const ::testing::TestParamInfo<TestParams>& info) const
{ {
std::stringstream ss; CASE(ADD);
using AllParams = Params<CmpTypes,bool>; CASE(SUB);
const AllParams::params_t& params = info.param; CASE(MUL);
cv::Size sz = AllParams::getCommon<1>(params); // size CASE(DIV);
ss<<CompareOperations[AllParams::getSpecific<0>(params)] // CmpType default: GAPI_Assert(false && "unknown mathOp value");
<<"_"<<AllParams::getSpecific<1>(params) // testWithScalar
<<"_"<<AllParams::getCommon<0>(params) // type
<<"_"<<sz.width
<<"x"<<sz.height
<<"_"<<AllParams::getCommon<3>(params); // createOutputMatrices
return ss.str();
} }
}; #undef CASE
return os;
struct PrintBWCoreParams }
{
template <class TestParams>
std::string operator()(const ::testing::TestParamInfo<TestParams>& info) const
{
std::stringstream ss;
using AllParams = Params<bitwiseOp>;
const AllParams::params_t& params = info.param;
cv::Size sz = AllParams::getCommon<1>(params); // size
ss<<BitwiseOperations[AllParams::getSpecific<0>(params)] // bitwiseOp
<<"_"<<AllParams::getCommon<0>(params) // type
<<"_"<<sz.width
<<"x"<<sz.height
<<"_"<<AllParams::getCommon<3>(params); // createOutputMatrices
return ss.str();
}
};
struct PrintNormCoreParams // Note: namespace must match the namespace of the type of the printed object
inline std::ostream& operator<<(std::ostream& os, bitwiseOp op)
{ {
template <class TestParams> #define CASE(v) case bitwiseOp::v: os << #v; break
std::string operator()(const ::testing::TestParamInfo<TestParams>& info) const switch (op)
{ {
std::stringstream ss; CASE(AND);
using AllParams = Params<compare_scalar_f,NormTypes>; CASE(OR);
const AllParams::params_t& params = info.param; CASE(XOR);
cv::Size sz = AllParams::getCommon<1>(params); // size CASE(NOT);
ss<<NormOperations[AllParams::getSpecific<1>(params)] // NormTypes default: GAPI_Assert(false && "unknown bitwiseOp value");
<<"_"<<AllParams::getCommon<0>(params) // type
<<"_"<<sz.width
<<"x"<<sz.height;
return ss.str();
} }
}; #undef CASE
return os;
}
GAPI_TEST_FIXTURE(MathOpTest, initMatsRandU, FIXTURE_API(mathOp,bool,double,bool), 4, GAPI_TEST_FIXTURE(MathOpTest, initMatsRandU, FIXTURE_API(mathOp,bool,double,bool), 4,
opType, testWithScalar, scale, doReverseOp) opType, testWithScalar, scale, doReverseOp)
...@@ -133,9 +79,9 @@ GAPI_TEST_FIXTURE(MinTest, initMatsRandU, <>, 0) ...@@ -133,9 +79,9 @@ GAPI_TEST_FIXTURE(MinTest, initMatsRandU, <>, 0)
GAPI_TEST_FIXTURE(MaxTest, initMatsRandU, <>, 0) GAPI_TEST_FIXTURE(MaxTest, initMatsRandU, <>, 0)
GAPI_TEST_FIXTURE(AbsDiffTest, initMatsRandU, <>, 0) GAPI_TEST_FIXTURE(AbsDiffTest, initMatsRandU, <>, 0)
GAPI_TEST_FIXTURE(AbsDiffCTest, initMatsRandU, <>, 0) GAPI_TEST_FIXTURE(AbsDiffCTest, initMatsRandU, <>, 0)
GAPI_TEST_FIXTURE(SumTest, initMatrixRandU, FIXTURE_API(compare_scalar_f), 1, cmpF) GAPI_TEST_FIXTURE(SumTest, initMatrixRandU, FIXTURE_API(CompareScalars), 1, cmpF)
GAPI_TEST_FIXTURE(AddWeightedTest, initMatsRandU, FIXTURE_API(compare_f), 1, cmpF) GAPI_TEST_FIXTURE(AddWeightedTest, initMatsRandU, FIXTURE_API(CompareMats), 1, cmpF)
GAPI_TEST_FIXTURE(NormTest, initMatrixRandU, FIXTURE_API(compare_scalar_f,NormTypes), 2, GAPI_TEST_FIXTURE(NormTest, initMatrixRandU, FIXTURE_API(CompareScalars,NormTypes), 2,
cmpF, opType) cmpF, opType)
GAPI_TEST_FIXTURE(IntegralTest, initNothing, <>, 0) GAPI_TEST_FIXTURE(IntegralTest, initNothing, <>, 0)
GAPI_TEST_FIXTURE(ThresholdTest, initMatrixRandU, FIXTURE_API(int), 1, tt) GAPI_TEST_FIXTURE(ThresholdTest, initMatrixRandU, FIXTURE_API(int), 1, tt)
...@@ -143,11 +89,11 @@ GAPI_TEST_FIXTURE(ThresholdOTTest, initMatrixRandU, FIXTURE_API(int), 1, tt) ...@@ -143,11 +89,11 @@ GAPI_TEST_FIXTURE(ThresholdOTTest, initMatrixRandU, FIXTURE_API(int), 1, tt)
GAPI_TEST_FIXTURE(InRangeTest, initMatrixRandU, <>, 0) GAPI_TEST_FIXTURE(InRangeTest, initMatrixRandU, <>, 0)
GAPI_TEST_FIXTURE(Split3Test, initMatrixRandU, <>, 0) GAPI_TEST_FIXTURE(Split3Test, initMatrixRandU, <>, 0)
GAPI_TEST_FIXTURE(Split4Test, initMatrixRandU, <>, 0) GAPI_TEST_FIXTURE(Split4Test, initMatrixRandU, <>, 0)
GAPI_TEST_FIXTURE(ResizeTest, initNothing, FIXTURE_API(compare_f,int,cv::Size), 3, GAPI_TEST_FIXTURE(ResizeTest, initNothing, FIXTURE_API(CompareMats,int,cv::Size), 3,
cmpF, interp, sz_out) cmpF, interp, sz_out)
GAPI_TEST_FIXTURE(ResizePTest, initNothing, FIXTURE_API(compare_f,int,cv::Size), 3, GAPI_TEST_FIXTURE(ResizePTest, initNothing, FIXTURE_API(CompareMats,int,cv::Size), 3,
cmpF, interp, sz_out) cmpF, interp, sz_out)
GAPI_TEST_FIXTURE(ResizeTestFxFy, initNothing, FIXTURE_API(compare_f,int,double,double), 4, GAPI_TEST_FIXTURE(ResizeTestFxFy, initNothing, FIXTURE_API(CompareMats,int,double,double), 4,
cmpF, interp, fx, fy) cmpF, interp, fx, fy)
GAPI_TEST_FIXTURE(Merge3Test, initMatsRandU, <>, 0) GAPI_TEST_FIXTURE(Merge3Test, initMatsRandU, <>, 0)
GAPI_TEST_FIXTURE(Merge4Test, initMatsRandU, <>, 0) GAPI_TEST_FIXTURE(Merge4Test, initMatsRandU, <>, 0)
...@@ -159,11 +105,11 @@ GAPI_TEST_FIXTURE(ConcatVertTest, initNothing, <>, 0) ...@@ -159,11 +105,11 @@ GAPI_TEST_FIXTURE(ConcatVertTest, initNothing, <>, 0)
GAPI_TEST_FIXTURE(ConcatVertVecTest, initNothing, <>, 0) GAPI_TEST_FIXTURE(ConcatVertVecTest, initNothing, <>, 0)
GAPI_TEST_FIXTURE(ConcatHorVecTest, initNothing, <>, 0) GAPI_TEST_FIXTURE(ConcatHorVecTest, initNothing, <>, 0)
GAPI_TEST_FIXTURE(LUTTest, initNothing, <>, 0) GAPI_TEST_FIXTURE(LUTTest, initNothing, <>, 0)
GAPI_TEST_FIXTURE(ConvertToTest, initNothing, FIXTURE_API(compare_f, double, double), 3, GAPI_TEST_FIXTURE(ConvertToTest, initNothing, FIXTURE_API(CompareMats, double, double), 3,
cmpF, alpha, beta) cmpF, alpha, beta)
GAPI_TEST_FIXTURE(PhaseTest, initMatsRandU, FIXTURE_API(bool), 1, angle_in_degrees) GAPI_TEST_FIXTURE(PhaseTest, initMatsRandU, FIXTURE_API(bool), 1, angle_in_degrees)
GAPI_TEST_FIXTURE(SqrtTest, initMatrixRandU, <>, 0) GAPI_TEST_FIXTURE(SqrtTest, initMatrixRandU, <>, 0)
GAPI_TEST_FIXTURE(NormalizeTest, initNothing, FIXTURE_API(compare_f,double,double,int,MatType), 5, GAPI_TEST_FIXTURE(NormalizeTest, initNothing, FIXTURE_API(CompareMats,double,double,int,MatType2), 5,
cmpF, a, b, norm_type, ddepth) cmpF, a, b, norm_type, ddepth)
struct BackendOutputAllocationTest : TestWithParamBase<> struct BackendOutputAllocationTest : TestWithParamBase<>
{ {
......
...@@ -269,7 +269,7 @@ TEST_P(Polar2CartTest, AccuracyTest) ...@@ -269,7 +269,7 @@ TEST_P(Polar2CartTest, AccuracyTest)
{ {
cv::Mat out_mat2; cv::Mat out_mat2;
cv::Mat out_mat_ocv2; cv::Mat out_mat_ocv2;
if(createOutputMatrices) if (dtype != -1)
{ {
out_mat2 = cv::Mat(sz, dtype); out_mat2 = cv::Mat(sz, dtype);
out_mat_ocv2 = cv::Mat(sz, dtype); out_mat_ocv2 = cv::Mat(sz, dtype);
...@@ -808,7 +808,8 @@ TEST_P(Split4Test, AccuracyTest) ...@@ -808,7 +808,8 @@ TEST_P(Split4Test, AccuracyTest)
} }
} }
static void ResizeAccuracyTest(compare_f cmpF, int type, int interp, cv::Size sz_in, cv::Size sz_out, double fx, double fy, cv::GCompileArgs&& compile_args) static void ResizeAccuracyTest(const CompareMats& cmpF, int type, int interp, cv::Size sz_in,
cv::Size sz_out, double fx, double fy, cv::GCompileArgs&& compile_args)
{ {
cv::Mat in_mat1 (sz_in, type ); cv::Mat in_mat1 (sz_in, type );
cv::Scalar mean = cv::Scalar::all(127); cv::Scalar mean = cv::Scalar::all(127);
...@@ -978,7 +979,7 @@ TEST_P(FlipTest, AccuracyTest) ...@@ -978,7 +979,7 @@ TEST_P(FlipTest, AccuracyTest)
TEST_P(CropTest, AccuracyTest) TEST_P(CropTest, AccuracyTest)
{ {
cv::Size sz_out = cv::Size(rect_to.width, rect_to.height); cv::Size sz_out = cv::Size(rect_to.width, rect_to.height);
if(createOutputMatrices) if (dtype != -1)
{ {
out_mat_gapi = cv::Mat(sz_out, dtype); out_mat_gapi = cv::Mat(sz_out, dtype);
out_mat_ocv = cv::Mat(sz_out, dtype); out_mat_ocv = cv::Mat(sz_out, dtype);
...@@ -1247,7 +1248,7 @@ TEST_P(SqrtTest, AccuracyTest) ...@@ -1247,7 +1248,7 @@ TEST_P(SqrtTest, AccuracyTest)
TEST_P(NormalizeTest, Test) TEST_P(NormalizeTest, Test)
{ {
initMatrixRandN(type, sz, CV_MAKETYPE(ddepth, CV_MAT_CN(type)), createOutputMatrices); initMatrixRandN(type, sz, CV_MAKETYPE(ddepth, CV_MAT_CN(type)));
// G-API code ////////////////////////////////////////////////////////////// // G-API code //////////////////////////////////////////////////////////////
cv::GMat in; cv::GMat in;
......
...@@ -14,45 +14,45 @@ ...@@ -14,45 +14,45 @@
namespace opencv_test namespace opencv_test
{ {
GAPI_TEST_FIXTURE(Filter2DTest, initMatrixRandN, FIXTURE_API(compare_f,int,int), 3, GAPI_TEST_FIXTURE(Filter2DTest, initMatrixRandN, FIXTURE_API(CompareMats,int,int), 3,
cmpF, kernSize, borderType) cmpF, kernSize, borderType)
GAPI_TEST_FIXTURE(BoxFilterTest, initMatrixRandN, FIXTURE_API(compare_f,int,int), 3, GAPI_TEST_FIXTURE(BoxFilterTest, initMatrixRandN, FIXTURE_API(CompareMats,int,int), 3,
cmpF, filterSize, borderType) cmpF, filterSize, borderType)
GAPI_TEST_FIXTURE(SepFilterTest, initMatrixRandN, FIXTURE_API(compare_f,int), 2, cmpF, kernSize) GAPI_TEST_FIXTURE(SepFilterTest, initMatrixRandN, FIXTURE_API(CompareMats,int), 2, cmpF, kernSize)
GAPI_TEST_FIXTURE(BlurTest, initMatrixRandN, FIXTURE_API(compare_f,int,int), 3, GAPI_TEST_FIXTURE(BlurTest, initMatrixRandN, FIXTURE_API(CompareMats,int,int), 3,
cmpF, filterSize, borderType) cmpF, filterSize, borderType)
GAPI_TEST_FIXTURE(GaussianBlurTest, initMatrixRandN, FIXTURE_API(compare_f,int), 2, cmpF, kernSize) GAPI_TEST_FIXTURE(GaussianBlurTest, initMatrixRandN, FIXTURE_API(CompareMats,int), 2, cmpF, kernSize)
GAPI_TEST_FIXTURE(MedianBlurTest, initMatrixRandN, FIXTURE_API(compare_f,int), 2, cmpF, kernSize) GAPI_TEST_FIXTURE(MedianBlurTest, initMatrixRandN, FIXTURE_API(CompareMats,int), 2, cmpF, kernSize)
GAPI_TEST_FIXTURE(ErodeTest, initMatrixRandN, FIXTURE_API(compare_f,int,int), 3, GAPI_TEST_FIXTURE(ErodeTest, initMatrixRandN, FIXTURE_API(CompareMats,int,int), 3,
cmpF, kernSize, kernType) cmpF, kernSize, kernType)
GAPI_TEST_FIXTURE(Erode3x3Test, initMatrixRandN, FIXTURE_API(compare_f,int), 2, GAPI_TEST_FIXTURE(Erode3x3Test, initMatrixRandN, FIXTURE_API(CompareMats,int), 2,
cmpF, numIters) cmpF, numIters)
GAPI_TEST_FIXTURE(DilateTest, initMatrixRandN, FIXTURE_API(compare_f,int,int), 3, GAPI_TEST_FIXTURE(DilateTest, initMatrixRandN, FIXTURE_API(CompareMats,int,int), 3,
cmpF, kernSize, kernType) cmpF, kernSize, kernType)
GAPI_TEST_FIXTURE(Dilate3x3Test, initMatrixRandN, FIXTURE_API(compare_f,int), 2, cmpF, numIters) GAPI_TEST_FIXTURE(Dilate3x3Test, initMatrixRandN, FIXTURE_API(CompareMats,int), 2, cmpF, numIters)
GAPI_TEST_FIXTURE(SobelTest, initMatrixRandN, FIXTURE_API(compare_f,int,int,int), 4, GAPI_TEST_FIXTURE(SobelTest, initMatrixRandN, FIXTURE_API(CompareMats,int,int,int), 4,
cmpF, kernSize, dx, dy) cmpF, kernSize, dx, dy)
GAPI_TEST_FIXTURE(SobelXYTest, initMatrixRandN, FIXTURE_API(compare_f,int,int,int,int), 5, GAPI_TEST_FIXTURE(SobelXYTest, initMatrixRandN, FIXTURE_API(CompareMats,int,int,int,int), 5,
cmpF, kernSize, order, border_type, border_val) cmpF, kernSize, order, border_type, border_val)
GAPI_TEST_FIXTURE(EqHistTest, initMatrixRandN, FIXTURE_API(compare_f), 1, cmpF) GAPI_TEST_FIXTURE(EqHistTest, initMatrixRandN, FIXTURE_API(CompareMats), 1, cmpF)
GAPI_TEST_FIXTURE(CannyTest, initMatrixRandN, FIXTURE_API(compare_f,double,double,int,bool), 5, GAPI_TEST_FIXTURE(CannyTest, initMatrixRandN, FIXTURE_API(CompareMats,double,double,int,bool), 5,
cmpF, thrLow, thrUp, apSize, l2gr) cmpF, thrLow, thrUp, apSize, l2gr)
GAPI_TEST_FIXTURE(RGB2GrayTest, initMatrixRandN, FIXTURE_API(compare_f), 1, cmpF) GAPI_TEST_FIXTURE(RGB2GrayTest, initMatrixRandN, FIXTURE_API(CompareMats), 1, cmpF)
GAPI_TEST_FIXTURE(BGR2GrayTest, initMatrixRandN, FIXTURE_API(compare_f), 1, cmpF) GAPI_TEST_FIXTURE(BGR2GrayTest, initMatrixRandN, FIXTURE_API(CompareMats), 1, cmpF)
GAPI_TEST_FIXTURE(RGB2YUVTest, initMatrixRandN, FIXTURE_API(compare_f), 1, cmpF) GAPI_TEST_FIXTURE(RGB2YUVTest, initMatrixRandN, FIXTURE_API(CompareMats), 1, cmpF)
GAPI_TEST_FIXTURE(YUV2RGBTest, initMatrixRandN, FIXTURE_API(compare_f), 1, cmpF) GAPI_TEST_FIXTURE(YUV2RGBTest, initMatrixRandN, FIXTURE_API(CompareMats), 1, cmpF)
GAPI_TEST_FIXTURE(NV12toRGBTest, initMatrixRandN, FIXTURE_API(compare_f), 1, cmpF) GAPI_TEST_FIXTURE(NV12toRGBTest, initMatrixRandN, FIXTURE_API(CompareMats), 1, cmpF)
GAPI_TEST_FIXTURE(NV12toBGRpTest, initMatrixRandN, FIXTURE_API(compare_f), 1, cmpF) GAPI_TEST_FIXTURE(NV12toBGRpTest, initMatrixRandN, FIXTURE_API(CompareMats), 1, cmpF)
GAPI_TEST_FIXTURE(NV12toRGBpTest, initMatrixRandN, FIXTURE_API(compare_f), 1, cmpF) GAPI_TEST_FIXTURE(NV12toRGBpTest, initMatrixRandN, FIXTURE_API(CompareMats), 1, cmpF)
GAPI_TEST_FIXTURE(NV12toBGRTest, initMatrixRandN, FIXTURE_API(compare_f), 1, cmpF) GAPI_TEST_FIXTURE(NV12toBGRTest, initMatrixRandN, FIXTURE_API(CompareMats), 1, cmpF)
GAPI_TEST_FIXTURE(RGB2LabTest, initMatrixRandN, FIXTURE_API(compare_f), 1, cmpF) GAPI_TEST_FIXTURE(RGB2LabTest, initMatrixRandN, FIXTURE_API(CompareMats), 1, cmpF)
GAPI_TEST_FIXTURE(BGR2LUVTest, initMatrixRandN, FIXTURE_API(compare_f), 1, cmpF) GAPI_TEST_FIXTURE(BGR2LUVTest, initMatrixRandN, FIXTURE_API(CompareMats), 1, cmpF)
GAPI_TEST_FIXTURE(LUV2BGRTest, initMatrixRandN, FIXTURE_API(compare_f), 1, cmpF) GAPI_TEST_FIXTURE(LUV2BGRTest, initMatrixRandN, FIXTURE_API(CompareMats), 1, cmpF)
GAPI_TEST_FIXTURE(BGR2YUVTest, initMatrixRandN, FIXTURE_API(compare_f), 1, cmpF) GAPI_TEST_FIXTURE(BGR2YUVTest, initMatrixRandN, FIXTURE_API(CompareMats), 1, cmpF)
GAPI_TEST_FIXTURE(YUV2BGRTest, initMatrixRandN, FIXTURE_API(compare_f), 1, cmpF) GAPI_TEST_FIXTURE(YUV2BGRTest, initMatrixRandN, FIXTURE_API(CompareMats), 1, cmpF)
GAPI_TEST_FIXTURE(RGB2HSVTest, initMatrixRandN, FIXTURE_API(compare_f), 1, cmpF) GAPI_TEST_FIXTURE(RGB2HSVTest, initMatrixRandN, FIXTURE_API(CompareMats), 1, cmpF)
GAPI_TEST_FIXTURE(BayerGR2RGBTest, initMatrixRandN, FIXTURE_API(compare_f), 1, cmpF) GAPI_TEST_FIXTURE(BayerGR2RGBTest, initMatrixRandN, FIXTURE_API(CompareMats), 1, cmpF)
GAPI_TEST_FIXTURE(RGB2YUV422Test, initMatrixRandN, FIXTURE_API(compare_f), 1, cmpF) GAPI_TEST_FIXTURE(RGB2YUV422Test, initMatrixRandN, FIXTURE_API(CompareMats), 1, cmpF)
} // opencv_test } // opencv_test
#endif //OPENCV_GAPI_IMGPROC_TESTS_HPP #endif //OPENCV_GAPI_IMGPROC_TESTS_HPP
...@@ -185,9 +185,9 @@ g_api_ocv_pair_mat_mat opXor = {std::string{"operator^"}, ...@@ -185,9 +185,9 @@ g_api_ocv_pair_mat_mat opXor = {std::string{"operator^"},
} // anonymous namespace } // anonymous namespace
GAPI_TEST_FIXTURE(MathOperatorMatScalarTest, initMatsRandU, GAPI_TEST_FIXTURE(MathOperatorMatScalarTest, initMatsRandU,
FIXTURE_API(compare_f, g_api_ocv_pair_mat_scalar), 2, cmpF, op) FIXTURE_API(CompareMats, g_api_ocv_pair_mat_scalar), 2, cmpF, op)
GAPI_TEST_FIXTURE(MathOperatorMatMatTest, initMatsRandU, GAPI_TEST_FIXTURE(MathOperatorMatMatTest, initMatsRandU,
FIXTURE_API(compare_f, g_api_ocv_pair_mat_mat), 2, cmpF, op) FIXTURE_API(CompareMats, g_api_ocv_pair_mat_mat), 2, cmpF, op)
GAPI_TEST_FIXTURE(NotOperatorTest, initMatrixRandU, <>, 0) GAPI_TEST_FIXTURE(NotOperatorTest, initMatrixRandU, <>, 0)
} // opencv_test } // opencv_test
......
...@@ -132,15 +132,33 @@ using compare_f = std::function<bool(const cv::Mat &a, const cv::Mat &b)>; ...@@ -132,15 +132,33 @@ using compare_f = std::function<bool(const cv::Mat &a, const cv::Mat &b)>;
using compare_scalar_f = std::function<bool(const cv::Scalar &a, const cv::Scalar &b)>; using compare_scalar_f = std::function<bool(const cv::Scalar &a, const cv::Scalar &b)>;
// FIXME: re-use MatType. current problem: "special values" interpreted incorrectly (-1 is printed
// as 16FC512)
struct MatType2
{
public:
MatType2(int val = 0) : _value(val) {}
operator int() const { return _value; }
friend std::ostream& operator<<(std::ostream& os, const MatType2& t)
{
switch (t)
{
case -1: return os << "SAME_TYPE";
default: PrintTo(MatType(t), &os); return os;
}
}
private:
int _value;
};
// Universal parameter wrapper for common (pre-defined) and specific (user-defined) parameters // Universal parameter wrapper for common (pre-defined) and specific (user-defined) parameters
template<typename ...SpecificParams> template<typename ...SpecificParams>
struct Params struct Params
{ {
using gcomp_args_function_t = cv::GCompileArgs(*)(); using gcomp_args_function_t = cv::GCompileArgs(*)();
// TODO: delete bool (createOutputMatrices) from common parameters using common_params_t = std::tuple<MatType2, cv::Size, MatType2, gcomp_args_function_t>;
using common_params_t = std::tuple<int, cv::Size, int, bool, gcomp_args_function_t>;
using specific_params_t = std::tuple<SpecificParams...>; using specific_params_t = std::tuple<SpecificParams...>;
using params_t = std::tuple<int, cv::Size, int, bool, gcomp_args_function_t, SpecificParams...>; using params_t = std::tuple<MatType2, cv::Size, MatType2, gcomp_args_function_t, SpecificParams...>;
static constexpr const size_t common_params_size = std::tuple_size<common_params_t>::value; static constexpr const size_t common_params_size = std::tuple_size<common_params_t>::value;
static constexpr const size_t specific_params_size = std::tuple_size<specific_params_t>::value; static constexpr const size_t specific_params_size = std::tuple_size<specific_params_t>::value;
...@@ -170,15 +188,9 @@ struct TestWithParamBase : TestFunctional, ...@@ -170,15 +188,9 @@ struct TestWithParamBase : TestFunctional,
{ {
using AllParams = Params<SpecificParams...>; using AllParams = Params<SpecificParams...>;
MatType type = getCommonParam<0>(); MatType2 type = getCommonParam<0>();
cv::Size sz = getCommonParam<1>(); cv::Size sz = getCommonParam<1>();
MatType dtype = getCommonParam<2>(); MatType2 dtype = getCommonParam<2>();
bool createOutputMatrices = getCommonParam<3>();
TestWithParamBase()
{
if (dtype == SAME_TYPE) { dtype = type; }
}
// Get common (pre-defined) parameter value by index // Get common (pre-defined) parameter value by index
template<size_t I> template<size_t I>
...@@ -199,7 +211,7 @@ struct TestWithParamBase : TestFunctional, ...@@ -199,7 +211,7 @@ struct TestWithParamBase : TestFunctional,
// Return G-API compile arguments specified for test fixture // Return G-API compile arguments specified for test fixture
inline cv::GCompileArgs getCompileArgs() const inline cv::GCompileArgs getCompileArgs() const
{ {
return getCommonParam<4>()(); return getCommonParam<3>()();
} }
}; };
...@@ -220,13 +232,35 @@ struct TestWithParamBase : TestFunctional, ...@@ -220,13 +232,35 @@ struct TestWithParamBase : TestFunctional,
static_assert(Number == AllParams::specific_params_size, \ static_assert(Number == AllParams::specific_params_size, \
"Number of user-defined parameters doesn't match size of __VA_ARGS__"); \ "Number of user-defined parameters doesn't match size of __VA_ARGS__"); \
__WRAP_VAARGS(DEFINE_SPECIFIC_PARAMS_##Number(__VA_ARGS__)) \ __WRAP_VAARGS(DEFINE_SPECIFIC_PARAMS_##Number(__VA_ARGS__)) \
Fixture() { InitF(type, sz, dtype, createOutputMatrices); } \ Fixture() { InitF(type, sz, dtype); } \
}; };
// Wrapper for test fixture API. Use to specify multiple types. // Wrapper for test fixture API. Use to specify multiple types.
// Example: FIXTURE_API(int, bool) expands to <int, bool> // Example: FIXTURE_API(int, bool) expands to <int, bool>
#define FIXTURE_API(...) <__VA_ARGS__> #define FIXTURE_API(...) <__VA_ARGS__>
template<typename T1, typename T2>
struct CompareF
{
using callable_t = std::function<bool(const T1& a, const T2& b)>;
CompareF(callable_t&& cmp, std::string&& cmp_name) :
_comparator(std::move(cmp)), _name(std::move(cmp_name)) {}
bool operator()(const T1& a, const T2& b) const
{
return _comparator(a, b);
}
friend std::ostream& operator<<(std::ostream& os, const CompareF<T1, T2>& obj)
{
return os << obj._name;
}
private:
callable_t _comparator;
std::string _name;
};
using CompareMats = CompareF<cv::Mat, cv::Mat>;
using CompareScalars = CompareF<cv::Scalar, cv::Scalar>;
template<typename T> template<typename T>
struct Wrappable struct Wrappable
{ {
...@@ -238,6 +272,14 @@ struct Wrappable ...@@ -238,6 +272,14 @@ struct Wrappable
return t(a, b); return t(a, b);
}; };
} }
CompareMats to_compare_obj()
{
T t = *static_cast<T*const>(this);
std::stringstream ss;
ss << t;
return CompareMats(to_compare_f(), ss.str());
}
}; };
template<typename T> template<typename T>
...@@ -251,6 +293,14 @@ struct WrappableScalar ...@@ -251,6 +293,14 @@ struct WrappableScalar
return t(a, b); return t(a, b);
}; };
} }
CompareScalars to_compare_obj()
{
T t = *static_cast<T*const>(this);
std::stringstream ss;
ss << t;
return CompareScalars(to_compare_f(), ss.str());
}
}; };
...@@ -270,7 +320,10 @@ public: ...@@ -270,7 +320,10 @@ public:
return true; return true;
} }
} }
private: friend std::ostream& operator<<(std::ostream& os, const AbsExact&)
{
return os << "AbsExact()";
}
}; };
class AbsTolerance : public Wrappable<AbsTolerance> class AbsTolerance : public Wrappable<AbsTolerance>
...@@ -290,6 +343,10 @@ public: ...@@ -290,6 +343,10 @@ public:
return true; return true;
} }
} }
friend std::ostream& operator<<(std::ostream& os, const AbsTolerance& obj)
{
return os << "AbsTolerance(" << std::to_string(obj._tol) << ")";
}
private: private:
double _tol; double _tol;
}; };
...@@ -318,6 +375,10 @@ public: ...@@ -318,6 +375,10 @@ public:
} }
} }
} }
friend std::ostream& operator<<(std::ostream& os, const Tolerance_FloatRel_IntAbs& obj)
{
return os << "Tolerance_FloatRel_IntAbs(" << obj._tol << ", " << obj._tol8u << ")";
}
private: private:
double _tol; double _tol;
double _tol8u; double _tol8u;
...@@ -347,6 +408,10 @@ public: ...@@ -347,6 +408,10 @@ public:
return true; return true;
} }
} }
friend std::ostream& operator<<(std::ostream& os, const AbsSimilarPoints& obj)
{
return os << "AbsSimilarPoints(" << obj._tol << ", " << obj._percent << ")";
}
private: private:
double _tol; double _tol;
double _percent; double _percent;
...@@ -379,6 +444,11 @@ public: ...@@ -379,6 +444,11 @@ public:
} }
return true; return true;
} }
friend std::ostream& operator<<(std::ostream& os, const ToleranceFilter& obj)
{
return os << "ToleranceFilter(" << obj._tol << ", " << obj._tol8u << ", "
<< obj._inf_tol << ")";
}
private: private:
double _tol; double _tol;
double _tol8u; double _tol8u;
...@@ -407,6 +477,10 @@ public: ...@@ -407,6 +477,10 @@ public:
} }
return true; return true;
} }
friend std::ostream& operator<<(std::ostream& os, const ToleranceColor& obj)
{
return os << "ToleranceColor(" << obj._tol << ", " << obj._inf_tol << ")";
}
private: private:
double _tol; double _tol;
double _inf_tol; double _inf_tol;
...@@ -429,26 +503,66 @@ public: ...@@ -429,26 +503,66 @@ public:
return true; return true;
} }
} }
friend std::ostream& operator<<(std::ostream& os, const AbsToleranceScalar& obj)
{
return os << "AbsToleranceScalar(" << std::to_string(obj._tol) << ")";
}
private: private:
double _tol; double _tol;
}; };
} // namespace opencv_test } // namespace opencv_test
namespace namespace
{ {
inline std::ostream& operator<<(std::ostream& os, const opencv_test::compare_f&) inline std::ostream& operator<<(std::ostream& os, const opencv_test::compare_f&)
{ {
return os << "compare_f"; return os << "compare_f";
}
} }
namespace inline std::ostream& operator<<(std::ostream& os, const opencv_test::compare_scalar_f&)
{ {
inline std::ostream& operator<<(std::ostream& os, const opencv_test::compare_scalar_f&)
{
return os << "compare_scalar_f"; return os << "compare_scalar_f";
}
} }
} // anonymous namespace
// Note: namespace must match the namespace of the type of the printed object
namespace cv
{
inline std::ostream& operator<<(std::ostream& os, CmpTypes op)
{
#define CASE(v) case CmpTypes::v: os << #v; break
switch (op)
{
CASE(CMP_EQ);
CASE(CMP_GT);
CASE(CMP_GE);
CASE(CMP_LT);
CASE(CMP_LE);
CASE(CMP_NE);
default: GAPI_Assert(false && "unknown CmpTypes value");
}
#undef CASE
return os;
}
inline std::ostream& operator<<(std::ostream& os, NormTypes op)
{
#define CASE(v) case NormTypes::v: os << #v; break
switch (op)
{
CASE(NORM_INF);
CASE(NORM_L1);
CASE(NORM_L2);
CASE(NORM_L2SQR);
CASE(NORM_HAMMING);
CASE(NORM_HAMMING2);
CASE(NORM_RELATIVE);
CASE(NORM_MINMAX);
default: GAPI_Assert(false && "unknown NormTypes value");
}
#undef CASE
return os;
}
} // namespace cv
#endif //OPENCV_GAPI_TESTS_COMMON_HPP #endif //OPENCV_GAPI_TESTS_COMMON_HPP
...@@ -13,12 +13,6 @@ ...@@ -13,12 +13,6 @@
namespace opencv_test namespace opencv_test
{ {
// out_type == in_type in matrices initialization if out_type is marked as SAME_TYPE
enum {
// TODO: why is it different from -1?
SAME_TYPE = std::numeric_limits<int>::max()
};
// Ensure correct __VA_ARGS__ expansion on Windows // Ensure correct __VA_ARGS__ expansion on Windows
#define __WRAP_VAARGS(x) x #define __WRAP_VAARGS(x) x
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
namespace namespace
{ {
#define CORE_CPU [] () { return cv::compile_args(cv::gapi::core::cpu::kernels()); } #define CORE_CPU [] () { return cv::compile_args(cv::gapi::core::cpu::kernels()); }
} // anonymous namespace } // anonymous namespace
namespace opencv_test namespace opencv_test
...@@ -24,9 +24,8 @@ INSTANTIATE_TEST_CASE_P(MathOperatorTestCPU, MathOperatorMatMatTest, ...@@ -24,9 +24,8 @@ INSTANTIATE_TEST_CASE_P(MathOperatorTestCPU, MathOperatorMatMatTest,
cv::Size(640, 480), cv::Size(640, 480),
cv::Size(128, 128)), cv::Size(128, 128)),
Values(-1, CV_8U, CV_32F), Values(-1, CV_8U, CV_32F),
testing::Bool(),
Values(CORE_CPU), Values(CORE_CPU),
Values(AbsExact().to_compare_f()), Values(AbsExact().to_compare_obj()),
Values( opPlusM, opMinusM, opDivM, Values( opPlusM, opMinusM, opDivM,
opGreater, opLess, opGreaterEq, opLessEq, opEq, opNotEq))); opGreater, opLess, opGreaterEq, opLessEq, opEq, opNotEq)));
...@@ -36,9 +35,8 @@ INSTANTIATE_TEST_CASE_P(MathOperatorTestCPU, MathOperatorMatScalarTest, ...@@ -36,9 +35,8 @@ INSTANTIATE_TEST_CASE_P(MathOperatorTestCPU, MathOperatorMatScalarTest,
cv::Size(640, 480), cv::Size(640, 480),
cv::Size(128, 128)), cv::Size(128, 128)),
Values(-1, CV_8U, CV_32F), Values(-1, CV_8U, CV_32F),
/*init output matrices or not*/ testing::Bool(),
Values(CORE_CPU), Values(CORE_CPU),
Values(AbsExact().to_compare_f()), Values(AbsExact().to_compare_obj()),
Values( opPlus, opPlusR, opMinus, opMinusR, opMul, opMulR, // FIXIT avoid division by values near zero: opDiv, opDivR, Values( opPlus, opPlusR, opMinus, opMinusR, opMul, opMulR, // FIXIT avoid division by values near zero: opDiv, opDivR,
opGT, opLT, opGE, opLE, opEQ, opNE, opGT, opLT, opGE, opLE, opEQ, opNE,
opGTR, opLTR, opGER, opLER, opEQR, opNER))); opGTR, opLTR, opGER, opLER, opEQR, opNER)));
...@@ -49,9 +47,8 @@ INSTANTIATE_TEST_CASE_P(BitwiseOperatorTestCPU, MathOperatorMatMatTest, ...@@ -49,9 +47,8 @@ INSTANTIATE_TEST_CASE_P(BitwiseOperatorTestCPU, MathOperatorMatMatTest,
cv::Size(640, 480), cv::Size(640, 480),
cv::Size(128, 128)), cv::Size(128, 128)),
Values(-1), Values(-1),
/*init output matrices or not*/ testing::Bool(),
Values(CORE_CPU), Values(CORE_CPU),
Values(AbsExact().to_compare_f()), Values(AbsExact().to_compare_obj()),
Values( opAnd, opOr, opXor ))); Values( opAnd, opOr, opXor )));
INSTANTIATE_TEST_CASE_P(BitwiseOperatorTestCPU, MathOperatorMatScalarTest, INSTANTIATE_TEST_CASE_P(BitwiseOperatorTestCPU, MathOperatorMatScalarTest,
...@@ -60,9 +57,8 @@ INSTANTIATE_TEST_CASE_P(BitwiseOperatorTestCPU, MathOperatorMatScalarTest, ...@@ -60,9 +57,8 @@ INSTANTIATE_TEST_CASE_P(BitwiseOperatorTestCPU, MathOperatorMatScalarTest,
cv::Size(640, 480), cv::Size(640, 480),
cv::Size(128, 128)), cv::Size(128, 128)),
Values(-1), Values(-1),
/*init output matrices or not*/ testing::Bool(),
Values(CORE_CPU), Values(CORE_CPU),
Values(AbsExact().to_compare_f()), Values(AbsExact().to_compare_obj()),
Values( opAND, opOR, opXOR, opANDR, opORR, opXORR ))); Values( opAND, opOR, opXOR, opANDR, opORR, opXORR )));
INSTANTIATE_TEST_CASE_P(BitwiseNotOperatorTestCPU, NotOperatorTest, INSTANTIATE_TEST_CASE_P(BitwiseNotOperatorTestCPU, NotOperatorTest,
...@@ -70,7 +66,6 @@ INSTANTIATE_TEST_CASE_P(BitwiseNotOperatorTestCPU, NotOperatorTest, ...@@ -70,7 +66,6 @@ INSTANTIATE_TEST_CASE_P(BitwiseNotOperatorTestCPU, NotOperatorTest,
Values(cv::Size(1280, 720), Values(cv::Size(1280, 720),
cv::Size(640, 480), cv::Size(640, 480),
cv::Size(128, 128)), cv::Size(128, 128)),
Values(SAME_TYPE), Values(-1),
/*init output matrices or not*/ testing::Bool(),
Values(CORE_CPU))); Values(CORE_CPU)));
} }
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
namespace namespace
{ {
#define CORE_FLUID [] () { return cv::compile_args(cv::gapi::core::fluid::kernels()); } #define CORE_FLUID [] () { return cv::compile_args(cv::gapi::core::fluid::kernels()); }
} // anonymous namespace } // anonymous namespace
namespace opencv_test namespace opencv_test
...@@ -22,9 +22,8 @@ INSTANTIATE_TEST_CASE_P(MathOperatorTestFluid, MathOperatorMatMatTest, ...@@ -22,9 +22,8 @@ INSTANTIATE_TEST_CASE_P(MathOperatorTestFluid, MathOperatorMatMatTest,
cv::Size(640, 480), cv::Size(640, 480),
cv::Size(128, 128)), cv::Size(128, 128)),
Values(-1, CV_8U, CV_32F), Values(-1, CV_8U, CV_32F),
/*init output matrices or not*/ testing::Bool(),
Values(CORE_FLUID), Values(CORE_FLUID),
Values(AbsExact().to_compare_f()), Values(AbsExact().to_compare_obj()),
Values( opPlusM, opMinusM, opDivM, Values( opPlusM, opMinusM, opDivM,
opGreater, opLess, opGreaterEq, opLessEq, opEq, opNotEq))); opGreater, opLess, opGreaterEq, opLessEq, opEq, opNotEq)));
...@@ -35,9 +34,8 @@ INSTANTIATE_TEST_CASE_P(DISABLED_MathOperatorTestFluid, MathOperatorMatScalarTes ...@@ -35,9 +34,8 @@ INSTANTIATE_TEST_CASE_P(DISABLED_MathOperatorTestFluid, MathOperatorMatScalarTes
cv::Size(640, 480), cv::Size(640, 480),
cv::Size(128, 128)), cv::Size(128, 128)),
Values(-1, CV_8U, CV_32F), Values(-1, CV_8U, CV_32F),
/*init output matrices or not*/ testing::Bool(),
Values(CORE_FLUID), Values(CORE_FLUID),
Values(AbsExact().to_compare_f()), Values(AbsExact().to_compare_obj()),
Values( opPlus, opPlusR, opMinus, opMinusR, opMul, opMulR, // FIXIT avoid division by values near zero: opDiv, opDivR, Values( opPlus, opPlusR, opMinus, opMinusR, opMul, opMulR, // FIXIT avoid division by values near zero: opDiv, opDivR,
opGT, opLT, opGE, opLE, opEQ, opNE, opGT, opLT, opGE, opLE, opEQ, opNE,
opGTR, opLTR, opGER, opLER, opEQR, opNER))); opGTR, opLTR, opGER, opLER, opEQR, opNER)));
...@@ -48,9 +46,8 @@ INSTANTIATE_TEST_CASE_P(BitwiseOperatorTestFluid, MathOperatorMatMatTest, ...@@ -48,9 +46,8 @@ INSTANTIATE_TEST_CASE_P(BitwiseOperatorTestFluid, MathOperatorMatMatTest,
cv::Size(640, 480), cv::Size(640, 480),
cv::Size(128, 128)), cv::Size(128, 128)),
Values(-1), Values(-1),
/*init output matrices or not*/ testing::Bool(),
Values(CORE_FLUID), Values(CORE_FLUID),
Values(AbsExact().to_compare_f()), Values(AbsExact().to_compare_obj()),
Values( opAnd, opOr, opXor ))); Values( opAnd, opOr, opXor )));
//FIXME: Some Mat/Scalar Fluid kernels are not there yet! //FIXME: Some Mat/Scalar Fluid kernels are not there yet!
...@@ -60,9 +57,8 @@ INSTANTIATE_TEST_CASE_P(DISABLED_BitwiseOperatorTestFluid, MathOperatorMatScalar ...@@ -60,9 +57,8 @@ INSTANTIATE_TEST_CASE_P(DISABLED_BitwiseOperatorTestFluid, MathOperatorMatScalar
cv::Size(640, 480), cv::Size(640, 480),
cv::Size(128, 128)), cv::Size(128, 128)),
Values(-1), Values(-1),
/*init output matrices or not*/ testing::Bool(),
Values(CORE_FLUID), Values(CORE_FLUID),
Values(AbsExact().to_compare_f()), Values(AbsExact().to_compare_obj()),
Values( opAND, opOR, opXOR, opANDR, opORR, opXORR ))); Values( opAND, opOR, opXOR, opANDR, opORR, opXORR )));
INSTANTIATE_TEST_CASE_P(BitwiseNotOperatorTestFluid, NotOperatorTest, INSTANTIATE_TEST_CASE_P(BitwiseNotOperatorTestFluid, NotOperatorTest,
...@@ -70,7 +66,6 @@ INSTANTIATE_TEST_CASE_P(BitwiseNotOperatorTestFluid, NotOperatorTest, ...@@ -70,7 +66,6 @@ INSTANTIATE_TEST_CASE_P(BitwiseNotOperatorTestFluid, NotOperatorTest,
Values(cv::Size(1280, 720), Values(cv::Size(1280, 720),
cv::Size(640, 480), cv::Size(640, 480),
cv::Size(128, 128)), cv::Size(128, 128)),
Values(SAME_TYPE), Values(-1),
/*init output matrices or not*/ testing::Bool(),
Values(CORE_FLUID))); Values(CORE_FLUID)));
} }
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
namespace namespace
{ {
#define CORE_GPU [] () { return cv::compile_args(cv::gapi::core::gpu::kernels()); } #define CORE_GPU [] () { return cv::compile_args(cv::gapi::core::gpu::kernels()); }
} // anonymous namespace } // anonymous namespace
namespace opencv_test namespace opencv_test
...@@ -22,9 +22,8 @@ INSTANTIATE_TEST_CASE_P(MathOperatorTestGPU, MathOperatorMatMatTest, ...@@ -22,9 +22,8 @@ INSTANTIATE_TEST_CASE_P(MathOperatorTestGPU, MathOperatorMatMatTest,
cv::Size(640, 480), cv::Size(640, 480),
cv::Size(128, 128)), cv::Size(128, 128)),
Values(-1, CV_8U, CV_32F), Values(-1, CV_8U, CV_32F),
testing::Bool(),
Values(CORE_GPU), Values(CORE_GPU),
Values(Tolerance_FloatRel_IntAbs(1e-5, 2).to_compare_f()), Values(Tolerance_FloatRel_IntAbs(1e-5, 2).to_compare_obj()),
Values( opPlusM, opMinusM, opDivM, Values( opPlusM, opMinusM, opDivM,
opGreater, opLess, opGreaterEq, opLessEq, opEq, opNotEq))); opGreater, opLess, opGreaterEq, opLessEq, opEq, opNotEq)));
...@@ -34,9 +33,8 @@ INSTANTIATE_TEST_CASE_P(MathOperatorTestGPU, MathOperatorMatScalarTest, ...@@ -34,9 +33,8 @@ INSTANTIATE_TEST_CASE_P(MathOperatorTestGPU, MathOperatorMatScalarTest,
cv::Size(640, 480), cv::Size(640, 480),
cv::Size(128, 128)), cv::Size(128, 128)),
Values(-1, CV_8U, CV_32F), Values(-1, CV_8U, CV_32F),
/*init output matrices or not*/ testing::Bool(),
Values(CORE_GPU), Values(CORE_GPU),
Values(Tolerance_FloatRel_IntAbs(1e-4, 2).to_compare_f()), Values(Tolerance_FloatRel_IntAbs(1e-4, 2).to_compare_obj()),
Values( opPlus, opPlusR, opMinus, opMinusR, opMul, opMulR, // FIXIT avoid division by values near zero: opDiv, opDivR, Values( opPlus, opPlusR, opMinus, opMinusR, opMul, opMulR, // FIXIT avoid division by values near zero: opDiv, opDivR,
opGT, opLT, opGE, opLE, opEQ, opNE, opGT, opLT, opGE, opLE, opEQ, opNE,
opGTR, opLTR, opGER, opLER, opEQR, opNER))); opGTR, opLTR, opGER, opLER, opEQR, opNER)));
...@@ -47,9 +45,8 @@ INSTANTIATE_TEST_CASE_P(BitwiseOperatorTestGPU, MathOperatorMatMatTest, ...@@ -47,9 +45,8 @@ INSTANTIATE_TEST_CASE_P(BitwiseOperatorTestGPU, MathOperatorMatMatTest,
cv::Size(640, 480), cv::Size(640, 480),
cv::Size(128, 128)), cv::Size(128, 128)),
Values(-1), Values(-1),
/*init output matrices or not*/ testing::Bool(),
Values(CORE_GPU), Values(CORE_GPU),
Values(AbsExact().to_compare_f()), Values(AbsExact().to_compare_obj()),
Values( opAnd, opOr, opXor ))); Values( opAnd, opOr, opXor )));
INSTANTIATE_TEST_CASE_P(BitwiseOperatorTestGPU, MathOperatorMatScalarTest, INSTANTIATE_TEST_CASE_P(BitwiseOperatorTestGPU, MathOperatorMatScalarTest,
...@@ -58,9 +55,8 @@ INSTANTIATE_TEST_CASE_P(BitwiseOperatorTestGPU, MathOperatorMatScalarTest, ...@@ -58,9 +55,8 @@ INSTANTIATE_TEST_CASE_P(BitwiseOperatorTestGPU, MathOperatorMatScalarTest,
cv::Size(640, 480), cv::Size(640, 480),
cv::Size(128, 128)), cv::Size(128, 128)),
Values(-1), Values(-1),
/*init output matrices or not*/ testing::Bool(),
Values(CORE_GPU), Values(CORE_GPU),
Values(AbsExact().to_compare_f()), Values(AbsExact().to_compare_obj()),
Values( opAND, opOR, opXOR, opANDR, opORR, opXORR ))); Values( opAND, opOR, opXOR, opANDR, opORR, opXORR )));
INSTANTIATE_TEST_CASE_P(BitwiseNotOperatorTestGPU, NotOperatorTest, INSTANTIATE_TEST_CASE_P(BitwiseNotOperatorTestGPU, NotOperatorTest,
...@@ -68,7 +64,6 @@ INSTANTIATE_TEST_CASE_P(BitwiseNotOperatorTestGPU, NotOperatorTest, ...@@ -68,7 +64,6 @@ INSTANTIATE_TEST_CASE_P(BitwiseNotOperatorTestGPU, NotOperatorTest,
Values(cv::Size(1280, 720), Values(cv::Size(1280, 720),
cv::Size(640, 480), cv::Size(640, 480),
cv::Size(128, 128)), cv::Size(128, 128)),
Values(SAME_TYPE), Values(-1),
/*init output matrices or not*/ testing::Bool(),
Values(CORE_GPU))); Values(CORE_GPU)));
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment