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
e63d6286
Commit
e63d6286
authored
Jul 20, 2017
by
Tomoaki Teshima
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove some rand functions
* make test more reproducible
parent
dcb3c4ff
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
23 deletions
+11
-23
test_undistort_points.cpp
modules/calib3d/test/test_undistort_points.cpp
+5
-8
test_eigen.cpp
modules/core/test/test_eigen.cpp
+2
-2
test_ippasync.cpp
modules/core/test/test_ippasync.cpp
+0
-11
test_halide_layers.cpp
modules/dnn/test/test_halide_layers.cpp
+2
-1
test_hdr.cpp
modules/photo/test/test_hdr.cpp
+2
-1
No files found.
modules/calib3d/test/test_undistort_points.cpp
View file @
e63d6286
...
...
@@ -29,16 +29,13 @@ CV_UndistortTest::~CV_UndistortTest() {}
void
CV_UndistortTest
::
generate3DPointCloud
(
vector
<
Point3f
>&
points
,
Point3f
pmin
,
Point3f
pmax
)
{
const
Point3f
delta
=
pmax
-
pmin
;
RNG
rng_Point
=
::
theRNG
();
// fix the seed to use "fixed" input 3D points
for
(
size_t
i
=
0
;
i
<
points
.
size
();
i
++
)
{
Point3f
p
(
float
(
rand
())
/
RAND_MAX
,
float
(
rand
())
/
RAND_MAX
,
float
(
rand
())
/
RAND_MAX
);
p
.
x
*=
delta
.
x
;
p
.
y
*=
delta
.
y
;
p
.
z
*=
delta
.
z
;
p
=
p
+
pmin
;
points
[
i
]
=
p
;
float
_x
=
rng_Point
.
uniform
(
pmin
.
x
,
pmax
.
x
);
float
_y
=
rng_Point
.
uniform
(
pmin
.
y
,
pmax
.
y
);
float
_z
=
rng_Point
.
uniform
(
pmin
.
z
,
pmax
.
z
);
points
[
i
]
=
Point3f
(
_x
,
_y
,
_z
);
}
}
void
CV_UndistortTest
::
generateCameraMatrix
(
Mat
&
cameraMatrix
)
...
...
modules/core/test/test_eigen.cpp
View file @
e63d6286
...
...
@@ -389,11 +389,11 @@ bool Core_EigenTest::check_full(int type)
{
const
int
MAX_DEGREE
=
7
;
srand
((
unsigned
int
)
time
(
0
));
RNG
rng
=
::
theRNG
();
// fix the seed
for
(
int
i
=
0
;
i
<
ntests
;
++
i
)
{
int
src_size
=
(
int
)(
std
::
pow
(
2.0
,
(
r
and
()
%
MAX_DEGREE
)
+
1.
));
int
src_size
=
(
int
)(
std
::
pow
(
2.0
,
(
r
ng
.
uniform
(
0
,
MAX_DEGREE
)
+
1.
)
));
cv
::
Mat
src
(
src_size
,
src_size
,
type
);
...
...
modules/core/test/test_ippasync.cpp
View file @
e63d6286
...
...
@@ -110,17 +110,6 @@ PARAM_TEST_CASE(IPPAsyncShared, Channels, hppAccelType)
sts
=
hppQueryMatrixAllocParams
(
accel
,
(
hpp32u
)(
matrix_Size
.
width
*
cn
),
(
hpp32u
)
matrix_Size
.
height
,
HPP_DATA_TYPE_8U
,
&
pitch
,
&
size
);
if
(
pitch
!=
0
&&
size
!=
0
)
{
uchar
*
pData
=
(
uchar
*
)
_aligned_malloc
(
size
,
4096
);
for
(
int
j
=
0
;
j
<
matrix_Size
.
height
;
j
++
)
for
(
int
i
=
0
;
i
<
matrix_Size
.
width
*
cn
;
i
++
)
pData
[
i
+
j
*
pitch
]
=
rand
()
%
upValue
;
matrix
=
Mat
(
matrix_Size
.
height
,
matrix_Size
.
width
,
type
,
pData
,
pitch
);
}
matrix
=
randomMat
(
matrix_Size
,
type
,
0
,
upValue
);
}
...
...
modules/dnn/test/test_halide_layers.cpp
View file @
e63d6286
...
...
@@ -612,10 +612,11 @@ TEST_P(Eltwise, Accuracy)
eltwiseParam
.
set
(
"operation"
,
op
);
if
(
op
==
"sum"
&&
weighted
)
{
RNG
rng
=
cv
::
theRNG
();
std
::
vector
<
float
>
coeff
(
1
+
numConv
);
for
(
int
i
=
0
;
i
<
coeff
.
size
();
++
i
)
{
coeff
[
i
]
=
((
float
)
rand
()
/
RAND_MAX
)
*
4
-
2
;
coeff
[
i
]
=
rng
.
uniform
(
-
2.0
f
,
2.0
f
)
;
}
eltwiseParam
.
set
(
"coeff"
,
DictValue
::
arrayReal
<
float
*>
(
&
coeff
[
0
],
coeff
.
size
()));
}
...
...
modules/photo/test/test_hdr.cpp
View file @
e63d6286
...
...
@@ -141,9 +141,10 @@ TEST(Photo_AlignMTB, regression)
int
errors
=
0
;
Ptr
<
AlignMTB
>
align
=
createAlignMTB
(
max_bits
);
RNG
rng
=
::
theRNG
();
for
(
int
i
=
0
;
i
<
TESTS_COUNT
;
i
++
)
{
Point
shift
(
r
and
()
%
max_shift
,
rand
()
%
max_shift
);
Point
shift
(
r
ng
.
uniform
(
0
,
max_shift
),
rng
.
uniform
(
0
,
max_shift
)
);
Mat
res
;
align
->
shiftMat
(
img
,
res
,
shift
);
Point
calc
=
align
->
calculateShift
(
img
,
res
);
...
...
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