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
60a4e81a
Commit
60a4e81a
authored
Jul 23, 2010
by
Andrey Morozov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small modifications in tests
parent
edd68e58
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
8 deletions
+17
-8
convert_to.cpp
tests/gpu/src/convert_to.cpp
+9
-5
operator_copy_to.cpp
tests/gpu/src/operator_copy_to.cpp
+7
-2
operator_set_to.cpp
tests/gpu/src/operator_set_to.cpp
+1
-1
No files found.
tests/gpu/src/convert_to.cpp
View file @
60a4e81a
...
...
@@ -19,7 +19,7 @@ class CV_GpuMatOpConvertTo : public CvTest
void
run
(
int
);
};
CV_GpuMatOpConvertTo
::
CV_GpuMatOpConvertTo
()
:
CvTest
(
"G
pu
MatOperatorConvertTo"
,
"convertTo"
)
{}
CV_GpuMatOpConvertTo
::
CV_GpuMatOpConvertTo
()
:
CvTest
(
"G
PU-
MatOperatorConvertTo"
,
"convertTo"
)
{}
CV_GpuMatOpConvertTo
::~
CV_GpuMatOpConvertTo
()
{}
void
CV_GpuMatOpConvertTo
::
run
(
int
/* start_from */
)
...
...
@@ -44,12 +44,16 @@ void CV_GpuMatOpConvertTo::run( int /* start_from */)
const
double
alpha
=
(
double
)
rand
()
/
RAND_MAX
*
10.0
;
const
double
beta
=
(
double
)
rand
()
/
RAND_MAX
*
10.0
;
Mat
cpumatsrc
(
img_size
,
src_type
);
randu
(
cpumatsrc
,
Scalar
::
all
(
0
),
Scalar
::
all
(
10
));
cv
::
RNG
rng
(
*
ts
->
get_rng
());
Mat
cpumatsrc
(
img_size
,
src_type
);
rng
.
fill
(
cpumatsrc
,
RNG
::
UNIFORM
,
Scalar
::
all
(
0
),
Scalar
::
all
(
10
));
GpuMat
gpumatsrc
(
cpumatsrc
);
Mat
cpumatdst
;
GpuMat
gpumatdst
;
cpumatsrc
.
convertTo
(
cpumatdst
,
dst_type
,
alpha
,
beta
);
try
...
...
@@ -65,7 +69,7 @@ void CV_GpuMatOpConvertTo::run( int /* start_from */)
double
r
=
norm
(
cpumatdst
,
gpumatdst
,
NORM_INF
);
if
(
r
>
1
)
{
{
cout
<<
"FAILED: "
<<
"SRC_TYPE="
<<
types_str
[
i
]
<<
"C"
<<
c
<<
" DST_TYPE="
<<
types_str
[
j
]
<<
" NORM = "
<<
r
<<
endl
;
passed
=
false
;
...
...
tests/gpu/src/operator_copy_to.cpp
View file @
60a4e81a
...
...
@@ -32,7 +32,7 @@ class CV_GpuMatOpCopyTo : public CvTest
int
cols
;
};
CV_GpuMatOpCopyTo
::
CV_GpuMatOpCopyTo
()
:
CvTest
(
"G
pu
MatOperatorCopyTo"
,
"copyTo"
)
CV_GpuMatOpCopyTo
::
CV_GpuMatOpCopyTo
()
:
CvTest
(
"G
PU-
MatOperatorCopyTo"
,
"copyTo"
)
{
rows
=
234
;
cols
=
123
;
...
...
@@ -54,8 +54,13 @@ bool CV_GpuMatOpCopyTo::compare_matrix(cv::Mat & cpumat, gpu::GpuMat & gpumat)
GpuMat
gmat
(
cmat
);
Mat
cpumask
(
cpumat
.
size
(),
CV_8U
);
randu
(
cpumask
,
Scalar
::
all
(
0
),
Scalar
::
all
(
127
));
cv
::
RNG
rng
(
*
ts
->
get_rng
());
rng
.
fill
(
cpumask
,
RNG
::
NORMAL
,
Scalar
::
all
(
0
),
Scalar
::
all
(
127
));
threshold
(
cpumask
,
cpumask
,
0
,
127
,
THRESH_BINARY
);
GpuMat
gpumask
(
cpumask
);
//int64 time = getTickCount();
...
...
tests/gpu/src/operator_set_to.cpp
View file @
60a4e81a
...
...
@@ -30,7 +30,7 @@ class CV_GpuMatOpSetTo : public CvTest
Scalar
s
;
};
CV_GpuMatOpSetTo
::
CV_GpuMatOpSetTo
()
:
CvTest
(
"G
pu
MatOperatorSetTo"
,
"setTo"
)
CV_GpuMatOpSetTo
::
CV_GpuMatOpSetTo
()
:
CvTest
(
"G
PU-
MatOperatorSetTo"
,
"setTo"
)
{
rows
=
256
;
cols
=
124
;
...
...
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