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
93944861
Commit
93944861
authored
Jun 16, 2015
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix issue 3891
parent
424c2bdd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
mat.inl.hpp
modules/core/include/opencv2/core/mat.inl.hpp
+12
-0
test_mat.cpp
modules/core/test/test_mat.cpp
+1
-1
No files found.
modules/core/include/opencv2/core/mat.inl.hpp
View file @
93944861
...
...
@@ -1586,7 +1586,13 @@ template<typename _Tp> template<int n> inline
Mat_
<
_Tp
>::
operator
Vec
<
typename
DataType
<
_Tp
>::
channel_type
,
n
>
()
const
{
CV_Assert
(
n
%
DataType
<
_Tp
>::
channels
==
0
);
#if defined _MSC_VER
const
Mat
*
pMat
=
(
const
Mat
*
)
this
;
// workaround for MSVS <= 2012 compiler bugs (but GCC 4.6 dislikes this workaround)
return
pMat
->
operator
Vec
<
typename
DataType
<
_Tp
>::
channel_type
,
n
>
();
#else
return
this
->
Mat
::
operator
Vec
<
typename
DataType
<
_Tp
>::
channel_type
,
n
>
();
#endif
}
template
<
typename
_Tp
>
template
<
int
m
,
int
n
>
inline
...
...
@@ -1594,8 +1600,14 @@ Mat_<_Tp>::operator Matx<typename DataType<_Tp>::channel_type, m, n>() const
{
CV_Assert
(
n
%
DataType
<
_Tp
>::
channels
==
0
);
#if defined _MSC_VER
const
Mat
*
pMat
=
(
const
Mat
*
)
this
;
// workaround for MSVS <= 2012 compiler bugs (but GCC 4.6 dislikes this workaround)
Matx
<
typename
DataType
<
_Tp
>::
channel_type
,
m
,
n
>
res
=
pMat
->
operator
Matx
<
typename
DataType
<
_Tp
>::
channel_type
,
m
,
n
>
();
return
res
;
#else
Matx
<
typename
DataType
<
_Tp
>::
channel_type
,
m
,
n
>
res
=
this
->
Mat
::
operator
Matx
<
typename
DataType
<
_Tp
>::
channel_type
,
m
,
n
>
();
return
res
;
#endif
}
template
<
typename
_Tp
>
inline
...
...
modules/core/test/test_mat.cpp
View file @
93944861
...
...
@@ -1214,7 +1214,7 @@ TEST(Core_Matx, fromMat_)
{
Mat_
<
double
>
a
=
(
Mat_
<
double
>
(
2
,
2
)
<<
10
,
11
,
12
,
13
);
Matx22d
b
(
a
);
ASSERT_EQ
(
norm
(
a
,
b
,
NORM_INF
),
0.
);
ASSERT_EQ
(
cvtest
::
norm
(
a
,
b
,
NORM_INF
),
0.
);
}
TEST
(
Core_InputArray
,
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