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
71cbd6f0
Commit
71cbd6f0
authored
Jul 19, 2016
by
Ilya Lavrenov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed bug #5775
parent
644c0dd5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
arithm.cpp
modules/core/src/arithm.cpp
+1
-1
test_arithm.cpp
modules/core/test/test_arithm.cpp
+18
-0
No files found.
modules/core/src/arithm.cpp
View file @
71cbd6f0
...
...
@@ -643,7 +643,7 @@ static void arithm_op(InputArray _src1, InputArray _src2, OutputArray _dst,
if
(
!
muldiv
)
{
Mat
sc
=
psrc2
->
getMat
();
depth2
=
actualScalarDepth
(
sc
.
ptr
<
double
>
(),
cn
);
depth2
=
actualScalarDepth
(
sc
.
ptr
<
double
>
(),
sz2
==
Size
(
1
,
1
)
?
cn2
:
cn
);
if
(
depth2
==
CV_64F
&&
(
depth1
<
CV_32S
||
depth1
==
CV_32F
)
)
depth2
=
CV_32F
;
}
...
...
modules/core/test/test_arithm.cpp
View file @
71cbd6f0
...
...
@@ -1910,3 +1910,21 @@ TEST(MinMaxLoc, regression_4955_nans)
cv
::
Mat
nan_mat
(
2
,
2
,
CV_32F
,
cv
::
Scalar
(
NAN
));
cv
::
minMaxLoc
(
nan_mat
,
NULL
,
NULL
,
NULL
,
NULL
);
}
TEST
(
Subtract
,
scalarc1_matc3
)
{
int
scalar
=
255
;
cv
::
Mat
srcImage
(
5
,
5
,
CV_8UC3
,
cv
::
Scalar
::
all
(
5
)),
destImage
;
cv
::
subtract
(
scalar
,
srcImage
,
destImage
);
ASSERT_EQ
(
0
,
cv
::
norm
(
cv
::
Mat
(
5
,
5
,
CV_8UC3
,
cv
::
Scalar
::
all
(
250
)),
destImage
,
cv
::
NORM_INF
));
}
TEST
(
Subtract
,
scalarc4_matc4
)
{
cv
::
Scalar
sc
(
255
,
255
,
255
,
255
);
cv
::
Mat
srcImage
(
5
,
5
,
CV_8UC4
,
cv
::
Scalar
::
all
(
5
)),
destImage
;
cv
::
subtract
(
sc
,
srcImage
,
destImage
);
ASSERT_EQ
(
0
,
cv
::
norm
(
cv
::
Mat
(
5
,
5
,
CV_8UC4
,
cv
::
Scalar
::
all
(
250
)),
destImage
,
cv
::
NORM_INF
));
}
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