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
ff90f273
Commit
ff90f273
authored
Jul 08, 2015
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4169 from alalek:issue_4457
parents
0b99f707
06617392
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
+11
-2
mat.inl.hpp
modules/core/include/opencv2/core/mat.inl.hpp
+4
-0
matop.cpp
modules/core/src/matop.cpp
+2
-2
test_mat.cpp
modules/core/test/test_mat.cpp
+5
-0
No files found.
modules/core/include/opencv2/core/mat.inl.hpp
View file @
ff90f273
...
@@ -397,6 +397,8 @@ Mat::Mat(int _rows, int _cols, int _type, void* _data, size_t _step)
...
@@ -397,6 +397,8 @@ Mat::Mat(int _rows, int _cols, int _type, void* _data, size_t _step)
data
((
uchar
*
)
_data
),
datastart
((
uchar
*
)
_data
),
dataend
(
0
),
datalimit
(
0
),
data
((
uchar
*
)
_data
),
datastart
((
uchar
*
)
_data
),
dataend
(
0
),
datalimit
(
0
),
allocator
(
0
),
u
(
0
),
size
(
&
rows
)
allocator
(
0
),
u
(
0
),
size
(
&
rows
)
{
{
CV_Assert
(
total
()
==
0
||
data
!=
NULL
);
size_t
esz
=
CV_ELEM_SIZE
(
_type
),
esz1
=
CV_ELEM_SIZE1
(
_type
);
size_t
esz
=
CV_ELEM_SIZE
(
_type
),
esz1
=
CV_ELEM_SIZE1
(
_type
);
size_t
minstep
=
cols
*
esz
;
size_t
minstep
=
cols
*
esz
;
if
(
_step
==
AUTO_STEP
)
if
(
_step
==
AUTO_STEP
)
...
@@ -428,6 +430,8 @@ Mat::Mat(Size _sz, int _type, void* _data, size_t _step)
...
@@ -428,6 +430,8 @@ Mat::Mat(Size _sz, int _type, void* _data, size_t _step)
data
((
uchar
*
)
_data
),
datastart
((
uchar
*
)
_data
),
dataend
(
0
),
datalimit
(
0
),
data
((
uchar
*
)
_data
),
datastart
((
uchar
*
)
_data
),
dataend
(
0
),
datalimit
(
0
),
allocator
(
0
),
u
(
0
),
size
(
&
rows
)
allocator
(
0
),
u
(
0
),
size
(
&
rows
)
{
{
CV_Assert
(
total
()
==
0
||
data
!=
NULL
);
size_t
esz
=
CV_ELEM_SIZE
(
_type
),
esz1
=
CV_ELEM_SIZE1
(
_type
);
size_t
esz
=
CV_ELEM_SIZE
(
_type
),
esz1
=
CV_ELEM_SIZE1
(
_type
);
size_t
minstep
=
cols
*
esz
;
size_t
minstep
=
cols
*
esz
;
if
(
_step
==
AUTO_STEP
)
if
(
_step
==
AUTO_STEP
)
...
...
modules/core/src/matop.cpp
View file @
ff90f273
...
@@ -1583,12 +1583,12 @@ void MatOp_Initializer::multiply(const MatExpr& e, double s, MatExpr& res) const
...
@@ -1583,12 +1583,12 @@ void MatOp_Initializer::multiply(const MatExpr& e, double s, MatExpr& res) const
inline
void
MatOp_Initializer
::
makeExpr
(
MatExpr
&
res
,
int
method
,
Size
sz
,
int
type
,
double
alpha
)
inline
void
MatOp_Initializer
::
makeExpr
(
MatExpr
&
res
,
int
method
,
Size
sz
,
int
type
,
double
alpha
)
{
{
res
=
MatExpr
(
getGlobalMatOpInitializer
(),
method
,
Mat
(
sz
,
type
,
(
void
*
)
0
),
Mat
(),
Mat
(),
alpha
,
0
);
res
=
MatExpr
(
getGlobalMatOpInitializer
(),
method
,
Mat
(
sz
,
type
,
(
void
*
)
0
xEEEEEEEE
),
Mat
(),
Mat
(),
alpha
,
0
);
}
}
inline
void
MatOp_Initializer
::
makeExpr
(
MatExpr
&
res
,
int
method
,
int
ndims
,
const
int
*
sizes
,
int
type
,
double
alpha
)
inline
void
MatOp_Initializer
::
makeExpr
(
MatExpr
&
res
,
int
method
,
int
ndims
,
const
int
*
sizes
,
int
type
,
double
alpha
)
{
{
res
=
MatExpr
(
getGlobalMatOpInitializer
(),
method
,
Mat
(
ndims
,
sizes
,
type
,
(
void
*
)
0
),
Mat
(),
Mat
(),
alpha
,
0
);
res
=
MatExpr
(
getGlobalMatOpInitializer
(),
method
,
Mat
(
ndims
,
sizes
,
type
,
(
void
*
)
0
xEEEEEEEE
),
Mat
(),
Mat
(),
alpha
,
0
);
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////
...
...
modules/core/test/test_mat.cpp
View file @
ff90f273
...
@@ -1178,6 +1178,11 @@ TEST(Core_IOArray, submat_create)
...
@@ -1178,6 +1178,11 @@ TEST(Core_IOArray, submat_create)
EXPECT_THROW
(
OutputArray_create2
(
A
.
row
(
0
)),
cv
::
Exception
);
EXPECT_THROW
(
OutputArray_create2
(
A
.
row
(
0
)),
cv
::
Exception
);
}
}
TEST
(
Core_Mat
,
issue4457_pass_null_ptr
)
{
ASSERT_ANY_THROW
(
cv
::
Mat
mask
(
45
,
45
,
CV_32F
,
0
));
}
TEST
(
Core_Mat
,
reshape_1942
)
TEST
(
Core_Mat
,
reshape_1942
)
{
{
cv
::
Mat
A
=
(
cv
::
Mat_
<
float
>
(
2
,
3
)
<<
3.4884074
,
1.4159607
,
0.78737736
,
2.3456569
,
-
0.88010466
,
0.3009364
);
cv
::
Mat
A
=
(
cv
::
Mat_
<
float
>
(
2
,
3
)
<<
3.4884074
,
1.4159607
,
0.78737736
,
2.3456569
,
-
0.88010466
,
0.3009364
);
...
...
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