// 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.
//
-// Copyright (C) 2018 Intel Corporation
+// Copyright (C) 2018-2019 Intel Corporation
#include "test_precomp.hpp"
EXPECT_EQ(480, desc2.size.height);
}
+TEST(GAPI_MetaDesc, VecMatDesc)
+{
+ std::vector<cv::Mat> vec1 = {
+ cv::Mat(240, 320, CV_8U)};
+
+ const auto desc1 = cv::descr_of(vec1);
+ EXPECT_EQ((GMatDesc{CV_8U, 1, {320, 240}}), get<GMatDesc>(desc1[0]));
+
+ std::vector<cv::UMat> vec2 = {
+ cv::UMat(480, 640, CV_8UC3)};
+
+ const auto desc2 = cv::descr_of(vec2);
+ EXPECT_EQ((GMatDesc{CV_8U, 3, {640, 480}}), get<GMatDesc>(desc2[0]));
+}
+
+TEST(GAPI_MetaDesc, VecOwnMatDesc)
+{
+ std::vector<cv::gapi::own::Mat> vec = {
+ cv::gapi::own::Mat(240, 320, CV_8U, nullptr),
+ cv::gapi::own::Mat(480, 640, CV_8UC3, nullptr)};
+
+ const auto desc = cv::gapi::own::descr_of(vec);
+ EXPECT_EQ((GMatDesc{CV_8U, 1, {320, 240}}), get<GMatDesc>(desc[0]));
+ EXPECT_EQ((GMatDesc{CV_8U, 3, {640, 480}}), get<GMatDesc>(desc[1]));
+}
+
+TEST(GAPI_MetaDesc, AdlVecOwnMatDesc)
+{
+ std::vector<cv::gapi::own::Mat> vec = {
+ cv::gapi::own::Mat(240, 320, CV_8U, nullptr),
+ cv::gapi::own::Mat(480, 640, CV_8UC3, nullptr)};
+
+ const auto desc = descr_of(vec);
+ EXPECT_EQ((GMatDesc{CV_8U, 1, {320, 240}}), get<GMatDesc>(desc[0]));
+ EXPECT_EQ((GMatDesc{CV_8U, 3, {640, 480}}), get<GMatDesc>(desc[1]));
+}
+
TEST(GAPI_MetaDesc, Compare_Equal_MatDesc)
{
const auto desc1 = cv::GMatDesc{CV_8U, 1, {64, 64}};