@ -40,6 +40,45 @@ TEST(GAPI_MetaDesc, MatDesc)
EXPECT_EQ ( 480 , desc2 . size . height ) ;
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 ( CV_8U , desc1 [ 0 ] . depth ) ;
EXPECT_EQ ( 1 , desc1 [ 0 ] . chan ) ;
EXPECT_EQ ( 320 , desc1 [ 0 ] . size . width ) ;
EXPECT_EQ ( 240 , desc1 [ 0 ] . size . height ) ;
std : : vector < cv : : UMat > vec2 = {
cv : : UMat ( 480 , 640 , CV_8UC3 ) } ;
const auto desc2 = cv : : descr_of ( vec2 ) ;
EXPECT_EQ ( CV_8U , desc2 [ 0 ] . depth ) ;
EXPECT_EQ ( 3 , desc2 [ 0 ] . chan ) ;
EXPECT_EQ ( 640 , desc2 [ 0 ] . size . width ) ;
EXPECT_EQ ( 480 , desc2 [ 0 ] . size . height ) ;
}
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 ( CV_8U , desc [ 0 ] . depth ) ;
EXPECT_EQ ( 1 , desc [ 0 ] . chan ) ;
EXPECT_EQ ( 320 , desc [ 0 ] . size . width ) ;
EXPECT_EQ ( 240 , desc [ 0 ] . size . height ) ;
EXPECT_EQ ( CV_8U , desc [ 1 ] . depth ) ;
EXPECT_EQ ( 3 , desc [ 1 ] . chan ) ;
EXPECT_EQ ( 640 , desc [ 1 ] . size . width ) ;
EXPECT_EQ ( 480 , desc [ 1 ] . size . height ) ;
}
TEST ( GAPI_MetaDesc , Compare_Equal_MatDesc )
TEST ( GAPI_MetaDesc , Compare_Equal_MatDesc )
{
{
const auto desc1 = cv : : GMatDesc { CV_8U , 1 , { 64 , 64 } } ;
const auto desc1 = cv : : GMatDesc { CV_8U , 1 , { 64 , 64 } } ;