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
0d7a37c1
Commit
0d7a37c1
authored
Jul 21, 2011
by
Maria Dimashova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added an ability to make push_back to the empty matrix
parent
3a1beb1c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
mat.hpp
modules/core/include/opencv2/core/mat.hpp
+5
-0
matrix.cpp
modules/core/src/matrix.cpp
+5
-0
No files found.
modules/core/include/opencv2/core/mat.hpp
View file @
0d7a37c1
...
...
@@ -675,6 +675,11 @@ template<typename _Tp, int m, int n> inline Mat::operator Matx<_Tp, m, n>() cons
template
<
typename
_Tp
>
inline
void
Mat
::
push_back
(
const
_Tp
&
elem
)
{
if
(
!
data
)
{
*
this
=
Mat
(
1
,
1
,
DataType
<
_Tp
>::
type
,
(
void
*
)
&
elem
).
clone
();
return
;
}
CV_Assert
(
DataType
<
_Tp
>::
type
==
type
()
&&
cols
==
1
/* && dims == 2 (cols == 1 implies dims == 2) */
);
uchar
*
tmp
=
dataend
+
step
[
0
];
...
...
modules/core/src/matrix.cpp
View file @
0d7a37c1
...
...
@@ -585,6 +585,11 @@ void Mat::push_back(const Mat& elems)
push_back
(
tmp
);
return
;
}
if
(
!
data
)
{
*
this
=
elems
.
clone
();
return
;
}
size
.
p
[
0
]
=
elems
.
size
.
p
[
0
];
bool
eq
=
size
==
elems
.
size
;
...
...
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