Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
12615593
Commit
12615593
authored
Nov 18, 2019
by
Ruslan Garnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed own::Mat::empty() for non md case
parent
af230ec1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
mat.hpp
modules/gapi/include/opencv2/gapi/own/mat.hpp
+1
-1
mat_tests.cpp
modules/gapi/test/own/mat_tests.cpp
+7
-1
No files found.
modules/gapi/include/opencv2/gapi/own/mat.hpp
View file @
12615593
...
...
@@ -286,7 +286,7 @@ namespace cv { namespace gapi { namespace own {
*/
bool
empty
()
const
{
return
data
==
0
||
total
()
==
0
||
dims
.
empty
()
;
return
data
==
0
||
total
()
==
0
;
}
/** @brief Returns the total number of array elements.
...
...
modules/gapi/test/own/mat_tests.cpp
View file @
12615593
...
...
@@ -24,6 +24,7 @@ TEST(OwnMat, DefaultConstruction)
ASSERT_EQ
(
m
.
type
(),
0
);
ASSERT_EQ
(
m
.
depth
(),
0
);
ASSERT_TRUE
(
m
.
dims
.
empty
());
ASSERT_TRUE
(
m
.
empty
());
}
TEST
(
OwnMat
,
Create
)
...
...
@@ -42,6 +43,7 @@ TEST(OwnMat, Create)
ASSERT_EQ
(
m
.
elemSize
(),
sizeof
(
uint8_t
));
ASSERT_EQ
(
m
.
step
,
sizeof
(
uint8_t
)
*
m
.
cols
);
ASSERT_TRUE
(
m
.
dims
.
empty
());
ASSERT_FALSE
(
m
.
empty
());
}
TEST
(
OwnMat
,
CreateND
)
...
...
@@ -60,6 +62,7 @@ TEST(OwnMat, CreateND)
ASSERT_EQ
(
sizeof
(
float
)
,
m
.
elemSize
());
ASSERT_EQ
(
0u
,
m
.
step
);
ASSERT_EQ
(
dims
,
m
.
dims
);
ASSERT_FALSE
(
m
.
empty
());
}
TEST
(
OwnMat
,
CreateOverload
)
...
...
@@ -78,6 +81,7 @@ TEST(OwnMat, CreateOverload)
ASSERT_EQ
(
m
.
elemSize
(),
sizeof
(
uint8_t
));
ASSERT_EQ
(
m
.
step
,
sizeof
(
uint8_t
)
*
m
.
cols
);
ASSERT_TRUE
(
m
.
dims
.
empty
());
ASSERT_FALSE
(
m
.
empty
());
}
TEST
(
OwnMat
,
Create3chan
)
...
...
@@ -95,6 +99,7 @@ TEST(OwnMat, Create3chan)
ASSERT_EQ
(
m
.
elemSize
(),
3
*
sizeof
(
uint8_t
));
ASSERT_EQ
(
m
.
step
,
3
*
sizeof
(
uint8_t
)
*
m
.
cols
);
ASSERT_TRUE
(
m
.
dims
.
empty
());
ASSERT_FALSE
(
m
.
empty
());
}
struct
NonEmptyMat
{
...
...
@@ -116,7 +121,8 @@ namespace {
mat
.
type
(),
mat
.
depth
(),
mat
.
channels
(),
mat
.
dims
mat
.
dims
,
mat
.
empty
()
);
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment