opencv/modules/gapi/test/cpu/gapi_imgproc_tests_fluid.cpp

221 lines
11 KiB
C++
Raw Normal View History

// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
//
2019-06-26 23:33:16 +08:00
// Copyright (C) 2018-2019 Intel Corporation
#include "../test_precomp.hpp"
#include "../common/gapi_imgproc_tests.hpp"
2019-06-26 23:33:16 +08:00
namespace
{
#define IMGPROC_FLUID [] () { return cv::compile_args(cv::gapi::use_only{cv::gapi::imgproc::fluid::kernels()}); }
2019-06-26 23:33:16 +08:00
} // anonymous namespace
namespace opencv_test
{
INSTANTIATE_TEST_CASE_P(RGB2GrayTestFluid, RGB2GrayTest,
2019-06-26 23:33:16 +08:00
Combine(Values(CV_8UC3),
Values(cv::Size(1280, 720),
2019-06-26 23:33:16 +08:00
cv::Size(640, 480)),
Values(CV_8UC1),
Values(IMGPROC_FLUID),
Values(ToleranceColor(1e-3).to_compare_obj())));
INSTANTIATE_TEST_CASE_P(BGR2GrayTestFluid, BGR2GrayTest,
2019-06-26 23:33:16 +08:00
Combine(Values(CV_8UC3),
Values(cv::Size(1280, 720),
cv::Size(640, 480)),
2019-06-26 23:33:16 +08:00
Values(CV_8UC1),
Values(IMGPROC_FLUID),
Values(ToleranceColor(1e-3).to_compare_obj())));
INSTANTIATE_TEST_CASE_P(RGB2YUVTestFluid, RGB2YUVTest,
2019-06-26 23:33:16 +08:00
Combine(Values(CV_8UC3),
Values(cv::Size(1280, 720),
cv::Size(640, 480)),
2019-06-26 23:33:16 +08:00
Values(CV_8UC3),
Values(IMGPROC_FLUID),
Values(ToleranceColor(1e-3).to_compare_obj())));
INSTANTIATE_TEST_CASE_P(YUV2RGBTestFluid, YUV2RGBTest,
2019-06-26 23:33:16 +08:00
Combine(Values(CV_8UC3),
Values(cv::Size(1280, 720),
cv::Size(640, 480)),
2019-06-26 23:33:16 +08:00
Values(CV_8UC3),
Values(IMGPROC_FLUID),
Values(ToleranceColor(1e-3).to_compare_obj())));
INSTANTIATE_TEST_CASE_P(RGB2LabTestFluid, RGB2LabTest,
2019-06-26 23:33:16 +08:00
Combine(Values(CV_8UC3),
Values(cv::Size(1280, 720),
cv::Size(640, 480)),
2019-06-26 23:33:16 +08:00
Values(CV_8UC3),
Values(IMGPROC_FLUID),
Values(AbsSimilarPoints(1, 0.05).to_compare_obj())));
// FIXME: Not supported by Fluid yet (no kernel implemented)
INSTANTIATE_TEST_CASE_P(BGR2LUVTestFluid, BGR2LUVTest,
2019-06-26 23:33:16 +08:00
Combine(Values(CV_8UC3),
Values(cv::Size(1280, 720),
cv::Size(640, 480)),
2019-06-26 23:33:16 +08:00
Values(CV_8UC3),
Values(IMGPROC_FLUID),
Values(ToleranceColor(5e-3, 6).to_compare_obj())));
INSTANTIATE_TEST_CASE_P(RGB2HSVTestFluid, RGB2HSVTest,
2019-06-26 23:33:16 +08:00
Combine(Values(CV_8UC3),
Values(cv::Size(1280, 720),
cv::Size(640, 480)),
2019-06-26 23:33:16 +08:00
Values(CV_8UC3),
Values(IMGPROC_FLUID),
Values(ToleranceColor(1e-3).to_compare_obj())));
INSTANTIATE_TEST_CASE_P(BayerGR2RGBTestFluid, BayerGR2RGBTest,
2019-06-26 23:33:16 +08:00
Combine(Values(CV_8UC1),
Values(cv::Size(1280, 720),
cv::Size(640, 480)),
2019-06-26 23:33:16 +08:00
Values(CV_8UC3),
Values(IMGPROC_FLUID),
Values(ToleranceColor(1e-3).to_compare_obj())));
INSTANTIATE_TEST_CASE_P(RGB2YUV422TestFluid, RGB2YUV422Test,
2019-06-26 23:33:16 +08:00
Combine(Values(CV_8UC3),
Values(cv::Size(1280, 720),
cv::Size(640, 480)),
2019-06-26 23:33:16 +08:00
Values(CV_8UC2),
Values(IMGPROC_FLUID),
Values(AbsTolerance(1).to_compare_obj())));
INSTANTIATE_TEST_CASE_P(blurTestFluid, BlurTest,
2019-06-26 23:33:16 +08:00
Combine(Values(CV_8UC1, CV_16UC1, CV_16SC1),
Values(cv::Size(1280, 720),
cv::Size(640, 480)),
Values(-1),
2019-06-26 23:33:16 +08:00
Values(IMGPROC_FLUID),
Values(ToleranceFilter(1e-4f, 0.01).to_compare_obj()),
2019-06-26 23:33:16 +08:00
Values(3), // add kernel size=5 when implementation is ready
Values(cv::BORDER_DEFAULT)));
INSTANTIATE_TEST_CASE_P(gaussBlurTestFluid, GaussianBlurTest,
2019-06-26 23:33:16 +08:00
Combine(Values(CV_8UC1, CV_16UC1, CV_16SC1),
Values(cv::Size(1280, 720),
cv::Size(640, 480)),
Values(-1),
2019-06-26 23:33:16 +08:00
Values(IMGPROC_FLUID),
Values(ToleranceFilter(1e-3f, 0.01).to_compare_obj()),
Values(3, 5)));
INSTANTIATE_TEST_CASE_P(medianBlurTestFluid, MedianBlurTest,
2019-06-26 23:33:16 +08:00
Combine(Values(CV_8UC1, CV_16UC1, CV_16SC1),
Values(cv::Size(1280, 720),
cv::Size(640, 480)),
Values(-1),
2019-06-26 23:33:16 +08:00
Values(IMGPROC_FLUID),
Values(AbsExact().to_compare_obj()),
2019-06-26 23:33:16 +08:00
Values(3))); // add kernel size=5 when implementation is ready
INSTANTIATE_TEST_CASE_P(erodeTestFluid, ErodeTest,
2019-06-26 23:33:16 +08:00
Combine(Values(CV_8UC1, CV_16UC1, CV_16SC1),
Values(cv::Size(1280, 720),
cv::Size(640, 480)),
Values(-1),
2019-06-26 23:33:16 +08:00
Values(IMGPROC_FLUID),
Values(AbsExact().to_compare_obj()),
2019-06-26 23:33:16 +08:00
Values(3), // add kernel size=5 when implementation is ready
Values(cv::MorphShapes::MORPH_RECT,
cv::MorphShapes::MORPH_CROSS,
2019-06-26 23:33:16 +08:00
cv::MorphShapes::MORPH_ELLIPSE)));
INSTANTIATE_TEST_CASE_P(dilateTestFluid, DilateTest,
2019-06-26 23:33:16 +08:00
Combine(Values(CV_8UC1, CV_16UC1, CV_16SC1),
Values(cv::Size(1280, 720),
cv::Size(640, 480)),
Values(-1),
2019-06-26 23:33:16 +08:00
Values(IMGPROC_FLUID),
Values(AbsExact().to_compare_obj()),
2019-06-26 23:33:16 +08:00
Values(3), // add kernel size=5 when implementation is ready
Values(cv::MorphShapes::MORPH_RECT,
cv::MorphShapes::MORPH_CROSS,
2019-06-26 23:33:16 +08:00
cv::MorphShapes::MORPH_ELLIPSE)));
INSTANTIATE_TEST_CASE_P(SobelTestFluid, SobelTest,
2019-06-26 23:33:16 +08:00
Combine(Values(CV_8UC1, CV_16UC1, CV_16SC1),
Values(cv::Size(1280, 720),
cv::Size(640, 480)),
Values(-1, CV_16S, CV_32F),
2019-06-26 23:33:16 +08:00
Values(IMGPROC_FLUID),
Values(AbsExact().to_compare_obj()),
2019-06-26 23:33:16 +08:00
Values(3), // add kernel size=5 when implementation is ready
Values(0, 1),
Values(1, 2)));
INSTANTIATE_TEST_CASE_P(SobelTestFluid32F, SobelTest,
2019-06-26 23:33:16 +08:00
Combine(Values(CV_32FC1),
Values(cv::Size(1280, 720),
cv::Size(640, 480)),
Values(CV_32F),
2019-06-26 23:33:16 +08:00
Values(IMGPROC_FLUID),
Values(ToleranceFilter(1e-4f, 0.01).to_compare_obj()),
2019-06-26 23:33:16 +08:00
Values(3), // add kernel size=5 when implementation is ready
Values(0, 1),
Values(1, 2)));
INSTANTIATE_TEST_CASE_P(SobelXYTestFluid, SobelXYTest,
2019-06-26 23:33:16 +08:00
Combine(Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1),
Values(cv::Size(1280, 720),
cv::Size(640, 480)),
Values(-1, CV_16S, CV_32F),
2019-06-26 23:33:16 +08:00
Values(IMGPROC_FLUID),
Values(AbsExact().to_compare_obj()),
2019-06-26 23:33:16 +08:00
Values(3),
Values(1, 2),
Values(BORDER_CONSTANT, BORDER_REPLICATE, BORDER_REFLECT_101),
2019-06-26 23:33:16 +08:00
Values(0, 1, 255)));
INSTANTIATE_TEST_CASE_P(SobelXYTestFluid32F, SobelXYTest,
2019-06-26 23:33:16 +08:00
Combine(Values(CV_32FC1),
Values(cv::Size(1280, 720),
cv::Size(640, 480)),
Values(CV_32F),
2019-06-26 23:33:16 +08:00
Values(IMGPROC_FLUID),
Values(ToleranceFilter(1e-4f, 0.01).to_compare_obj()),
2019-06-26 23:33:16 +08:00
Values(3),
Values(1, 2),
Values(BORDER_CONSTANT, BORDER_REPLICATE, BORDER_REFLECT_101),
2019-06-26 23:33:16 +08:00
Values(0, 1, 255)));
INSTANTIATE_TEST_CASE_P(boxFilterTestFluid32, BoxFilterTest,
2019-06-26 23:33:16 +08:00
Combine(Values(CV_8UC1, CV_16UC1, CV_16SC1),
Values(cv::Size(1280, 720),
cv::Size(640, 480)),
Values(-1, CV_32F),
2019-06-26 23:33:16 +08:00
Values(IMGPROC_FLUID),
Values(ToleranceFilter(1e-4f, 0.01).to_compare_obj()),
2019-06-26 23:33:16 +08:00
Values(3), // add kernel size=5 when implementation is ready
Values(cv::BORDER_DEFAULT)));
INSTANTIATE_TEST_CASE_P(sepFilterTestFluid, SepFilterTest,
2019-06-26 23:33:16 +08:00
Combine(Values(CV_32FC1),
Values(cv::Size(1280, 720),
cv::Size(640, 480)),
Values(-1, CV_32F),
2019-06-26 23:33:16 +08:00
Values(IMGPROC_FLUID),
Values(ToleranceFilter(1e-4f, 0.01).to_compare_obj()),
2019-06-26 23:33:16 +08:00
Values(3))); // add kernel size=5 when implementation is ready
INSTANTIATE_TEST_CASE_P(filter2DTestFluid, Filter2DTest,
2019-06-26 23:33:16 +08:00
Combine(Values(CV_8UC1, CV_16UC1, CV_16SC1),
Values(cv::Size(1280, 720),
cv::Size(640, 480),
cv::Size(128, 128)),
Values(-1, CV_32F),
2019-06-26 23:33:16 +08:00
Values(IMGPROC_FLUID),
Values(ToleranceFilter(1e-4f, 0.01).to_compare_obj()),
Values(cv::Size(3, 3)), // add kernel size=4x4,5x5,7x7 when implementation ready
2019-06-26 23:33:16 +08:00
Values(cv::BORDER_DEFAULT)));
} // opencv_test