mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 07:43:03 +04:00
Merge pull request #12944 from dbudniko:dbudniko/tests_thresholds
* added threshold to g-api imgproc tests * trailing spaces remove * try to fix warnings * fix license header * fix random numbers issue * fix Sobel test * license headers + precompiled headers included
This commit is contained in:
committed by
Alexander Alekhin
parent
853f5111c2
commit
220b278575
@@ -878,8 +878,7 @@ TEST_P(ThresholdOTTest, AccuracyTestOtsu)
|
||||
int tt = std::get<2>(param);
|
||||
|
||||
auto compile_args = std::get<4>(param);
|
||||
auto& rng = cv::theRNG();
|
||||
cv::Scalar maxval = cv::Scalar(50 + rng(50),50 + rng(50),50 + rng(50),50 + rng(50));
|
||||
cv::Scalar maxval = initScalarRandU(50) + cv::Scalar(50, 50, 50, 50);
|
||||
initMatrixRandU(type, sz_in, type, std::get<3>(param));
|
||||
cv::Scalar out_gapi_scalar;
|
||||
double ocv_res;
|
||||
@@ -911,9 +910,8 @@ TEST_P(InRangeTest, AccuracyTest)
|
||||
cv::Size sz_in = std::get<1>(param);
|
||||
|
||||
auto compile_args = std::get<3>(param);
|
||||
auto& rng = cv::theRNG();
|
||||
cv::Scalar thrLow = cv::Scalar(rng(100),rng(100),rng(100),rng(100));
|
||||
cv::Scalar thrUp = cv::Scalar(100 + rng(100),100 + rng(100),100 + rng(100),100 + rng(100));
|
||||
cv::Scalar thrLow = initScalarRandU(100);
|
||||
cv::Scalar thrUp = initScalarRandU(100) + cv::Scalar(100, 100, 100, 100);
|
||||
initMatrixRandU(type, sz_in, type, std::get<2>(param));
|
||||
|
||||
// G-API code //////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -14,28 +14,29 @@
|
||||
|
||||
namespace opencv_test
|
||||
{
|
||||
struct Filter2DTest : public TestParams <std::tuple<MatType,int,cv::Size,int,int,bool,cv::GCompileArgs>> {};
|
||||
struct BoxFilterTest : public TestParams <std::tuple<MatType,int,cv::Size,int,int,double,bool,cv::GCompileArgs>> {};
|
||||
struct SepFilterTest : public TestParams <std::tuple<MatType,int,cv::Size,int,bool,cv::GCompileArgs>> {};
|
||||
struct BlurTest : public TestParams <std::tuple<MatType,int,cv::Size,int,double,bool,cv::GCompileArgs>> {};
|
||||
struct GaussianBlurTest : public TestParams <std::tuple<MatType,int,cv::Size,bool,cv::GCompileArgs>> {};
|
||||
struct MedianBlurTest : public TestParams <std::tuple<MatType,int,cv::Size,bool,cv::GCompileArgs>> {};
|
||||
struct ErodeTest : public TestParams <std::tuple<MatType,int,cv::Size,int,bool,cv::GCompileArgs>> {};
|
||||
struct Erode3x3Test : public TestParams <std::tuple<MatType,cv::Size,bool,int,cv::GCompileArgs>> {};
|
||||
struct DilateTest : public TestParams <std::tuple<MatType,int,cv::Size,int,bool,cv::GCompileArgs>> {};
|
||||
struct Dilate3x3Test : public TestParams <std::tuple<MatType,cv::Size,bool,int,cv::GCompileArgs>> {};
|
||||
struct SobelTest : public TestParams <std::tuple<MatType,int,cv::Size,int,int,int,bool,cv::GCompileArgs>> {};
|
||||
struct EqHistTest : public TestParams <std::tuple<cv::Size,bool, cv::GCompileArgs>> {};
|
||||
struct CannyTest : public TestParams <std::tuple<MatType,cv::Size,double,double,int,bool,bool,cv::GCompileArgs>> {};
|
||||
struct RGB2GrayTest : public TestParams<std::tuple<cv::Size,bool,cv::GCompileArgs>> {};
|
||||
struct BGR2GrayTest : public TestParams<std::tuple<cv::Size,bool,cv::GCompileArgs>> {};
|
||||
struct RGB2YUVTest : public TestParams<std::tuple<cv::Size,bool,cv::GCompileArgs>> {};
|
||||
struct YUV2RGBTest : public TestParams<std::tuple<cv::Size,bool,cv::GCompileArgs>> {};
|
||||
struct RGB2LabTest : public TestParams<std::tuple<cv::Size,bool,cv::GCompileArgs>> {};
|
||||
struct BGR2LUVTest : public TestParams<std::tuple<cv::Size,bool,cv::GCompileArgs>> {};
|
||||
struct LUV2BGRTest : public TestParams<std::tuple<cv::Size,bool,cv::GCompileArgs>> {};
|
||||
struct BGR2YUVTest : public TestParams<std::tuple<cv::Size,bool,cv::GCompileArgs>> {};
|
||||
struct YUV2BGRTest : public TestParams<std::tuple<cv::Size,bool,cv::GCompileArgs>> {};
|
||||
|
||||
struct Filter2DTest : public TestParams <std::tuple<compare_f, MatType,int,cv::Size,int,int,bool,cv::GCompileArgs>> {};
|
||||
struct BoxFilterTest : public TestParams <std::tuple<compare_f,MatType,int,cv::Size,int,int,bool,cv::GCompileArgs>> {};
|
||||
struct SepFilterTest : public TestParams <std::tuple<compare_f,MatType,int,cv::Size,int,bool,cv::GCompileArgs>> {};
|
||||
struct BlurTest : public TestParams <std::tuple<compare_f,MatType,int,cv::Size,int,bool,cv::GCompileArgs>> {};
|
||||
struct GaussianBlurTest : public TestParams <std::tuple<compare_f,MatType,int,cv::Size,bool,cv::GCompileArgs>> {};
|
||||
struct MedianBlurTest : public TestParams <std::tuple<compare_f,MatType,int,cv::Size,bool,cv::GCompileArgs>> {};
|
||||
struct ErodeTest : public TestParams <std::tuple<compare_f,MatType,int,cv::Size,int,bool,cv::GCompileArgs>> {};
|
||||
struct Erode3x3Test : public TestParams <std::tuple<compare_f,MatType,cv::Size,bool,int,cv::GCompileArgs>> {};
|
||||
struct DilateTest : public TestParams <std::tuple<compare_f,MatType,int,cv::Size,int,bool,cv::GCompileArgs>> {};
|
||||
struct Dilate3x3Test : public TestParams <std::tuple<compare_f,MatType,cv::Size,bool,int,cv::GCompileArgs>> {};
|
||||
struct SobelTest : public TestParams <std::tuple<compare_f,MatType,int,cv::Size,int,int,int,bool,cv::GCompileArgs>> {};
|
||||
struct EqHistTest : public TestParams <std::tuple<compare_f,cv::Size,bool,cv::GCompileArgs>> {};
|
||||
struct CannyTest : public TestParams <std::tuple<compare_f,MatType,cv::Size,double,double,int,bool,bool,cv::GCompileArgs>> {};
|
||||
struct RGB2GrayTest : public TestParams<std::tuple<compare_f,cv::Size,bool,cv::GCompileArgs>> {};
|
||||
struct BGR2GrayTest : public TestParams<std::tuple<compare_f,cv::Size,bool,cv::GCompileArgs>> {};
|
||||
struct RGB2YUVTest : public TestParams<std::tuple<compare_f,cv::Size,bool,cv::GCompileArgs>> {};
|
||||
struct YUV2RGBTest : public TestParams<std::tuple<compare_f,cv::Size,bool,cv::GCompileArgs>> {};
|
||||
struct RGB2LabTest : public TestParams<std::tuple<compare_f,cv::Size,bool,cv::GCompileArgs>> {};
|
||||
struct BGR2LUVTest : public TestParams<std::tuple<compare_f,cv::Size,bool,cv::GCompileArgs>> {};
|
||||
struct LUV2BGRTest : public TestParams<std::tuple<compare_f,cv::Size,bool,cv::GCompileArgs>> {};
|
||||
struct BGR2YUVTest : public TestParams<std::tuple<compare_f,cv::Size,bool,cv::GCompileArgs>> {};
|
||||
struct YUV2BGRTest : public TestParams<std::tuple<compare_f,cv::Size,bool,cv::GCompileArgs>> {};
|
||||
} // opencv_test
|
||||
|
||||
#endif //OPENCV_GAPI_IMGPROC_TESTS_HPP
|
||||
|
||||
@@ -15,12 +15,13 @@ namespace opencv_test
|
||||
{
|
||||
TEST_P(Filter2DTest, AccuracyTest)
|
||||
{
|
||||
compare_f cmpF;
|
||||
MatType type = 0;
|
||||
int kernSize = 0, borderType = 0, dtype = 0;
|
||||
cv::Size sz;
|
||||
bool initOut = false;
|
||||
cv::GCompileArgs compile_args;
|
||||
std::tie(type, kernSize, sz, borderType, dtype, initOut, compile_args) = GetParam();
|
||||
std::tie(cmpF, type, kernSize, sz, borderType, dtype, initOut, compile_args) = GetParam();
|
||||
initMatsRandN(type, sz, dtype, initOut);
|
||||
|
||||
cv::Point anchor = {-1, -1};
|
||||
@@ -43,36 +44,20 @@ TEST_P(Filter2DTest, AccuracyTest)
|
||||
}
|
||||
// Comparison //////////////////////////////////////////////////////////////
|
||||
{
|
||||
// TODO: Control this choice with test's especial parameter
|
||||
#if 1
|
||||
// Allow some rounding error
|
||||
if (CV_MAT_DEPTH(out_mat_gapi.type()) == CV_32F)
|
||||
{
|
||||
// 6 decimal digits is nearly best accuracy we can expect of FP32 arithmetic here
|
||||
EXPECT_EQ(0, cv::countNonZero(cv::abs(out_mat_gapi - out_mat_ocv) > 1e-6*cv::abs(out_mat_ocv)));
|
||||
}
|
||||
else
|
||||
{
|
||||
// allow wrong rounding if result fractional part is nearly 0.5,
|
||||
// assume there would be not more than 0.01% of such cases
|
||||
EXPECT_LE(cv::countNonZero(out_mat_gapi != out_mat_ocv), 1e-4*out_mat_ocv.total());
|
||||
}
|
||||
#else
|
||||
EXPECT_EQ(0, cv::countNonZero(out_mat_gapi != out_mat_ocv));
|
||||
#endif
|
||||
EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv));
|
||||
EXPECT_EQ(out_mat_gapi.size(), sz);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(BoxFilterTest, AccuracyTest)
|
||||
{
|
||||
compare_f cmpF;
|
||||
MatType type = 0;
|
||||
int filterSize = 0, borderType = 0, dtype = 0;
|
||||
cv::Size sz;
|
||||
double tolerance = 0.0;
|
||||
bool initOut = false;
|
||||
cv::GCompileArgs compile_args;
|
||||
std::tie(type, filterSize, sz, borderType, dtype, tolerance, initOut, compile_args) = GetParam();
|
||||
std::tie(cmpF, type, filterSize, sz, borderType, dtype, initOut, compile_args) = GetParam();
|
||||
initMatsRandN(type, sz, dtype, initOut);
|
||||
|
||||
cv::Point anchor = {-1, -1};
|
||||
@@ -90,37 +75,20 @@ TEST_P(BoxFilterTest, AccuracyTest)
|
||||
}
|
||||
// Comparison //////////////////////////////////////////////////////////////
|
||||
{
|
||||
// TODO: Control this choice with test's especial parameter
|
||||
#if 1
|
||||
// Allow some rounding error
|
||||
if (CV_MAT_DEPTH(out_mat_gapi.type()) == CV_32F)
|
||||
{
|
||||
// 6 decimal digits is nearly best accuracy we can expect of FP32 arithmetic here
|
||||
EXPECT_EQ(0, cv::countNonZero(cv::abs(out_mat_gapi - out_mat_ocv) > 1e-6*cv::abs(out_mat_ocv)));
|
||||
}
|
||||
else
|
||||
{
|
||||
// allow wrong rounding if result fractional part is nearly 0.5,
|
||||
// assume there would be not more than 0.01% of such cases
|
||||
EXPECT_LE(cv::countNonZero(out_mat_gapi != out_mat_ocv), 1e-4*out_mat_ocv.total());
|
||||
}
|
||||
#else
|
||||
cv::Mat absDiff;
|
||||
cv::absdiff(out_mat_gapi, out_mat_ocv, absDiff);
|
||||
EXPECT_EQ(0, cv::countNonZero(absDiff > tolerance));
|
||||
#endif
|
||||
EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv));
|
||||
EXPECT_EQ(out_mat_gapi.size(), sz);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(SepFilterTest, AccuracyTest)
|
||||
{
|
||||
compare_f cmpF;
|
||||
MatType type = 0;
|
||||
int kernSize = 0, dtype = 0;
|
||||
cv::Size sz;
|
||||
bool initOut = false;
|
||||
cv::GCompileArgs compile_args;
|
||||
std::tie(type, kernSize, sz, dtype, initOut, compile_args) = GetParam();
|
||||
std::tie(cmpF, type, kernSize, sz, dtype, initOut, compile_args) = GetParam();
|
||||
|
||||
cv::Mat kernelX(kernSize, 1, CV_32F);
|
||||
cv::Mat kernelY(kernSize, 1, CV_32F);
|
||||
@@ -142,27 +110,20 @@ TEST_P(SepFilterTest, AccuracyTest)
|
||||
}
|
||||
// Comparison //////////////////////////////////////////////////////////////
|
||||
{
|
||||
// TODO: Control this choice with test's especial parameter
|
||||
#if 1
|
||||
// Expect some rounding error
|
||||
EXPECT_LE(cv::countNonZero(cv::abs(out_mat_gapi - out_mat_ocv) > 1e-5 * cv::abs(out_mat_ocv)),
|
||||
0.01 * out_mat_ocv.total());
|
||||
#else
|
||||
EXPECT_EQ(0, cv::countNonZero(out_mat_gapi != out_mat_ocv));
|
||||
#endif
|
||||
EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv));
|
||||
EXPECT_EQ(out_mat_gapi.size(), sz);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(BlurTest, AccuracyTest)
|
||||
{
|
||||
compare_f cmpF;
|
||||
MatType type = 0;
|
||||
int filterSize = 0, borderType = 0;
|
||||
cv::Size sz;
|
||||
double tolerance = 0.0;
|
||||
bool initOut = false;
|
||||
cv::GCompileArgs compile_args;
|
||||
std::tie(type, filterSize, sz, borderType, tolerance, initOut, compile_args) = GetParam();
|
||||
std::tie(cmpF, type, filterSize, sz, borderType, initOut, compile_args) = GetParam();
|
||||
initMatsRandN(type, sz, type, initOut);
|
||||
|
||||
cv::Point anchor = {-1, -1};
|
||||
@@ -179,21 +140,20 @@ TEST_P(BlurTest, AccuracyTest)
|
||||
}
|
||||
// Comparison //////////////////////////////////////////////////////////////
|
||||
{
|
||||
cv::Mat absDiff;
|
||||
cv::absdiff(out_mat_gapi, out_mat_ocv, absDiff);
|
||||
EXPECT_EQ(0, cv::countNonZero(absDiff > tolerance));
|
||||
EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv));
|
||||
EXPECT_EQ(out_mat_gapi.size(), sz);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(GaussianBlurTest, AccuracyTest)
|
||||
{
|
||||
compare_f cmpF;
|
||||
MatType type = 0;
|
||||
int kernSize = 0;
|
||||
cv::Size sz;
|
||||
bool initOut = false;
|
||||
cv::GCompileArgs compile_args;
|
||||
std::tie(type, kernSize, sz, initOut, compile_args) = GetParam();
|
||||
std::tie(cmpF,type, kernSize, sz, initOut, compile_args) = GetParam();
|
||||
initMatsRandN(type, sz, type, initOut);
|
||||
|
||||
cv::Size kSize = cv::Size(kernSize, kernSize);
|
||||
@@ -211,42 +171,20 @@ TEST_P(GaussianBlurTest, AccuracyTest)
|
||||
}
|
||||
// Comparison //////////////////////////////////////////////////////////////
|
||||
{
|
||||
// TODO: Control this choice with test's especial parameter
|
||||
#if 1
|
||||
// Expect some rounding error
|
||||
if (CV_MAT_DEPTH(out_mat_gapi.type()) == CV_32F ||
|
||||
CV_MAT_DEPTH(out_mat_gapi.type()) == CV_64F)
|
||||
{
|
||||
// Note that 1e-6 is nearly best accuracy we can expect of FP32 arithetic
|
||||
EXPECT_EQ(0, cv::countNonZero(cv::abs(out_mat_gapi - out_mat_ocv) >
|
||||
1e-6*cv::abs(out_mat_ocv)));
|
||||
}
|
||||
else if (CV_MAT_DEPTH(out_mat_gapi.type()) == CV_8U)
|
||||
{
|
||||
// OpenCV uses 16-bits fixed-point for 8U data, so may produce wrong results
|
||||
EXPECT_LE(cv::countNonZero(cv::abs(out_mat_gapi - out_mat_ocv) > 1),
|
||||
0.05*out_mat_ocv.total());
|
||||
EXPECT_LE(cv::countNonZero(cv::abs(out_mat_gapi - out_mat_ocv) > 2), 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
EXPECT_EQ(0, cv::countNonZero(out_mat_gapi != out_mat_ocv));
|
||||
}
|
||||
#else
|
||||
EXPECT_EQ(0, cv::countNonZero(out_mat_gapi != out_mat_ocv));
|
||||
#endif
|
||||
EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv));
|
||||
EXPECT_EQ(out_mat_gapi.size(), sz);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(MedianBlurTest, AccuracyTest)
|
||||
{
|
||||
compare_f cmpF;
|
||||
MatType type = 0;
|
||||
int kernSize = 0;
|
||||
cv::Size sz;
|
||||
bool initOut = false;
|
||||
cv::GCompileArgs compile_args;
|
||||
std::tie(type, kernSize, sz, initOut, compile_args) = GetParam();
|
||||
std::tie(cmpF, type, kernSize, sz, initOut, compile_args) = GetParam();
|
||||
initMatsRandN(type, sz, type, initOut);
|
||||
|
||||
// G-API code //////////////////////////////////////////////////////////////
|
||||
@@ -261,19 +199,20 @@ TEST_P(MedianBlurTest, AccuracyTest)
|
||||
}
|
||||
// Comparison //////////////////////////////////////////////////////////////
|
||||
{
|
||||
EXPECT_EQ(0, cv::countNonZero(out_mat_gapi != out_mat_ocv));
|
||||
EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv));
|
||||
EXPECT_EQ(out_mat_gapi.size(), sz);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(ErodeTest, AccuracyTest)
|
||||
{
|
||||
compare_f cmpF;
|
||||
MatType type = 0;
|
||||
int kernSize = 0, kernType = 0;
|
||||
cv::Size sz;
|
||||
bool initOut = false;
|
||||
cv::GCompileArgs compile_args;
|
||||
std::tie(type, kernSize, sz, kernType, initOut, compile_args) = GetParam();
|
||||
std::tie(cmpF, type, kernSize, sz, kernType, initOut, compile_args) = GetParam();
|
||||
initMatsRandN(type, sz, type, initOut);
|
||||
|
||||
cv::Mat kernel = cv::getStructuringElement(kernType, cv::Size(kernSize, kernSize));
|
||||
@@ -290,19 +229,20 @@ TEST_P(ErodeTest, AccuracyTest)
|
||||
}
|
||||
// Comparison //////////////////////////////////////////////////////////////
|
||||
{
|
||||
EXPECT_EQ(0, cv::countNonZero(out_mat_gapi != out_mat_ocv));
|
||||
EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv));
|
||||
EXPECT_EQ(out_mat_gapi.size(), sz);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(Erode3x3Test, AccuracyTest)
|
||||
{
|
||||
compare_f cmpF;
|
||||
MatType type = 0;
|
||||
int numIters = 0;
|
||||
cv::Size sz;
|
||||
bool initOut = false;
|
||||
cv::GCompileArgs compile_args;
|
||||
std::tie(type, sz, initOut, numIters, compile_args) = GetParam();
|
||||
std::tie(cmpF, type, sz, initOut, numIters, compile_args) = GetParam();
|
||||
initMatsRandN(type, sz, type, initOut);
|
||||
|
||||
cv::Mat kernel = cv::getStructuringElement(cv::MorphShapes::MORPH_RECT, cv::Size(3,3));
|
||||
@@ -319,19 +259,20 @@ TEST_P(Erode3x3Test, AccuracyTest)
|
||||
}
|
||||
// Comparison //////////////////////////////////////////////////////////////
|
||||
{
|
||||
EXPECT_EQ(0, cv::countNonZero(out_mat_gapi != out_mat_ocv));
|
||||
EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv));
|
||||
EXPECT_EQ(out_mat_gapi.size(), sz);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(DilateTest, AccuracyTest)
|
||||
{
|
||||
compare_f cmpF;
|
||||
MatType type = 0;
|
||||
int kernSize = 0, kernType = 0;
|
||||
cv::Size sz;
|
||||
bool initOut = false;
|
||||
cv::GCompileArgs compile_args;
|
||||
std::tie(type, kernSize, sz, kernType, initOut, compile_args) = GetParam();
|
||||
std::tie(cmpF, type, kernSize, sz, kernType, initOut, compile_args) = GetParam();
|
||||
initMatsRandN(type, sz, type, initOut);
|
||||
|
||||
cv::Mat kernel = cv::getStructuringElement(kernType, cv::Size(kernSize, kernSize));
|
||||
@@ -348,19 +289,20 @@ TEST_P(DilateTest, AccuracyTest)
|
||||
}
|
||||
// Comparison //////////////////////////////////////////////////////////////
|
||||
{
|
||||
EXPECT_EQ(0, cv::countNonZero(out_mat_gapi != out_mat_ocv));
|
||||
EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv));
|
||||
EXPECT_EQ(out_mat_gapi.size(), sz);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(Dilate3x3Test, AccuracyTest)
|
||||
{
|
||||
compare_f cmpF;
|
||||
MatType type = 0;
|
||||
int numIters = 0;
|
||||
cv::Size sz;
|
||||
bool initOut = false;
|
||||
cv::GCompileArgs compile_args;
|
||||
std::tie(type, sz, initOut, numIters, compile_args) = GetParam();
|
||||
std::tie(cmpF, type, sz, initOut, numIters, compile_args) = GetParam();
|
||||
initMatsRandN(type, sz, type, initOut);
|
||||
|
||||
cv::Mat kernel = cv::getStructuringElement(cv::MorphShapes::MORPH_RECT, cv::Size(3,3));
|
||||
@@ -377,7 +319,7 @@ TEST_P(Dilate3x3Test, AccuracyTest)
|
||||
}
|
||||
// Comparison //////////////////////////////////////////////////////////////
|
||||
{
|
||||
EXPECT_EQ(0, cv::countNonZero(out_mat_gapi != out_mat_ocv));
|
||||
EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv));
|
||||
EXPECT_EQ(out_mat_gapi.size(), sz);
|
||||
}
|
||||
}
|
||||
@@ -385,12 +327,13 @@ TEST_P(Dilate3x3Test, AccuracyTest)
|
||||
|
||||
TEST_P(SobelTest, AccuracyTest)
|
||||
{
|
||||
compare_f cmpF;
|
||||
MatType type = 0;
|
||||
int kernSize = 0, dtype = 0, dx = 0, dy = 0;
|
||||
cv::Size sz;
|
||||
bool initOut = false;
|
||||
cv::GCompileArgs compile_args;
|
||||
std::tie(type, kernSize, sz, dtype, dx, dy, initOut, compile_args) = GetParam();
|
||||
std::tie(cmpF, type, kernSize, sz, dtype, dx, dy, initOut, compile_args) = GetParam();
|
||||
initMatsRandN(type, sz, dtype, initOut);
|
||||
|
||||
// G-API code //////////////////////////////////////////////////////////////
|
||||
@@ -405,17 +348,18 @@ TEST_P(SobelTest, AccuracyTest)
|
||||
}
|
||||
// Comparison //////////////////////////////////////////////////////////////
|
||||
{
|
||||
EXPECT_EQ(0, cv::countNonZero(out_mat_gapi != out_mat_ocv));
|
||||
EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv));
|
||||
EXPECT_EQ(out_mat_gapi.size(), sz);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(EqHistTest, AccuracyTest)
|
||||
{
|
||||
compare_f cmpF;
|
||||
cv::Size sz;
|
||||
bool initOut = false;
|
||||
cv::GCompileArgs compile_args;
|
||||
std::tie(sz, initOut, compile_args) = GetParam();
|
||||
std::tie(cmpF, sz, initOut, compile_args) = GetParam();
|
||||
initMatsRandN(CV_8UC1, sz, CV_8UC1, initOut);
|
||||
|
||||
// G-API code //////////////////////////////////////////////////////////////
|
||||
@@ -430,20 +374,21 @@ TEST_P(EqHistTest, AccuracyTest)
|
||||
}
|
||||
// Comparison //////////////////////////////////////////////////////////////
|
||||
{
|
||||
EXPECT_EQ(0, cv::countNonZero(out_mat_gapi != out_mat_ocv));
|
||||
EXPECT_EQ(out_mat_gapi.size(), std::get<0>(GetParam()));
|
||||
EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv));
|
||||
EXPECT_EQ(out_mat_gapi.size(), std::get<1>(GetParam()));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(CannyTest, AccuracyTest)
|
||||
{
|
||||
compare_f cmpF;
|
||||
MatType type;
|
||||
int apSize = 0;
|
||||
double thrLow = 0.0, thrUp = 0.0;
|
||||
cv::Size sz;
|
||||
bool l2gr = false, initOut = false;
|
||||
cv::GCompileArgs compile_args;
|
||||
std::tie(type, sz, thrLow, thrUp, apSize, l2gr, initOut, compile_args) = GetParam();
|
||||
std::tie(cmpF, type, sz, thrLow, thrUp, apSize, l2gr, initOut, compile_args) = GetParam();
|
||||
|
||||
initMatsRandN(type, sz, CV_8UC1, initOut);
|
||||
|
||||
@@ -459,7 +404,7 @@ TEST_P(CannyTest, AccuracyTest)
|
||||
}
|
||||
// Comparison //////////////////////////////////////////////////////////////
|
||||
{
|
||||
EXPECT_EQ(0, cv::countNonZero(out_mat_gapi != out_mat_ocv));
|
||||
EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv));
|
||||
EXPECT_EQ(out_mat_gapi.size(), sz);
|
||||
}
|
||||
}
|
||||
@@ -467,8 +412,9 @@ TEST_P(CannyTest, AccuracyTest)
|
||||
TEST_P(RGB2GrayTest, AccuracyTest)
|
||||
{
|
||||
auto param = GetParam();
|
||||
auto compile_args = std::get<2>(param);
|
||||
initMatsRandN(CV_8UC3, std::get<0>(param), CV_8UC1, std::get<1>(param));
|
||||
auto compile_args = std::get<3>(param);
|
||||
compare_f cmpF = std::get<0>(param);
|
||||
initMatsRandN(CV_8UC3, std::get<1>(param), CV_8UC1, std::get<2>(param));
|
||||
|
||||
// G-API code //////////////////////////////////////////////////////////////
|
||||
cv::GMat in;
|
||||
@@ -482,26 +428,17 @@ TEST_P(RGB2GrayTest, AccuracyTest)
|
||||
}
|
||||
// Comparison //////////////////////////////////////////////////////////////
|
||||
{
|
||||
// TODO: control this choice with especial parameter of this test
|
||||
#if 1
|
||||
// allow faithful rounding if result's fractional part is nearly 0.5
|
||||
// - assume not more than 0.1% of pixels may deviate this way
|
||||
// - deviation must not exceed 1 unit anyway
|
||||
EXPECT_LE(cv::countNonZero(out_mat_gapi - out_mat_ocv > 0), 0.001*out_mat_ocv.total());
|
||||
EXPECT_LE(cv::countNonZero(out_mat_gapi - out_mat_ocv > 1), 0);
|
||||
#else
|
||||
// insist of bit-exact results
|
||||
EXPECT_EQ(0, cv::countNonZero(out_mat_gapi != out_mat_ocv));
|
||||
#endif
|
||||
EXPECT_EQ(out_mat_gapi.size(), std::get<0>(param));
|
||||
EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv));
|
||||
EXPECT_EQ(out_mat_gapi.size(), std::get<1>(param));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(BGR2GrayTest, AccuracyTest)
|
||||
{
|
||||
auto param = GetParam();
|
||||
auto compile_args = std::get<2>(param);
|
||||
initMatsRandN(CV_8UC3, std::get<0>(param), CV_8UC1, std::get<1>(param));
|
||||
auto compile_args = std::get<3>(param);
|
||||
compare_f cmpF = std::get<0>(param);
|
||||
initMatsRandN(CV_8UC3, std::get<1>(param), CV_8UC1, std::get<2>(param));
|
||||
|
||||
// G-API code //////////////////////////////////////////////////////////////
|
||||
cv::GMat in;
|
||||
@@ -515,26 +452,17 @@ TEST_P(BGR2GrayTest, AccuracyTest)
|
||||
}
|
||||
// Comparison //////////////////////////////////////////////////////////////
|
||||
{
|
||||
// TODO: control this choice with especial parameter of this test
|
||||
#if 1
|
||||
// allow faithful rounding if result's fractional part is nearly 0.5
|
||||
// - assume not more than 0.1% of pixels may deviate this way
|
||||
// - deviation must not exceed 1 unit anyway
|
||||
EXPECT_LE(cv::countNonZero(out_mat_gapi - out_mat_ocv > 0), 0.001*out_mat_ocv.total());
|
||||
EXPECT_LE(cv::countNonZero(out_mat_gapi - out_mat_ocv > 1), 0);
|
||||
#else
|
||||
// insist of bit-exact results
|
||||
EXPECT_EQ(0, cv::countNonZero(out_mat_gapi != out_mat_ocv));
|
||||
#endif
|
||||
EXPECT_EQ(out_mat_gapi.size(), std::get<0>(param));
|
||||
EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv));
|
||||
EXPECT_EQ(out_mat_gapi.size(), std::get<1>(param));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(RGB2YUVTest, AccuracyTest)
|
||||
{
|
||||
auto param = GetParam();
|
||||
auto compile_args = std::get<2>(param);
|
||||
initMatsRandN(CV_8UC3, std::get<0>(param), CV_8UC3, std::get<1>(param));
|
||||
auto compile_args = std::get<3>(param);
|
||||
compare_f cmpF = std::get<0>(param);
|
||||
initMatsRandN(CV_8UC3, std::get<1>(param), CV_8UC3, std::get<2>(param));
|
||||
|
||||
// G-API code //////////////////////////////////////////////////////////////
|
||||
cv::GMat in;
|
||||
@@ -548,26 +476,18 @@ TEST_P(RGB2YUVTest, AccuracyTest)
|
||||
}
|
||||
// Comparison //////////////////////////////////////////////////////////////
|
||||
{
|
||||
// TODO: control this choice with especial parameter of this test
|
||||
#if 1
|
||||
// allow faithful rounding if result's fractional part is nearly 0.5
|
||||
// - assume not more than 15% of pixels may deviate this way
|
||||
// - deviation must not exceed 1 unit anyway
|
||||
EXPECT_LE(cv::countNonZero(out_mat_gapi - out_mat_ocv > 0), 0.15*3*out_mat_ocv.total());
|
||||
EXPECT_LE(cv::countNonZero(out_mat_gapi - out_mat_ocv > 1), 0);
|
||||
#else
|
||||
// insist of bit-exact results
|
||||
EXPECT_EQ(0, cv::countNonZero(out_mat_gapi != out_mat_ocv));
|
||||
#endif
|
||||
EXPECT_EQ(out_mat_gapi.size(), std::get<0>(param));
|
||||
EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv));
|
||||
EXPECT_EQ(out_mat_gapi.size(), std::get<1>(param));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(YUV2RGBTest, AccuracyTest)
|
||||
{
|
||||
auto param = GetParam();
|
||||
auto compile_args = std::get<2>(param);
|
||||
initMatsRandN(CV_8UC3, std::get<0>(param), CV_8UC3, std::get<1>(param));
|
||||
auto compile_args = std::get<3>(param);
|
||||
compare_f cmpF = std::get<0>(param);
|
||||
initMatsRandN(CV_8UC3, std::get<1>(param), CV_8UC3, std::get<2>(param));
|
||||
|
||||
|
||||
// G-API code //////////////////////////////////////////////////////////////
|
||||
cv::GMat in;
|
||||
@@ -581,26 +501,17 @@ TEST_P(YUV2RGBTest, AccuracyTest)
|
||||
}
|
||||
// Comparison //////////////////////////////////////////////////////////////
|
||||
{
|
||||
// TODO: control this choice with especial parameter of this test
|
||||
#if 1
|
||||
// allow faithful rounding if result's fractional part is nearly 0.5
|
||||
// - assume not more than 1% of pixels may deviate this way
|
||||
// - deviation must not exceed 1 unit anyway
|
||||
EXPECT_LE(cv::countNonZero(out_mat_gapi - out_mat_ocv > 0), 0.01*3*out_mat_ocv.total());
|
||||
EXPECT_LE(cv::countNonZero(out_mat_gapi - out_mat_ocv > 1), 0);
|
||||
#else
|
||||
// insist of bit-exact results
|
||||
EXPECT_EQ(0, cv::countNonZero(out_mat_gapi != out_mat_ocv));
|
||||
#endif
|
||||
EXPECT_EQ(out_mat_gapi.size(), std::get<0>(param));
|
||||
EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv));
|
||||
EXPECT_EQ(out_mat_gapi.size(), std::get<1>(param));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(RGB2LabTest, AccuracyTest)
|
||||
{
|
||||
auto param = GetParam();
|
||||
auto compile_args = std::get<2>(param);
|
||||
initMatsRandN(CV_8UC3, std::get<0>(param), CV_8UC3, std::get<1>(param));
|
||||
auto compile_args = std::get<3>(param);
|
||||
compare_f cmpF = std::get<0>(param);
|
||||
initMatsRandN(CV_8UC3, std::get<1>(param), CV_8UC3, std::get<2>(param));
|
||||
|
||||
// G-API code //////////////////////////////////////////////////////////////
|
||||
cv::GMat in;
|
||||
@@ -614,28 +525,17 @@ TEST_P(RGB2LabTest, AccuracyTest)
|
||||
}
|
||||
// Comparison //////////////////////////////////////////////////////////////
|
||||
{
|
||||
// TODO: control this choice with especial parameter of this test
|
||||
#if 1
|
||||
// allow faithful rounding, if result's fractional part is nearly 0.5
|
||||
// - assume not more than 25% of pixels may deviate this way
|
||||
// - not more than 1% of pixels may deviate by 1 unit
|
||||
// - deviation must not exceed 2 units anyway
|
||||
EXPECT_LE(cv::countNonZero(out_mat_gapi - out_mat_ocv > 0), 0.25*3*out_mat_ocv.total());
|
||||
EXPECT_LE(cv::countNonZero(out_mat_gapi - out_mat_ocv > 1), 0.01*3*out_mat_ocv.total());
|
||||
EXPECT_LE(cv::countNonZero(out_mat_gapi - out_mat_ocv > 2), 1e-5*3*out_mat_ocv.total());
|
||||
#else
|
||||
// insist on bit-exact results
|
||||
EXPECT_EQ(0, cv::countNonZero(out_mat_gapi != out_mat_ocv));
|
||||
#endif
|
||||
EXPECT_EQ(out_mat_gapi.size(), std::get<0>(param));
|
||||
EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv));
|
||||
EXPECT_EQ(out_mat_gapi.size(), std::get<1>(param));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(BGR2LUVTest, AccuracyTest)
|
||||
{
|
||||
auto param = GetParam();
|
||||
auto compile_args = std::get<2>(param);
|
||||
initMatsRandN(CV_8UC3, std::get<0>(param), CV_8UC3, std::get<1>(param));
|
||||
auto compile_args = std::get<3>(param);
|
||||
compare_f cmpF = std::get<0>(param);
|
||||
initMatsRandN(CV_8UC3, std::get<1>(param), CV_8UC3, std::get<2>(param));
|
||||
|
||||
// G-API code //////////////////////////////////////////////////////////////
|
||||
cv::GMat in;
|
||||
@@ -649,28 +549,17 @@ TEST_P(BGR2LUVTest, AccuracyTest)
|
||||
}
|
||||
// Comparison //////////////////////////////////////////////////////////////
|
||||
{
|
||||
// TODO: control this choice with especial parameter of this test
|
||||
#if 1
|
||||
// allow faithful rounding, if result's fractional part is nearly 0.5
|
||||
// - assume not more than 25% of pixels may deviate this way
|
||||
// - not more than 1% of pixels may deviate by 2+ units
|
||||
// - not more than 0.01% pixels may deviate by 5+ units
|
||||
EXPECT_LE(cv::countNonZero(out_mat_gapi - out_mat_ocv > 0), 0.25 * 3 * out_mat_ocv.total());
|
||||
EXPECT_LE(cv::countNonZero(out_mat_gapi - out_mat_ocv > 1), 0.01 * 3 * out_mat_ocv.total());
|
||||
EXPECT_LE(cv::countNonZero(out_mat_gapi - out_mat_ocv > 5), 0.0001 * 3 * out_mat_ocv.total());
|
||||
#else
|
||||
// insist on bit-exact results
|
||||
EXPECT_EQ(0, cv::countNonZero(out_mat_gapi != out_mat_ocv));
|
||||
#endif
|
||||
EXPECT_EQ(out_mat_gapi.size(), std::get<0>(param));
|
||||
EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv));
|
||||
EXPECT_EQ(out_mat_gapi.size(), std::get<1>(param));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(LUV2BGRTest, AccuracyTest)
|
||||
{
|
||||
auto param = GetParam();
|
||||
auto compile_args = std::get<2>(param);
|
||||
initMatsRandN(CV_8UC3, std::get<0>(param), CV_8UC3, std::get<1>(param));
|
||||
auto compile_args = std::get<3>(param);
|
||||
compare_f cmpF = std::get<0>(param);
|
||||
initMatsRandN(CV_8UC3, std::get<1>(param), CV_8UC3, std::get<2>(param));
|
||||
|
||||
// G-API code //////////////////////////////////////////////////////////////
|
||||
cv::GMat in;
|
||||
@@ -684,16 +573,17 @@ TEST_P(LUV2BGRTest, AccuracyTest)
|
||||
}
|
||||
// Comparison //////////////////////////////////////////////////////////////
|
||||
{
|
||||
EXPECT_EQ(0, cv::countNonZero(out_mat_gapi != out_mat_ocv));
|
||||
EXPECT_EQ(out_mat_gapi.size(), std::get<0>(param));
|
||||
EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv));
|
||||
EXPECT_EQ(out_mat_gapi.size(), std::get<1>(param));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(BGR2YUVTest, AccuracyTest)
|
||||
{
|
||||
auto param = GetParam();
|
||||
auto compile_args = std::get<2>(param);
|
||||
initMatsRandN(CV_8UC3, std::get<0>(param), CV_8UC3, std::get<1>(param));
|
||||
auto compile_args = std::get<3>(param);
|
||||
compare_f cmpF = std::get<0>(param);
|
||||
initMatsRandN(CV_8UC3, std::get<1>(param), CV_8UC3, std::get<2>(param));
|
||||
|
||||
// G-API code //////////////////////////////////////////////////////////////
|
||||
cv::GMat in;
|
||||
@@ -707,16 +597,17 @@ TEST_P(BGR2YUVTest, AccuracyTest)
|
||||
}
|
||||
// Comparison //////////////////////////////////////////////////////////////
|
||||
{
|
||||
EXPECT_EQ(0, cv::countNonZero(out_mat_gapi != out_mat_ocv));
|
||||
EXPECT_EQ(out_mat_gapi.size(), std::get<0>(param));
|
||||
EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv));
|
||||
EXPECT_EQ(out_mat_gapi.size(), std::get<1>(param));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(YUV2BGRTest, AccuracyTest)
|
||||
{
|
||||
auto param = GetParam();
|
||||
auto compile_args = std::get<2>(param);
|
||||
initMatsRandN(CV_8UC3, std::get<0>(param), CV_8UC3, std::get<1>(param));
|
||||
auto compile_args = std::get<3>(param);
|
||||
compare_f cmpF = std::get<0>(param);
|
||||
initMatsRandN(CV_8UC3, std::get<1>(param), CV_8UC3, std::get<2>(param));
|
||||
|
||||
// G-API code //////////////////////////////////////////////////////////////
|
||||
cv::GMat in;
|
||||
@@ -730,20 +621,8 @@ TEST_P(YUV2BGRTest, AccuracyTest)
|
||||
}
|
||||
// Comparison //////////////////////////////////////////////////////////////
|
||||
{
|
||||
// TODO: control this choice with especial parameter of this test
|
||||
#if 1
|
||||
// allow faithful rounding, if result's fractional part is nearly 0.5
|
||||
// - assume not more than 25% of pixels may deviate this way
|
||||
// - not more than 1% of pixels may deviate by 1 unit
|
||||
// - deviation must not exceed 2 units anyway
|
||||
EXPECT_LE(cv::countNonZero(out_mat_gapi - out_mat_ocv > 0), 0.25*3*out_mat_ocv.total());
|
||||
EXPECT_LE(cv::countNonZero(out_mat_gapi - out_mat_ocv > 1), 0.01*3*out_mat_ocv.total());
|
||||
EXPECT_LE(cv::countNonZero(out_mat_gapi - out_mat_ocv > 2), 1e-5*3*out_mat_ocv.total());
|
||||
#else
|
||||
// insist on bit-exact results
|
||||
EXPECT_EQ(0, cv::countNonZero(out_mat_gapi != out_mat_ocv));
|
||||
#endif
|
||||
EXPECT_EQ(out_mat_gapi.size(), std::get<0>(param));
|
||||
EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv));
|
||||
EXPECT_EQ(out_mat_gapi.size(), std::get<1>(param));
|
||||
}
|
||||
}
|
||||
} // opencv_test
|
||||
|
||||
@@ -31,13 +31,22 @@ public:
|
||||
|
||||
cv::Scalar sc;
|
||||
|
||||
cv::Scalar initScalarRandU(unsigned upper)
|
||||
{
|
||||
auto& rng = cv::theRNG();
|
||||
double s1 = rng(upper);
|
||||
double s2 = rng(upper);
|
||||
double s3 = rng(upper);
|
||||
double s4 = rng(upper);
|
||||
return cv::Scalar(s1, s2, s3, s4);
|
||||
}
|
||||
|
||||
void initMatsRandU(int type, cv::Size sz_in, int dtype, bool createOutputMatrices = true)
|
||||
{
|
||||
in_mat1 = cv::Mat(sz_in, type);
|
||||
in_mat2 = cv::Mat(sz_in, type);
|
||||
|
||||
auto& rng = cv::theRNG();
|
||||
sc = cv::Scalar(rng(100),rng(100),rng(100),rng(100));
|
||||
sc = initScalarRandU(100);
|
||||
cv::randu(in_mat1, cv::Scalar::all(0), cv::Scalar::all(255));
|
||||
cv::randu(in_mat2, cv::Scalar::all(0), cv::Scalar::all(255));
|
||||
|
||||
@@ -52,8 +61,7 @@ public:
|
||||
{
|
||||
in_mat1 = cv::Mat(sz_in, type);
|
||||
|
||||
auto& rng = cv::theRNG();
|
||||
sc = cv::Scalar(rng(100),rng(100),rng(100),rng(100));
|
||||
sc = initScalarRandU(100);
|
||||
|
||||
cv::randu(in_mat1, cv::Scalar::all(0), cv::Scalar::all(255));
|
||||
|
||||
@@ -105,4 +113,19 @@ class TestParams: public TestFunctional, public TestWithParam<T>{};
|
||||
template<class T>
|
||||
class TestPerfParams: public TestFunctional, public perf::TestBaseWithParam<T>{};
|
||||
|
||||
using compare_f = std::function<bool(const cv::Mat &a, const cv::Mat &b)>;
|
||||
|
||||
template<typename T>
|
||||
struct Wrappable
|
||||
{
|
||||
compare_f to_compare_f()
|
||||
{
|
||||
T t = *static_cast<T*const>(this);
|
||||
return [t](const cv::Mat &a, const cv::Mat &b)
|
||||
{
|
||||
return t(a, b);
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -15,8 +15,30 @@
|
||||
namespace opencv_test
|
||||
{
|
||||
|
||||
class AbsExact : public Wrappable<AbsExact>
|
||||
{
|
||||
public:
|
||||
AbsExact() {}
|
||||
bool operator() (const cv::Mat& in1, const cv::Mat& in2) const { return cv::countNonZero(in1 != in2)==0; }
|
||||
private:
|
||||
};
|
||||
|
||||
class AbsTolerance : public Wrappable<AbsTolerance>
|
||||
{
|
||||
public:
|
||||
AbsTolerance(double tol) : _tol(tol) {}
|
||||
bool operator() (const cv::Mat& in1, const cv::Mat& in2) const
|
||||
{
|
||||
cv::Mat absDiff; cv::absdiff(in1, in2, absDiff);
|
||||
return cv::countNonZero(absDiff > _tol) == 0;
|
||||
}
|
||||
private:
|
||||
double _tol;
|
||||
};
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(Filter2DTestCPU, Filter2DTest,
|
||||
Combine(Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1),
|
||||
Combine(Values(AbsExact().to_compare_f()),
|
||||
Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1),
|
||||
Values(3, 4, 5, 7),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480),
|
||||
@@ -27,18 +49,19 @@ INSTANTIATE_TEST_CASE_P(Filter2DTestCPU, Filter2DTest,
|
||||
Values(cv::compile_args(IMGPROC_CPU))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(BoxFilterTestCPU, BoxFilterTest,
|
||||
Combine(Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1),
|
||||
Combine(Values(AbsTolerance(1e-6).to_compare_f()),
|
||||
Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1),
|
||||
Values(3,5),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(cv::BORDER_DEFAULT),
|
||||
Values(-1, CV_32F),
|
||||
Values(0.0),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(cv::compile_args(IMGPROC_CPU))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(SepFilterTestCPU_8U, SepFilterTest,
|
||||
Combine(Values(CV_8UC1, CV_8UC3),
|
||||
Combine(Values(AbsExact().to_compare_f()),
|
||||
Values(CV_8UC1, CV_8UC3),
|
||||
Values(3),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
@@ -47,7 +70,8 @@ INSTANTIATE_TEST_CASE_P(SepFilterTestCPU_8U, SepFilterTest,
|
||||
Values(cv::compile_args(IMGPROC_CPU))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(SepFilterTestCPU_other, SepFilterTest,
|
||||
Combine(Values(CV_16UC1, CV_16SC1, CV_32FC1),
|
||||
Combine(Values(AbsExact().to_compare_f()),
|
||||
Values(CV_16UC1, CV_16SC1, CV_32FC1),
|
||||
Values(3),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
@@ -56,17 +80,18 @@ INSTANTIATE_TEST_CASE_P(SepFilterTestCPU_other, SepFilterTest,
|
||||
Values(cv::compile_args(IMGPROC_CPU))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(BlurTestCPU, BlurTest,
|
||||
Combine(Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1),
|
||||
Combine(Values(AbsTolerance(0.0).to_compare_f()),
|
||||
Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1),
|
||||
Values(3,5),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(cv::BORDER_DEFAULT),
|
||||
Values(0.0),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(cv::compile_args(IMGPROC_CPU))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(gaussBlurTestCPU, GaussianBlurTest,
|
||||
Combine(Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1),
|
||||
Combine(Values(AbsExact().to_compare_f()),
|
||||
Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1),
|
||||
Values(3, 5),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
@@ -74,7 +99,8 @@ INSTANTIATE_TEST_CASE_P(gaussBlurTestCPU, GaussianBlurTest,
|
||||
Values(cv::compile_args(IMGPROC_CPU))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(MedianBlurTestCPU, MedianBlurTest,
|
||||
Combine(Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1),
|
||||
Combine(Values(AbsExact().to_compare_f()),
|
||||
Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1),
|
||||
Values(3, 5),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
@@ -82,7 +108,8 @@ INSTANTIATE_TEST_CASE_P(MedianBlurTestCPU, MedianBlurTest,
|
||||
Values(cv::compile_args(IMGPROC_CPU))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(ErodeTestCPU, ErodeTest,
|
||||
Combine(Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1),
|
||||
Combine(Values(AbsExact().to_compare_f()),
|
||||
Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1),
|
||||
Values(3, 5),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
@@ -93,7 +120,8 @@ INSTANTIATE_TEST_CASE_P(ErodeTestCPU, ErodeTest,
|
||||
Values(cv::compile_args(IMGPROC_CPU))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(Erode3x3TestCPU, Erode3x3Test,
|
||||
Combine(Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1),
|
||||
Combine(Values(AbsExact().to_compare_f()),
|
||||
Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
@@ -101,7 +129,8 @@ INSTANTIATE_TEST_CASE_P(Erode3x3TestCPU, Erode3x3Test,
|
||||
Values(cv::compile_args(IMGPROC_CPU))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DilateTestCPU, DilateTest,
|
||||
Combine(Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1),
|
||||
Combine(Values(AbsExact().to_compare_f()),
|
||||
Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1),
|
||||
Values(3, 5),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
@@ -112,7 +141,8 @@ INSTANTIATE_TEST_CASE_P(DilateTestCPU, DilateTest,
|
||||
Values(cv::compile_args(IMGPROC_CPU))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(Dilate3x3TestCPU, Dilate3x3Test,
|
||||
Combine(Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1),
|
||||
Combine(Values(AbsExact().to_compare_f()),
|
||||
Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
@@ -120,7 +150,8 @@ INSTANTIATE_TEST_CASE_P(Dilate3x3TestCPU, Dilate3x3Test,
|
||||
Values(cv::compile_args(IMGPROC_CPU))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(SobelTestCPU, SobelTest,
|
||||
Combine(Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1),
|
||||
Combine(Values(AbsExact().to_compare_f()),
|
||||
Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1),
|
||||
Values(3, 5),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
@@ -131,13 +162,15 @@ INSTANTIATE_TEST_CASE_P(SobelTestCPU, SobelTest,
|
||||
Values(cv::compile_args(IMGPROC_CPU))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(EqHistTestCPU, EqHistTest,
|
||||
Combine(Values(cv::Size(1280, 720),
|
||||
Combine(Values(AbsExact().to_compare_f()),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(cv::compile_args(IMGPROC_CPU))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(CannyTestCPU, CannyTest,
|
||||
Combine(Values(CV_8UC1, CV_8UC3),
|
||||
Combine(Values(AbsExact().to_compare_f()),
|
||||
Values(CV_8UC1, CV_8UC3),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(3.0, 120.0),
|
||||
@@ -148,55 +181,64 @@ INSTANTIATE_TEST_CASE_P(CannyTestCPU, CannyTest,
|
||||
Values(cv::compile_args(IMGPROC_CPU))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(RGB2GrayTestCPU, RGB2GrayTest,
|
||||
Combine(Values(cv::Size(1280, 720),
|
||||
Combine(Values(AbsExact().to_compare_f()),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(cv::compile_args(IMGPROC_CPU))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(BGR2GrayTestCPU, BGR2GrayTest,
|
||||
Combine(Values(cv::Size(1280, 720),
|
||||
Combine(Values(AbsExact().to_compare_f()),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(cv::compile_args(IMGPROC_CPU))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(RGB2YUVTestCPU, RGB2YUVTest,
|
||||
Combine(Values(cv::Size(1280, 720),
|
||||
Combine(Values(AbsExact().to_compare_f()),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(cv::compile_args(IMGPROC_CPU))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(YUV2RGBTestCPU, YUV2RGBTest,
|
||||
Combine(Values(cv::Size(1280, 720),
|
||||
Combine(Values(AbsExact().to_compare_f()),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(cv::compile_args(IMGPROC_CPU))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(RGB2LabTestCPU, RGB2LabTest,
|
||||
Combine(Values(cv::Size(1280, 720),
|
||||
Combine(Values(AbsExact().to_compare_f()),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(cv::compile_args(IMGPROC_CPU))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(BGR2LUVTestCPU, BGR2LUVTest,
|
||||
Combine(Values(cv::Size(1280, 720),
|
||||
Combine(Values(AbsExact().to_compare_f()),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(cv::compile_args(IMGPROC_CPU))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(LUV2BGRTestCPU, LUV2BGRTest,
|
||||
Combine(Values(cv::Size(1280, 720),
|
||||
Combine(Values(AbsExact().to_compare_f()),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(cv::compile_args(IMGPROC_CPU))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(BGR2YUVTestCPU, BGR2YUVTest,
|
||||
Combine(Values(cv::Size(1280, 720),
|
||||
Combine(Values(AbsExact().to_compare_f()),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(cv::compile_args(IMGPROC_CPU))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(YUV2BGRTestCPU, YUV2BGRTest,
|
||||
Combine(Values(cv::Size(1280, 720),
|
||||
Combine(Values(AbsExact().to_compare_f()),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(cv::compile_args(IMGPROC_CPU))));
|
||||
|
||||
@@ -14,55 +14,163 @@
|
||||
namespace opencv_test
|
||||
{
|
||||
|
||||
class AbsExactFluid : public Wrappable<AbsExactFluid>
|
||||
{
|
||||
public:
|
||||
AbsExactFluid() {}
|
||||
bool operator() (const cv::Mat& in1, const cv::Mat& in2) const { return cv::countNonZero(in1 != in2) == 0; }
|
||||
private:
|
||||
};
|
||||
|
||||
|
||||
class AbsToleranceFluid : public Wrappable<AbsToleranceFluid>
|
||||
{
|
||||
public:
|
||||
AbsToleranceFluid(double tol) : _tol(tol) {}
|
||||
bool operator() (const cv::Mat& in1, const cv::Mat& in2) const
|
||||
{
|
||||
cv::Mat absDiff; cv::absdiff(in1, in2, absDiff);
|
||||
return cv::countNonZero(absDiff > _tol) == 0;
|
||||
}
|
||||
private:
|
||||
double _tol;
|
||||
};
|
||||
|
||||
class AbsTolerance32FFluid : public Wrappable<AbsTolerance32FFluid>
|
||||
{
|
||||
public:
|
||||
AbsTolerance32FFluid(double tol) : _tol(tol) {}
|
||||
bool operator() (const cv::Mat& in1, const cv::Mat& in2) const
|
||||
{
|
||||
if (CV_MAT_DEPTH(in1.type()) == CV_32F)
|
||||
return ((cv::countNonZero(cv::abs(in1 - in2) > (_tol)*cv::abs(in2))) ? false : true);
|
||||
else
|
||||
return ((cv::countNonZero(in1 != in2) <= (_tol * 100) * in2.total()) ? true : false);
|
||||
}
|
||||
private:
|
||||
double _tol;
|
||||
};
|
||||
|
||||
class AbsToleranceSepFilterFluid : public Wrappable<AbsToleranceSepFilterFluid>
|
||||
{
|
||||
public:
|
||||
AbsToleranceSepFilterFluid(double tol) : _tol(tol) {}
|
||||
bool operator() (const cv::Mat& in1, const cv::Mat& in2) const
|
||||
{
|
||||
return ((cv::countNonZero(cv::abs(in1 - in2) > (_tol)* cv::abs(in2)) <= 0.01 * in2.total()) ? true : false);
|
||||
}
|
||||
private:
|
||||
double _tol;
|
||||
};
|
||||
|
||||
class AbsToleranceGaussianBlurFluid : public Wrappable<AbsToleranceGaussianBlurFluid>
|
||||
{
|
||||
public:
|
||||
AbsToleranceGaussianBlurFluid(double tol) : _tol(tol) {}
|
||||
bool operator() (const cv::Mat& in1, const cv::Mat& in2) const
|
||||
{
|
||||
if (CV_MAT_DEPTH(in1.type()) == CV_32F || CV_MAT_DEPTH(in1.type()) == CV_64F)
|
||||
{
|
||||
return ((cv::countNonZero(cv::abs(in1 - in2) > (_tol)*cv::abs(in2))) ? false : true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CV_MAT_DEPTH(in1.type()) == CV_8U)
|
||||
{
|
||||
bool a = (cv::countNonZero(cv::abs(in1 - in2) > 1) <= _tol * in2.total());
|
||||
return ((a == 1 ? 0 : 1) && ((cv::countNonZero(cv::abs(in1 - in2) > 2) <= 0) == 1 ? 0 : 1)) == 1 ? false : true;
|
||||
}
|
||||
else return cv::countNonZero(in1 != in2)==0;
|
||||
}
|
||||
}
|
||||
private:
|
||||
double _tol;
|
||||
};
|
||||
|
||||
class AbsToleranceRGBBGRFluid : public Wrappable<AbsToleranceRGBBGRFluid>
|
||||
{
|
||||
public:
|
||||
AbsToleranceRGBBGRFluid(double tol) : _tol(tol) {}
|
||||
bool operator() (const cv::Mat& in1, const cv::Mat& in2) const
|
||||
{
|
||||
bool a = (cv::countNonZero((in1 - in2) > 0) <= _tol * in2.total());
|
||||
return ((a == 1 ? 0 : 1) && ((cv::countNonZero((in1 - in2) > 1) <= 0) == 1 ? 0 : 1)) == 1 ? false : true;
|
||||
}
|
||||
private:
|
||||
double _tol;
|
||||
};
|
||||
|
||||
class ToleranceTripleFluid : public Wrappable<ToleranceTripleFluid>
|
||||
{
|
||||
public:
|
||||
ToleranceTripleFluid(double tol1, double tol2, double tol3) : _tol1(tol1), _tol2(tol2), _tol3(tol3) {}
|
||||
bool operator() (const cv::Mat& in1, const cv::Mat& in2) const
|
||||
{
|
||||
bool a = (cv::countNonZero((in1 - in2) > 0) <= _tol1 * in2.total());
|
||||
return (((a == 1 ? 0 : 1) &&
|
||||
((cv::countNonZero((in1 - in2) > 1) <= _tol2 * in2.total()) == 1 ? 0 : 1) &&
|
||||
((cv::countNonZero((in1 - in2) > 2) <= _tol3 * in2.total()) == 1 ? 0 : 1))) == 1 ? false : true;
|
||||
}
|
||||
private:
|
||||
double _tol1, _tol2, _tol3;
|
||||
};
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(RGB2GrayTestFluid, RGB2GrayTest,
|
||||
Combine(Values(cv::Size(1280, 720),
|
||||
Combine(Values(AbsToleranceRGBBGRFluid(0.001).to_compare_f()),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(true, false),
|
||||
Values(cv::compile_args(IMGPROC_FLUID))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(BGR2GrayTestFluid, BGR2GrayTest,
|
||||
Combine(Values(cv::Size(1280, 720),
|
||||
Combine(Values(AbsToleranceRGBBGRFluid(0.001).to_compare_f()),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(true, false),
|
||||
Values(cv::compile_args(IMGPROC_FLUID))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(RGB2YUVTestFluid, RGB2YUVTest,
|
||||
Combine(Values(cv::Size(1280, 720),
|
||||
Combine(Values(AbsToleranceRGBBGRFluid(0.15*3).to_compare_f()),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(true, false),
|
||||
Values(cv::compile_args(IMGPROC_FLUID))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(YUV2RGBTestFluid, YUV2RGBTest,
|
||||
Combine(Values(cv::Size(1280, 720),
|
||||
Combine(Values(ToleranceTripleFluid(0.25 * 3, 0.01 * 3, 1e-5 * 3).to_compare_f()),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(true, false),
|
||||
Values(cv::compile_args(IMGPROC_FLUID))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(RGB2LabTestFluid, RGB2LabTest,
|
||||
Combine(Values(cv::Size(1280, 720),
|
||||
Combine(Values(ToleranceTripleFluid(0.25 * 3, 0.0, 1e-5 * 3).to_compare_f()),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(true, false),
|
||||
Values(cv::compile_args(IMGPROC_FLUID))));
|
||||
|
||||
// FIXME: Not supported by Fluid yet (no kernel implemented)
|
||||
INSTANTIATE_TEST_CASE_P(BGR2LUVTestFluid, BGR2LUVTest,
|
||||
Combine(Values(cv::Size(1280, 720),
|
||||
Combine(Values(ToleranceTripleFluid(0.25 * 3, 0.01 * 3, 0.0001 * 3).to_compare_f()),
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(true, false),
|
||||
Values(cv::compile_args(IMGPROC_FLUID))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(blurTestFluid, BlurTest,
|
||||
Combine(Values(CV_8UC1, CV_16UC1, CV_16SC1),
|
||||
Combine(Values(AbsToleranceFluid(0.0).to_compare_f()),
|
||||
Values(CV_8UC1, CV_16UC1, CV_16SC1),
|
||||
Values(3), // add kernel size=5 when implementation is ready
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(cv::BORDER_DEFAULT),
|
||||
Values(0.0),
|
||||
Values(true, false),
|
||||
Values(cv::compile_args(IMGPROC_FLUID))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(gaussBlurTestFluid, GaussianBlurTest,
|
||||
Combine(Values(CV_8UC1, CV_16UC1, CV_16SC1),
|
||||
Combine(Values(AbsToleranceGaussianBlurFluid(1e-6).to_compare_f()),
|
||||
Values(CV_8UC1, CV_16UC1, CV_16SC1),
|
||||
Values(3), // add kernel size=5 when implementation is ready
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
@@ -70,7 +178,8 @@ INSTANTIATE_TEST_CASE_P(gaussBlurTestFluid, GaussianBlurTest,
|
||||
Values(cv::compile_args(IMGPROC_FLUID))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(medianBlurTestFluid, MedianBlurTest,
|
||||
Combine(Values(CV_8UC1, CV_16UC1, CV_16SC1),
|
||||
Combine(Values(AbsExactFluid().to_compare_f()),
|
||||
Values(CV_8UC1, CV_16UC1, CV_16SC1),
|
||||
Values(3), // add kernel size=5 when implementation is ready
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
@@ -78,7 +187,8 @@ INSTANTIATE_TEST_CASE_P(medianBlurTestFluid, MedianBlurTest,
|
||||
Values(cv::compile_args(IMGPROC_FLUID))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(erodeTestFluid, ErodeTest,
|
||||
Combine(Values(CV_8UC1, CV_16UC1, CV_16SC1),
|
||||
Combine(Values(AbsExactFluid().to_compare_f()),
|
||||
Values(CV_8UC1, CV_16UC1, CV_16SC1),
|
||||
Values(3), // add kernel size=5 when implementation is ready
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
@@ -89,7 +199,8 @@ INSTANTIATE_TEST_CASE_P(erodeTestFluid, ErodeTest,
|
||||
Values(cv::compile_args(IMGPROC_FLUID))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(dilateTestFluid, DilateTest,
|
||||
Combine(Values(CV_8UC1, CV_16UC1, CV_16SC1),
|
||||
Combine(Values(AbsExactFluid().to_compare_f()),
|
||||
Values(CV_8UC1, CV_16UC1, CV_16SC1),
|
||||
Values(3), // add kernel size=5 when implementation is ready
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
@@ -100,7 +211,8 @@ INSTANTIATE_TEST_CASE_P(dilateTestFluid, DilateTest,
|
||||
Values(cv::compile_args(IMGPROC_FLUID))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(SobelTestFluid, SobelTest,
|
||||
Combine(Values(CV_8UC1, CV_16UC1, CV_16SC1),
|
||||
Combine(Values(AbsExactFluid().to_compare_f()),
|
||||
Values(CV_8UC1, CV_16UC1, CV_16SC1),
|
||||
Values(3), // add kernel size=5 when implementation is ready
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
@@ -110,20 +222,20 @@ INSTANTIATE_TEST_CASE_P(SobelTestFluid, SobelTest,
|
||||
Values(true, false),
|
||||
Values(cv::compile_args(IMGPROC_FLUID))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(boxFilterTestFluid, BoxFilterTest,
|
||||
Combine(Values(CV_8UC1, CV_16UC1, CV_16SC1),
|
||||
INSTANTIATE_TEST_CASE_P(boxFilterTestFluid32, BoxFilterTest,
|
||||
Combine(Values(AbsTolerance32FFluid(1e-6).to_compare_f()),
|
||||
Values(CV_8UC1, CV_16UC1, CV_16SC1),
|
||||
Values(3), // add kernel size=5 when implementation is ready
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
Values(cv::BORDER_DEFAULT),
|
||||
Values(-1, CV_32F),
|
||||
Values(0.0),
|
||||
Values(true, false),
|
||||
Values(cv::compile_args(IMGPROC_FLUID))));
|
||||
|
||||
// FIXME: Tests are failing on Fluid backend (accuracy issue?)
|
||||
INSTANTIATE_TEST_CASE_P(sepFilterTestFluid, SepFilterTest,
|
||||
Combine(Values(CV_32FC1),
|
||||
Combine(Values(AbsToleranceSepFilterFluid(1e-5f).to_compare_f()),
|
||||
Values(CV_32FC1),
|
||||
Values(3), // add kernel size=5 when implementation is ready
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480)),
|
||||
@@ -132,7 +244,8 @@ INSTANTIATE_TEST_CASE_P(sepFilterTestFluid, SepFilterTest,
|
||||
Values(cv::compile_args(IMGPROC_FLUID))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(filter2DTestFluid, Filter2DTest,
|
||||
Combine(Values(CV_8UC1, CV_16UC1, CV_16SC1),
|
||||
Combine(Values(AbsTolerance32FFluid(1e-6).to_compare_f()),
|
||||
Values(CV_8UC1, CV_16UC1, CV_16SC1),
|
||||
Values(3), // add kernel size=4,5,7 when implementation ready
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480),
|
||||
|
||||
Reference in New Issue
Block a user