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
3a8df603
Commit
3a8df603
authored
Nov 20, 2010
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes Mat::empty() and Mat::create() in the case of zero sizes (ticket #691)
parent
5f15cf64
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
mat.hpp
modules/core/include/opencv2/core/mat.hpp
+1
-1
matrix.cpp
modules/core/src/matrix.cpp
+1
-1
No files found.
modules/core/include/opencv2/core/mat.hpp
View file @
3a8df603
...
...
@@ -414,7 +414,7 @@ inline int Mat::type() const { return CV_MAT_TYPE(flags); }
inline
int
Mat
::
depth
()
const
{
return
CV_MAT_DEPTH
(
flags
);
}
inline
int
Mat
::
channels
()
const
{
return
CV_MAT_CN
(
flags
);
}
inline
size_t
Mat
::
step1
(
int
i
)
const
{
return
step
.
p
[
i
]
/
elemSize1
();
}
inline
bool
Mat
::
empty
()
const
{
return
data
==
0
||
size
.
p
[
0
]
==
0
;
}
inline
bool
Mat
::
empty
()
const
{
return
data
==
0
||
total
()
==
0
;
}
inline
size_t
Mat
::
total
()
const
{
if
(
dims
<=
2
)
...
...
modules/core/src/matrix.cpp
View file @
3a8df603
...
...
@@ -205,7 +205,7 @@ void Mat::create(int d, const int* _sizes, int _type)
flags
=
(
_type
&
CV_MAT_TYPE_MASK
)
|
MAGIC_VAL
;
setSize
(
*
this
,
d
,
_sizes
,
0
,
allocator
==
0
);
if
(
size
.
p
[
0
]
>
0
)
if
(
total
()
>
0
)
{
if
(
!
allocator
)
{
...
...
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