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
c038d1be
Commit
c038d1be
authored
Dec 16, 2016
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7858 from addisonElliott:master
parents
faefbf93
fa6692af
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
0 deletions
+77
-0
mat.hpp
modules/core/include/opencv2/core/mat.hpp
+39
-0
mat.inl.hpp
modules/core/include/opencv2/core/mat.inl.hpp
+17
-0
matrix.cpp
modules/core/src/matrix.cpp
+16
-0
umatrix.cpp
modules/core/src/umatrix.cpp
+5
-0
No files found.
modules/core/include/opencv2/core/mat.hpp
View file @
c038d1be
...
...
@@ -794,6 +794,13 @@ public:
*/
Mat
(
int
ndims
,
const
int
*
sizes
,
int
type
);
/** @overload
@param sizes Array of integers specifying an n-dimensional array shape.
@param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or
CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
*/
Mat
(
const
std
::
vector
<
int
>&
sizes
,
int
type
);
/** @overload
@param ndims Array dimensionality.
@param sizes Array of integers specifying an n-dimensional array shape.
...
...
@@ -805,6 +812,17 @@ public:
*/
Mat
(
int
ndims
,
const
int
*
sizes
,
int
type
,
const
Scalar
&
s
);
/** @overload
@param sizes Array of integers specifying an n-dimensional array shape.
@param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or
CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
@param s An optional value to initialize each matrix element with. To set all the matrix elements to
the particular value after the construction, use the assignment operator
Mat::operator=(const Scalar& value) .
*/
Mat
(
const
std
::
vector
<
int
>&
sizes
,
int
type
,
const
Scalar
&
s
);
/** @overload
@param m Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied
by these constructors. Instead, the header pointing to m data or its sub-array is constructed and
...
...
@@ -861,6 +879,20 @@ public:
*/
Mat
(
int
ndims
,
const
int
*
sizes
,
int
type
,
void
*
data
,
const
size_t
*
steps
=
0
);
/** @overload
@param sizes Array of integers specifying an n-dimensional array shape.
@param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or
CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
@param data Pointer to the user data. Matrix constructors that take data and step parameters do not
allocate matrix data. Instead, they just initialize the matrix header that points to the specified
data, which means that no data is copied. This operation is very efficient and can be used to
process external data using OpenCV functions. The external data is not automatically deallocated, so
you should take care of it.
@param steps Array of ndims-1 steps in case of a multi-dimensional array (the last step is always
set to the element size). If not specified, the matrix is assumed to be continuous.
*/
Mat
(
const
std
::
vector
<
int
>&
sizes
,
int
type
,
void
*
data
,
const
size_t
*
steps
=
0
);
/** @overload
@param m Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied
by these constructors. Instead, the header pointing to m data or its sub-array is constructed and
...
...
@@ -1328,6 +1360,12 @@ public:
*/
void
create
(
int
ndims
,
const
int
*
sizes
,
int
type
);
/** @overload
@param sizes Array of integers specifying a new array shape.
@param type New matrix type.
*/
void
create
(
const
std
::
vector
<
int
>&
sizes
,
int
type
);
/** @brief Increments the reference counter.
The method increments the reference counter associated with the matrix data. If the matrix header
...
...
@@ -2273,6 +2311,7 @@ public:
void
create
(
int
rows
,
int
cols
,
int
type
,
UMatUsageFlags
usageFlags
=
USAGE_DEFAULT
);
void
create
(
Size
size
,
int
type
,
UMatUsageFlags
usageFlags
=
USAGE_DEFAULT
);
void
create
(
int
ndims
,
const
int
*
sizes
,
int
type
,
UMatUsageFlags
usageFlags
=
USAGE_DEFAULT
);
void
create
(
const
std
::
vector
<
int
>&
sizes
,
int
type
,
UMatUsageFlags
usageFlags
=
USAGE_DEFAULT
);
//! increases the reference counter; use with care to avoid memleaks
void
addref
();
...
...
modules/core/include/opencv2/core/mat.inl.hpp
View file @
c038d1be
...
...
@@ -386,6 +386,23 @@ Mat::Mat(int _dims, const int* _sz, int _type, const Scalar& _s)
*
this
=
_s
;
}
inline
Mat
::
Mat
(
const
std
::
vector
<
int
>&
_sz
,
int
_type
)
:
flags
(
MAGIC_VAL
),
dims
(
0
),
rows
(
0
),
cols
(
0
),
data
(
0
),
datastart
(
0
),
dataend
(
0
),
datalimit
(
0
),
allocator
(
0
),
u
(
0
),
size
(
&
rows
)
{
create
(
_sz
,
_type
);
}
inline
Mat
::
Mat
(
const
std
::
vector
<
int
>&
_sz
,
int
_type
,
const
Scalar
&
_s
)
:
flags
(
MAGIC_VAL
),
dims
(
0
),
rows
(
0
),
cols
(
0
),
data
(
0
),
datastart
(
0
),
dataend
(
0
),
datalimit
(
0
),
allocator
(
0
),
u
(
0
),
size
(
&
rows
)
{
create
(
_sz
,
_type
);
*
this
=
_s
;
}
inline
Mat
::
Mat
(
const
Mat
&
m
)
:
flags
(
m
.
flags
),
dims
(
m
.
dims
),
rows
(
m
.
rows
),
cols
(
m
.
cols
),
data
(
m
.
data
),
...
...
modules/core/src/matrix.cpp
View file @
c038d1be
...
...
@@ -439,6 +439,11 @@ void Mat::create(int d, const int* _sizes, int _type)
finalizeHdr
(
*
this
);
}
void
Mat
::
create
(
const
std
::
vector
<
int
>&
_sizes
,
int
_type
)
{
create
((
int
)
_sizes
.
size
(),
_sizes
.
data
(),
_type
);
}
void
Mat
::
copySize
(
const
Mat
&
m
)
{
setSize
(
*
this
,
m
.
dims
,
0
,
0
);
...
...
@@ -541,6 +546,17 @@ Mat::Mat(int _dims, const int* _sizes, int _type, void* _data, const size_t* _st
}
Mat
::
Mat
(
const
std
::
vector
<
int
>&
_sizes
,
int
_type
,
void
*
_data
,
const
size_t
*
_steps
)
:
flags
(
MAGIC_VAL
),
dims
(
0
),
rows
(
0
),
cols
(
0
),
data
(
0
),
datastart
(
0
),
dataend
(
0
),
datalimit
(
0
),
allocator
(
0
),
u
(
0
),
size
(
&
rows
)
{
flags
|=
CV_MAT_TYPE
(
_type
);
datastart
=
data
=
(
uchar
*
)
_data
;
setSize
(
*
this
,
(
int
)
_sizes
.
size
(),
_sizes
.
data
(),
_steps
,
true
);
finalizeHdr
(
*
this
);
}
Mat
::
Mat
(
const
Mat
&
m
,
const
Range
*
ranges
)
:
flags
(
MAGIC_VAL
),
dims
(
0
),
rows
(
0
),
cols
(
0
),
data
(
0
),
datastart
(
0
),
dataend
(
0
),
datalimit
(
0
),
allocator
(
0
),
u
(
0
),
size
(
&
rows
)
...
...
modules/core/src/umatrix.cpp
View file @
c038d1be
...
...
@@ -386,6 +386,11 @@ void UMat::create(int d, const int* _sizes, int _type, UMatUsageFlags _usageFlag
addref
();
}
void
UMat
::
create
(
const
std
::
vector
<
int
>&
_sizes
,
int
_type
,
UMatUsageFlags
_usageFlags
)
{
create
((
int
)
_sizes
.
size
(),
_sizes
.
data
(),
_type
,
_usageFlags
);
}
void
UMat
::
copySize
(
const
UMat
&
m
)
{
setSize
(
*
this
,
m
.
dims
,
0
,
0
);
...
...
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