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
8f910d2d
Commit
8f910d2d
authored
Dec 17, 2019
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #16083 from alalek:issue_14961
parents
287874a4
fd4fac94
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
4 deletions
+29
-4
gapi_tests_common.hpp
modules/gapi/test/common/gapi_tests_common.hpp
+29
-4
No files found.
modules/gapi/test/common/gapi_tests_common.hpp
View file @
8f910d2d
...
...
@@ -74,7 +74,7 @@ public:
cv
::
Scalar
initScalarRandU
(
unsigned
upper
)
{
auto
&
rng
=
cv
::
theRNG
();
double
s1
=
rng
(
upper
);
double
s1
=
rng
(
upper
);
// FIXIT: RNG result is 'int', not double
double
s2
=
rng
(
upper
);
double
s3
=
rng
(
upper
);
double
s4
=
rng
(
upper
);
...
...
@@ -97,8 +97,23 @@ public:
sc
=
initScalarRandU
(
100
);
cv
::
randu
(
in_mat1
,
cv
::
Scalar
::
all
(
0
),
cv
::
Scalar
::
all
(
255
));
cv
::
randu
(
in_mat2
,
cv
::
Scalar
::
all
(
0
),
cv
::
Scalar
::
all
(
255
));
// Details: https://github.com/opencv/opencv/pull/16083
//if (CV_MAT_DEPTH(type) < CV_32F)
if
(
1
)
{
cv
::
randu
(
in_mat1
,
cv
::
Scalar
::
all
(
0
),
cv
::
Scalar
::
all
(
255
));
cv
::
randu
(
in_mat2
,
cv
::
Scalar
::
all
(
0
),
cv
::
Scalar
::
all
(
255
));
}
else
{
const
int
fscale
=
256
;
// avoid bits near ULP, generate stable test input
Mat
in_mat32s
(
in_mat1
.
size
(),
CV_MAKE_TYPE
(
CV_32S
,
CV_MAT_CN
(
type
)));
cv
::
randu
(
in_mat32s
,
cv
::
Scalar
::
all
(
0
),
cv
::
Scalar
::
all
(
255
*
fscale
));
in_mat32s
.
convertTo
(
in_mat1
,
type
,
1.0
f
/
fscale
,
0
);
cv
::
randu
(
in_mat32s
,
cv
::
Scalar
::
all
(
0
),
cv
::
Scalar
::
all
(
255
*
fscale
));
in_mat32s
.
convertTo
(
in_mat2
,
type
,
1.0
f
/
fscale
,
0
);
}
if
(
createOutputMatrices
)
{
...
...
@@ -111,7 +126,17 @@ public:
in_mat1
=
cv
::
Mat
(
sz_in
,
type
);
sc
=
initScalarRandU
(
100
);
cv
::
randu
(
in_mat1
,
cv
::
Scalar
::
all
(
0
),
cv
::
Scalar
::
all
(
255
));
if
(
CV_MAT_DEPTH
(
type
)
<
CV_32F
)
{
cv
::
randu
(
in_mat1
,
cv
::
Scalar
::
all
(
0
),
cv
::
Scalar
::
all
(
255
));
}
else
{
const
int
fscale
=
256
;
// avoid bits near ULP, generate stable test input
Mat
in_mat32s
(
in_mat1
.
size
(),
CV_MAKE_TYPE
(
CV_32S
,
CV_MAT_CN
(
type
)));
cv
::
randu
(
in_mat32s
,
cv
::
Scalar
::
all
(
0
),
cv
::
Scalar
::
all
(
255
*
fscale
));
in_mat32s
.
convertTo
(
in_mat1
,
type
,
1.0
f
/
fscale
,
0
);
}
if
(
createOutputMatrices
)
{
...
...
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