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
1ded1597
Commit
1ded1597
authored
Sep 19, 2012
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed mixed-type array operations (bug #2336)
parent
738d3fef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
arithm.cpp
modules/core/src/arithm.cpp
+2
-3
test_operations.cpp
modules/core/test/test_operations.cpp
+8
-1
No files found.
modules/core/src/arithm.cpp
View file @
1ded1597
...
...
@@ -1224,7 +1224,7 @@ static void arithm_op(InputArray _src1, InputArray _src2, OutputArray _dst,
bool
haveMask
=
!
_mask
.
empty
();
bool
reallocate
=
false
;
if
(
kind1
==
kind2
&&
src1
.
dims
<=
2
&&
src2
.
dims
<=
2
&&
if
(
(
kind1
==
kind2
||
src1
.
channels
()
==
1
)
&&
src1
.
dims
<=
2
&&
src2
.
dims
<=
2
&&
src1
.
size
()
==
src2
.
size
()
&&
src1
.
type
()
==
src2
.
type
()
&&
!
haveMask
&&
((
!
_dst
.
fixedType
()
&&
(
dtype
<
0
||
CV_MAT_DEPTH
(
dtype
)
==
src1
.
depth
()))
||
(
_dst
.
fixedType
()
&&
_dst
.
type
()
==
_src1
.
type
()))
)
...
...
@@ -1238,8 +1238,7 @@ static void arithm_op(InputArray _src1, InputArray _src2, OutputArray _dst,
bool
haveScalar
=
false
,
swapped12
=
false
;
if
(
(
kind1
==
_InputArray
::
MATX
)
+
(
kind2
==
_InputArray
::
MATX
)
==
1
||
src1
.
size
!=
src2
.
size
||
src1
.
channels
()
!=
src2
.
channels
()
)
if
(
src1
.
size
!=
src2
.
size
||
src1
.
channels
()
!=
src2
.
channels
()
)
{
if
(
checkScalar
(
src1
,
src2
.
type
(),
kind1
,
kind2
)
)
{
...
...
modules/core/test/test_operations.cpp
View file @
1ded1597
...
...
@@ -959,9 +959,16 @@ bool CV_OperationsTest::operations1()
minval
==
-
7
&&
maxval
==
12
))
throw
test_excep
();
Matx33f
b
(
1.
f
,
2.
f
,
3.
f
,
4.
f
,
5.
f
,
6.
f
,
7.
f
,
8.
f
,
9.
f
),
c
;
Matx33f
b
(
1.
f
,
2.
f
,
3.
f
,
4.
f
,
5.
f
,
6.
f
,
7.
f
,
8.
f
,
9.
f
);
Mat
c
;
add
(
Mat
::
zeros
(
3
,
3
,
CV_32F
),
b
,
c
);
CV_Assert
(
norm
(
b
,
c
,
CV_C
)
==
0
);
add
(
Mat
::
zeros
(
3
,
3
,
CV_64F
),
b
,
c
,
noArray
(),
c
.
type
());
CV_Assert
(
norm
(
b
,
c
,
CV_C
)
==
0
);
add
(
Mat
::
zeros
(
6
,
1
,
CV_64F
),
1
,
c
,
noArray
(),
c
.
type
());
CV_Assert
(
norm
(
Matx61f
(
1.
f
,
1.
f
,
1.
f
,
1.
f
,
1.
f
,
1.
f
),
c
,
CV_C
)
==
0
);
}
catch
(
const
test_excep
&
)
{
...
...
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