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
397a6353
Commit
397a6353
authored
Jan 25, 2011
by
Alexey Spizhevoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed bug in performance test matrix generation
parent
7e3c69c8
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
23 deletions
+14
-23
performance.cpp
samples/gpu/performance/performance.cpp
+2
-12
performance.h
samples/gpu/performance/performance.h
+2
-2
tests.cpp
samples/gpu/performance/tests.cpp
+10
-9
No files found.
samples/gpu/performance/performance.cpp
View file @
397a6353
...
...
@@ -4,22 +4,12 @@
using
namespace
std
;
using
namespace
cv
;
void
Test
::
gen
(
Mat
&
mat
,
int
rows
,
int
cols
,
int
type
)
void
Test
::
gen
(
Mat
&
mat
,
int
rows
,
int
cols
,
int
type
,
Scalar
low
,
Scalar
high
)
{
mat
.
create
(
rows
,
cols
,
type
);
Mat
mat8u
(
rows
,
cols
*
mat
.
elemSize
(),
CV_8U
,
mat
.
data
,
mat
.
step
);
RNG
rng
(
0
);
rng
.
fill
(
mat
,
RNG
::
UNIFORM
,
Scalar
(
0
),
Scalar
(
256
));
}
void
Test
::
gen
(
Mat
&
mat
,
int
rows
,
int
cols
,
int
type
,
double
low
,
double
high
)
{
mat
.
create
(
rows
,
cols
,
type
);
RNG
rng
(
0
);
rng
.
fill
(
mat
,
RNG
::
UNIFORM
,
Scalar
::
all
(
low
),
Scalar
::
all
(
high
));
rng
.
fill
(
mat
,
RNG
::
UNIFORM
,
low
,
high
);
}
...
...
samples/gpu/performance/performance.h
View file @
397a6353
...
...
@@ -14,8 +14,8 @@ public:
const
std
::
string
&
name
()
const
{
return
name_
;
}
void
gen
(
cv
::
Mat
&
mat
,
int
rows
,
int
cols
,
int
type
);
void
gen
(
cv
::
Mat
&
mat
,
int
rows
,
int
cols
,
int
type
,
double
low
,
double
high
);
void
gen
(
cv
::
Mat
&
mat
,
int
rows
,
int
cols
,
int
type
,
cv
::
Scalar
low
,
cv
::
Scalar
high
);
virtual
void
run
()
=
0
;
...
...
samples/gpu/performance/tests.cpp
View file @
397a6353
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/gpu/gpu.hpp>
#include "performance.h"
...
...
@@ -8,7 +9,7 @@ using namespace cv;
TEST
(
matchTemplate
)
{
Mat
image
,
templ
,
result
;
gen
(
image
,
3000
,
3000
,
CV_32F
);
gen
(
image
,
3000
,
3000
,
CV_32F
,
0
,
1
);
gpu
::
GpuMat
d_image
(
image
),
d_templ
,
d_result
;
...
...
@@ -16,7 +17,7 @@ TEST(matchTemplate)
{
SUBTEST
<<
"img "
<<
image
.
rows
<<
", templ "
<<
templ_size
<<
", 32F, CCORR"
;
gen
(
templ
,
templ_size
,
templ_size
,
CV_32F
);
gen
(
templ
,
templ_size
,
templ_size
,
CV_32F
,
0
,
1
);
CPU_ON
;
matchTemplate
(
image
,
templ
,
result
,
CV_TM_CCORR
);
...
...
@@ -43,7 +44,7 @@ TEST(minMaxLoc)
{
SUBTEST
<<
"img "
<<
size
<<
", 32F, no mask"
;
gen
(
src
,
size
,
size
,
CV_32F
);
gen
(
src
,
size
,
size
,
CV_32F
,
0
,
1
);
CPU_ON
;
minMaxLoc
(
src
,
&
min_val
,
&
max_val
,
&
min_loc
,
&
max_loc
);
...
...
@@ -67,9 +68,9 @@ TEST(remap)
{
SUBTEST
<<
"img "
<<
size
<<
" and 8UC1, 32FC1 maps"
;
gen
(
src
,
size
,
size
,
CV_8UC1
);
gen
(
xmap
,
size
,
size
,
CV_32F
C1
,
0
,
size
);
gen
(
ymap
,
size
,
size
,
CV_32F
C1
,
0
,
size
);
gen
(
src
,
size
,
size
,
CV_8UC1
,
0
,
256
);
gen
(
xmap
,
size
,
size
,
CV_32F
,
0
,
size
);
gen
(
ymap
,
size
,
size
,
CV_32F
,
0
,
size
);
CPU_ON
;
remap
(
src
,
dst
,
xmap
,
ymap
,
INTER_LINEAR
);
...
...
@@ -91,11 +92,11 @@ TEST(dft)
Mat
src
,
dst
;
gpu
::
GpuMat
d_src
,
d_dst
;
for
(
int
size
=
1000
;
size
<=
4000
;
size
+=
1000
)
for
(
int
size
=
1000
;
size
<=
4000
;
size
*=
2
)
{
SUBTEST
<<
"size "
<<
size
<<
", 32FC2, complex-to-complex"
;
gen
(
src
,
size
,
size
,
CV_32FC2
);
gen
(
src
,
size
,
size
,
CV_32FC2
,
Scalar
::
all
(
0
),
Scalar
::
all
(
1
)
);
CPU_ON
;
dft
(
src
,
dst
);
...
...
@@ -119,7 +120,7 @@ TEST(cornerHarris)
{
SUBTEST
<<
"size "
<<
size
<<
", 32FC1"
;
gen
(
src
,
size
,
size
,
CV_32F
C
1
);
gen
(
src
,
size
,
size
,
CV_32F
,
0
,
1
);
CPU_ON
;
cornerHarris
(
src
,
dst
,
5
,
7
,
0.1
,
BORDER_REFLECT101
);
...
...
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