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
aad41042
Commit
aad41042
authored
Aug 01, 2014
by
vbystricky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix accurency test for OpenCL matrix operations
parent
05164bf7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
test_matrix_operation.cpp
modules/core/test/ocl/test_matrix_operation.cpp
+7
-5
No files found.
modules/core/test/ocl/test_matrix_operation.cpp
View file @
aad41042
...
...
@@ -96,7 +96,7 @@ OCL_TEST_P(ConvertTo, Accuracy)
OCL_OFF
(
src_roi
.
convertTo
(
dst_roi
,
dstType
,
alpha
,
beta
));
OCL_ON
(
usrc_roi
.
convertTo
(
udst_roi
,
dstType
,
alpha
,
beta
));
double
eps
=
src_depth
>=
CV_32F
||
CV_MAT_DEPTH
(
dstType
)
>=
CV_32F
?
1
e-4
:
1
;
double
eps
=
src_depth
>=
CV_32F
||
CV_MAT_DEPTH
(
dstType
)
>=
CV_32F
?
2
e-4
:
1
;
OCL_EXPECT_MATS_NEAR
(
dst
,
eps
);
}
}
...
...
@@ -121,7 +121,7 @@ PARAM_TEST_CASE(CopyTo, MatDepth, Channels, bool, bool)
use_mask
=
GET_PARAM
(
3
);
}
void
generateTestData
()
void
generateTestData
(
bool
one_cn_mask
=
false
)
{
const
int
type
=
CV_MAKE_TYPE
(
depth
,
cn
);
...
...
@@ -132,9 +132,11 @@ PARAM_TEST_CASE(CopyTo, MatDepth, Channels, bool, bool)
if
(
use_mask
)
{
Border
maskBorder
=
randomBorder
(
0
,
use_roi
?
MAX_VALUE
:
0
);
int
mask_cn
=
randomDouble
(
0.0
,
2.0
)
>
1.0
?
cn
:
1
;
int
mask_cn
=
1
;
if
(
!
one_cn_mask
&&
randomDouble
(
0.0
,
2.0
)
>
1.0
)
mask_cn
=
cn
;
randomSubMat
(
mask
,
mask_roi
,
roiSize
,
maskBorder
,
CV_8UC
(
mask_cn
),
0
,
2
);
cv
::
threshold
(
mask
,
mask
,
0.5
,
255.
,
CV_8UC1
);
cv
::
threshold
(
mask
,
mask
,
0.5
,
255.
,
THRESH_BINARY
);
}
Border
dstBorder
=
randomBorder
(
0
,
use_roi
?
MAX_VALUE
:
0
);
...
...
@@ -177,7 +179,7 @@ OCL_TEST_P(SetTo, Accuracy)
{
for
(
int
j
=
0
;
j
<
test_loop_times
;
j
++
)
{
generateTestData
();
generateTestData
(
true
);
// see modules/core/src/umatrix.cpp Ln:791 => CV_Assert( mask.size() == size() && mask.type() == CV_8UC1
);
if
(
use_mask
)
{
...
...
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