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
469aef2e
Commit
469aef2e
authored
Dec 28, 2013
by
Ilya Lavrenov
Committed by
Alexander Smorkalov
Feb 10, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed bug #3341
(cherry picked from commit
09d25e11
)
parent
5e00fc6a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
arithm.cpp
modules/core/src/arithm.cpp
+2
-2
test_arithm.cpp
modules/core/test/test_arithm.cpp
+16
-0
No files found.
modules/core/src/arithm.cpp
View file @
469aef2e
...
...
@@ -1272,8 +1272,8 @@ static void arithm_op(InputArray _src1, InputArray _src2, OutputArray _dst,
bool
haveScalar
=
false
,
swapped12
=
false
;
int
depth2
=
src2
.
depth
();
if
(
src1
.
size
!=
src2
.
size
||
src1
.
channels
()
!=
src2
.
channels
()
||
(
(
kind1
==
_InputArray
::
MATX
||
kind2
==
_InputArray
::
MATX
)
&&
src1
.
cols
==
1
&&
src2
.
rows
==
4
)
)
(
kind1
==
_InputArray
::
MATX
&&
(
src1
.
size
()
==
Size
(
1
,
4
)
||
src1
.
size
()
==
Size
(
1
,
1
)))
||
(
kind2
==
_InputArray
::
MATX
&&
(
src2
.
size
()
==
Size
(
1
,
4
)
||
src2
.
size
()
==
Size
(
1
,
1
))
)
)
{
if
(
checkScalar
(
src1
,
src2
.
type
(),
kind1
,
kind2
)
)
{
...
...
modules/core/test/test_arithm.cpp
View file @
469aef2e
...
...
@@ -1564,3 +1564,19 @@ TEST(Core_round, CvRound)
ASSERT_EQ
(
-
2
,
cvRound
(
-
2.5
));
ASSERT_EQ
(
-
4
,
cvRound
(
-
3.5
));
}
typedef
testing
::
TestWithParam
<
Size
>
Mul1
;
TEST_P
(
Mul1
,
One
)
{
Size
size
=
GetParam
();
cv
::
Mat
src
(
size
,
CV_32FC1
,
cv
::
Scalar
::
all
(
2
)),
dst
,
ref_dst
(
size
,
CV_32FC1
,
cv
::
Scalar
::
all
(
6
));
cv
::
multiply
(
3
,
src
,
dst
);
ASSERT_EQ
(
0
,
cv
::
norm
(
dst
,
ref_dst
,
cv
::
NORM_INF
));
}
INSTANTIATE_TEST_CASE_P
(
Arithm
,
Mul1
,
testing
::
Values
(
Size
(
2
,
2
),
Size
(
1
,
1
)));
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