1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

copy kernels

This commit is contained in:
Dmitry Budnikov
2019-08-05 17:46:28 +03:00
parent 95eb199f41
commit 290078e0d0
10 changed files with 128 additions and 0 deletions
@@ -100,6 +100,7 @@ GAPI_TEST_FIXTURE(Merge4Test, initMatsRandU, <>, 0)
GAPI_TEST_FIXTURE(RemapTest, initMatrixRandU, <>, 0)
GAPI_TEST_FIXTURE(FlipTest, initMatrixRandU, FIXTURE_API(int), 1, flipCode)
GAPI_TEST_FIXTURE(CropTest, initMatrixRandU, FIXTURE_API(cv::Rect), 1, rect_to)
GAPI_TEST_FIXTURE(CopyTest, initMatrixRandU, <>, 0)
GAPI_TEST_FIXTURE(ConcatHorTest, initNothing, <>, 0)
GAPI_TEST_FIXTURE(ConcatVertTest, initNothing, <>, 0)
GAPI_TEST_FIXTURE(ConcatVertVecTest, initNothing, <>, 0)
@@ -1002,6 +1002,32 @@ TEST_P(CropTest, AccuracyTest)
}
}
TEST_P(CopyTest, AccuracyTest)
{
cv::Size sz_out = sz;
if (dtype != -1)
{
out_mat_gapi = cv::Mat(sz_out, dtype);
out_mat_ocv = cv::Mat(sz_out, dtype);
}
// G-API code //////////////////////////////////////////////////////////////
cv::GMat in;
auto out = cv::gapi::copy(in);
cv::GComputation c(in, out);
c.apply(in_mat1, out_mat_gapi, getCompileArgs());
// OpenCV code /////////////////////////////////////////////////////////////
{
cv::Mat(in_mat1).copyTo(out_mat_ocv);
}
// Comparison //////////////////////////////////////////////////////////////
{
EXPECT_EQ(0, cv::countNonZero(out_mat_ocv != out_mat_gapi));
EXPECT_EQ(out_mat_gapi.size(), sz_out);
}
}
TEST_P(ConcatHorTest, AccuracyTest)
{
cv::Size sz_out = sz;