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
This commit is contained in:
committed by
Alexander Alekhin
parent
c11423df1e
commit
c9bd43c0f6
@@ -11,7 +11,7 @@
|
||||
|
||||
namespace
|
||||
{
|
||||
#define IMGPROC_GPU [] () { return cv::compile_args(cv::gapi::imgproc::gpu::kernels()); }
|
||||
#define IMGPROC_GPU [] () { return cv::compile_args(cv::gapi::imgproc::gpu::kernels()); }
|
||||
} // anonymous namespace
|
||||
|
||||
namespace opencv_test
|
||||
@@ -23,9 +23,8 @@ INSTANTIATE_TEST_CASE_P(Filter2DTestGPU, Filter2DTest,
|
||||
cv::Size(640, 480),
|
||||
cv::Size(128, 128)),
|
||||
Values(-1, CV_32F),
|
||||
testing::Bool(),
|
||||
Values(IMGPROC_GPU),
|
||||
Values(Tolerance_FloatRel_IntAbs(1e-5, 2).to_compare_f()),
|
||||
Values(Tolerance_FloatRel_IntAbs(1e-5, 2).to_compare_obj()),
|
||||
Values(3, 4, 5, 7),
|
||||
Values(cv::BORDER_DEFAULT)));
|
||||
|
||||
@@ -34,9 +33,8 @@ INSTANTIATE_TEST_CASE_P(BoxFilterTestCPU, BoxFilterTest,
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(-1, CV_32F),
|
||||
testing::Bool(),
|
||||
Values(IMGPROC_GPU),
|
||||
Values(Tolerance_FloatRel_IntAbs(1e-5, 2).to_compare_f()),
|
||||
Values(Tolerance_FloatRel_IntAbs(1e-5, 2).to_compare_obj()),
|
||||
Values(3,5),
|
||||
Values(cv::BORDER_DEFAULT))); //TODO: 8UC1 doesn't work
|
||||
|
||||
@@ -46,9 +44,8 @@ INSTANTIATE_TEST_CASE_P(SepFilterTestGPU_8U, SepFilterTest,
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(-1, CV_16S, CV_32F),
|
||||
testing::Bool(),
|
||||
Values(IMGPROC_GPU),
|
||||
Values(ToleranceFilter(1e-4f, 0.01).to_compare_f()),
|
||||
Values(ToleranceFilter(1e-4f, 0.01).to_compare_obj()),
|
||||
Values(3)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(SepFilterTestGPU_other, SepFilterTest,
|
||||
@@ -56,19 +53,17 @@ INSTANTIATE_TEST_CASE_P(SepFilterTestGPU_other, SepFilterTest,
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(-1, CV_32F),
|
||||
testing::Bool(),
|
||||
Values(IMGPROC_GPU),
|
||||
Values(ToleranceFilter(1e-4f, 0.01).to_compare_f()),
|
||||
Values(ToleranceFilter(1e-4f, 0.01).to_compare_obj()),
|
||||
Values(3)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(BlurTestGPU, BlurTest,
|
||||
Combine(Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(SAME_TYPE),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(-1),
|
||||
Values(IMGPROC_GPU),
|
||||
Values(Tolerance_FloatRel_IntAbs(1e-4, 2).to_compare_f()),
|
||||
Values(Tolerance_FloatRel_IntAbs(1e-4, 2).to_compare_obj()),
|
||||
Values(3,5),
|
||||
Values(cv::BORDER_DEFAULT)));
|
||||
|
||||
@@ -76,30 +71,27 @@ INSTANTIATE_TEST_CASE_P(gaussBlurTestGPU, GaussianBlurTest,
|
||||
Combine(Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(SAME_TYPE),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(-1),
|
||||
Values(IMGPROC_GPU),
|
||||
Values(ToleranceFilter(1e-5f, 0.01).to_compare_f()),
|
||||
Values(ToleranceFilter(1e-5f, 0.01).to_compare_obj()),
|
||||
Values(3))); // FIXIT 5
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(MedianBlurTestGPU, MedianBlurTest,
|
||||
Combine(Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(SAME_TYPE),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(-1),
|
||||
Values(IMGPROC_GPU),
|
||||
Values(AbsExact().to_compare_f()),
|
||||
Values(AbsExact().to_compare_obj()),
|
||||
Values(3, 5)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(ErodeTestGPU, ErodeTest,
|
||||
Combine(Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(SAME_TYPE),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(-1),
|
||||
Values(IMGPROC_GPU),
|
||||
Values(AbsExact().to_compare_f()),
|
||||
Values(AbsExact().to_compare_obj()),
|
||||
Values(3, 5),
|
||||
Values(cv::MorphShapes::MORPH_RECT,
|
||||
cv::MorphShapes::MORPH_CROSS,
|
||||
@@ -109,20 +101,18 @@ INSTANTIATE_TEST_CASE_P(Erode3x3TestGPU, Erode3x3Test,
|
||||
Combine(Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(SAME_TYPE),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(-1),
|
||||
Values(IMGPROC_GPU),
|
||||
Values(AbsExact().to_compare_f()),
|
||||
Values(AbsExact().to_compare_obj()),
|
||||
Values(1,2,4)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DilateTestGPU, DilateTest,
|
||||
Combine(Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(SAME_TYPE),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(-1),
|
||||
Values(IMGPROC_GPU),
|
||||
Values(AbsExact().to_compare_f()),
|
||||
Values(AbsExact().to_compare_obj()),
|
||||
Values(3, 5),
|
||||
Values(cv::MorphShapes::MORPH_RECT,
|
||||
cv::MorphShapes::MORPH_CROSS,
|
||||
@@ -132,10 +122,9 @@ INSTANTIATE_TEST_CASE_P(Dilate3x3TestGPU, Dilate3x3Test,
|
||||
Combine(Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(SAME_TYPE),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(-1),
|
||||
Values(IMGPROC_GPU),
|
||||
Values(AbsExact().to_compare_f()),
|
||||
Values(AbsExact().to_compare_obj()),
|
||||
Values(1,2,4)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(SobelTestGPU, SobelTest,
|
||||
@@ -143,9 +132,8 @@ INSTANTIATE_TEST_CASE_P(SobelTestGPU, SobelTest,
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(-1, CV_16S, CV_32F),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(IMGPROC_GPU),
|
||||
Values(Tolerance_FloatRel_IntAbs(1e-4, 2).to_compare_f()),
|
||||
Values(Tolerance_FloatRel_IntAbs(1e-4, 2).to_compare_obj()),
|
||||
Values(3, 5),
|
||||
Values(0, 1),
|
||||
Values(1, 2)));
|
||||
@@ -155,9 +143,8 @@ INSTANTIATE_TEST_CASE_P(SobelTestGPU32F, SobelTest,
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(CV_32F),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(IMGPROC_GPU),
|
||||
Values(Tolerance_FloatRel_IntAbs(1e-4, 2).to_compare_f()),
|
||||
Values(Tolerance_FloatRel_IntAbs(1e-4, 2).to_compare_obj()),
|
||||
Values(3, 5),
|
||||
Values(0, 1),
|
||||
Values(1, 2)));
|
||||
@@ -166,19 +153,17 @@ INSTANTIATE_TEST_CASE_P(EqHistTestGPU, EqHistTest,
|
||||
Combine(Values(CV_8UC1),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(SAME_TYPE),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(-1),
|
||||
Values(IMGPROC_GPU),
|
||||
Values(AbsExact().to_compare_f()))); // FIXIT Non reliable check
|
||||
Values(AbsExact().to_compare_obj()))); // FIXIT Non reliable check
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(CannyTestGPU, CannyTest,
|
||||
Combine(Values(CV_8UC1, CV_8UC3),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(CV_8UC1),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(IMGPROC_GPU),
|
||||
Values(AbsSimilarPoints(0, 0.05).to_compare_f()),
|
||||
Values(AbsSimilarPoints(0, 0.05).to_compare_obj()),
|
||||
Values(3.0, 120.0),
|
||||
Values(125.0, 240.0),
|
||||
Values(3, 5),
|
||||
@@ -189,80 +174,71 @@ INSTANTIATE_TEST_CASE_P(RGB2GrayTestGPU, RGB2GrayTest,
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(CV_8UC1),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(IMGPROC_GPU),
|
||||
Values(ToleranceColor(1e-3).to_compare_f())));
|
||||
Values(ToleranceColor(1e-3).to_compare_obj())));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(BGR2GrayTestGPU, BGR2GrayTest,
|
||||
Combine(Values(CV_8UC3),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(CV_8UC1),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(IMGPROC_GPU),
|
||||
Values(ToleranceColor(1e-3).to_compare_f())));
|
||||
Values(ToleranceColor(1e-3).to_compare_obj())));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(RGB2YUVTestGPU, RGB2YUVTest,
|
||||
Combine(Values(CV_8UC3),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(CV_8UC3),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(IMGPROC_GPU),
|
||||
Values(ToleranceColor(1e-3).to_compare_f())));
|
||||
Values(ToleranceColor(1e-3).to_compare_obj())));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(YUV2RGBTestGPU, YUV2RGBTest,
|
||||
Combine(Values(CV_8UC3),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(CV_8UC3),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(IMGPROC_GPU),
|
||||
Values(ToleranceColor(1e-3).to_compare_f())));
|
||||
Values(ToleranceColor(1e-3).to_compare_obj())));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(RGB2LabTestGPU, RGB2LabTest,
|
||||
Combine(Values(CV_8UC3),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(CV_8UC3),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(IMGPROC_GPU),
|
||||
Values(AbsSimilarPoints(1, 0.05).to_compare_f())));
|
||||
Values(AbsSimilarPoints(1, 0.05).to_compare_obj())));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(BGR2LUVTestGPU, BGR2LUVTest,
|
||||
Combine(Values(CV_8UC3),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(CV_8UC3),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(IMGPROC_GPU),
|
||||
Values(ToleranceColor(5e-3, 6).to_compare_f())));
|
||||
Values(ToleranceColor(5e-3, 6).to_compare_obj())));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(LUV2BGRTestGPU, LUV2BGRTest,
|
||||
Combine(Values(CV_8UC3),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(CV_8UC3),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(IMGPROC_GPU),
|
||||
Values(ToleranceColor(1e-3).to_compare_f())));
|
||||
Values(ToleranceColor(1e-3).to_compare_obj())));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(BGR2YUVTestGPU, BGR2YUVTest,
|
||||
Combine(Values(CV_8UC3),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(CV_8UC3),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(IMGPROC_GPU),
|
||||
Values(ToleranceColor(1e-3).to_compare_f())));
|
||||
Values(ToleranceColor(1e-3).to_compare_obj())));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(YUV2BGRTestGPU, YUV2BGRTest,
|
||||
Combine(Values(CV_8UC3),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(CV_8UC3),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(IMGPROC_GPU),
|
||||
Values(ToleranceColor(1e-3).to_compare_f())));
|
||||
Values(ToleranceColor(1e-3).to_compare_obj())));
|
||||
|
||||
} // opencv_test
|
||||
|
||||
Reference in New Issue
Block a user