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
20afae5a
Commit
20afae5a
authored
Feb 28, 2019
by
berak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: fix mat matx multiplication
parent
5fd47352
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
mat.hpp
modules/core/include/opencv2/core/mat.hpp
+2
-2
test_mat.cpp
modules/core/test/test_mat.cpp
+16
-0
No files found.
modules/core/include/opencv2/core/mat.hpp
View file @
20afae5a
...
@@ -3627,9 +3627,9 @@ CV_EXPORTS MatExpr operator * (const MatExpr& e, double s);
...
@@ -3627,9 +3627,9 @@ CV_EXPORTS MatExpr operator * (const MatExpr& e, double s);
CV_EXPORTS
MatExpr
operator
*
(
double
s
,
const
MatExpr
&
e
);
CV_EXPORTS
MatExpr
operator
*
(
double
s
,
const
MatExpr
&
e
);
CV_EXPORTS
MatExpr
operator
*
(
const
MatExpr
&
e1
,
const
MatExpr
&
e2
);
CV_EXPORTS
MatExpr
operator
*
(
const
MatExpr
&
e1
,
const
MatExpr
&
e2
);
template
<
typename
_Tp
,
int
m
,
int
n
>
static
inline
template
<
typename
_Tp
,
int
m
,
int
n
>
static
inline
MatExpr
operator
*
(
const
Mat
&
a
,
const
Matx
<
_Tp
,
m
,
n
>&
b
)
{
return
a
+
Mat
(
b
);
}
MatExpr
operator
*
(
const
Mat
&
a
,
const
Matx
<
_Tp
,
m
,
n
>&
b
)
{
return
a
*
Mat
(
b
);
}
template
<
typename
_Tp
,
int
m
,
int
n
>
static
inline
template
<
typename
_Tp
,
int
m
,
int
n
>
static
inline
MatExpr
operator
*
(
const
Matx
<
_Tp
,
m
,
n
>&
a
,
const
Mat
&
b
)
{
return
Mat
(
a
)
+
b
;
}
MatExpr
operator
*
(
const
Matx
<
_Tp
,
m
,
n
>&
a
,
const
Mat
&
b
)
{
return
Mat
(
a
)
*
b
;
}
CV_EXPORTS
MatExpr
operator
/
(
const
Mat
&
a
,
const
Mat
&
b
);
CV_EXPORTS
MatExpr
operator
/
(
const
Mat
&
a
,
const
Mat
&
b
);
CV_EXPORTS
MatExpr
operator
/
(
const
Mat
&
a
,
double
s
);
CV_EXPORTS
MatExpr
operator
/
(
const
Mat
&
a
,
double
s
);
...
...
modules/core/test/test_mat.cpp
View file @
20afae5a
...
@@ -2001,6 +2001,22 @@ TEST(Core_Vectors, issue_13078_workaround)
...
@@ -2001,6 +2001,22 @@ TEST(Core_Vectors, issue_13078_workaround)
ASSERT_EQ
(
7
,
ints
[
3
]);
ASSERT_EQ
(
7
,
ints
[
3
]);
}
}
TEST
(
Core_MatExpr
,
issue_13926
)
{
Mat
M1
=
(
Mat_
<
double
>
(
4
,
4
,
CV_64FC1
)
<<
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
);
Matx44d
M2
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
);
EXPECT_GE
(
1e-6
,
cvtest
::
norm
(
M1
*
M2
,
M1
*
M1
,
NORM_INF
))
<<
Mat
(
M1
*
M2
)
<<
std
::
endl
<<
Mat
(
M1
*
M1
);
EXPECT_GE
(
1e-6
,
cvtest
::
norm
(
M2
*
M1
,
M2
*
M2
,
NORM_INF
))
<<
Mat
(
M2
*
M1
)
<<
std
::
endl
<<
Mat
(
M2
*
M2
);
}
#ifdef HAVE_EIGEN
#ifdef HAVE_EIGEN
TEST
(
Core_Eigen
,
eigen2cv_check_Mat_type
)
TEST
(
Core_Eigen
,
eigen2cv_check_Mat_type
)
...
...
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