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
4f965296
Commit
4f965296
authored
Dec 28, 2012
by
Suenghoon Park
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modified performance test for ocl::HoughCircles
parent
0afa9ced
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
51 deletions
+17
-51
perf_hough.cpp
modules/ocl/perf/perf_hough.cpp
+17
-51
No files found.
modules/ocl/perf/perf_hough.cpp
View file @
4f965296
...
@@ -50,22 +50,18 @@ using namespace perf;
...
@@ -50,22 +50,18 @@ using namespace perf;
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
// HoughCircles
// HoughCircles
PARAM_TEST_CASE
(
HoughCircles_Perf
,
cv
::
Size
,
float
,
float
)
typedef
std
::
tr1
::
tuple
<
cv
::
Size
,
float
,
float
>
Size_Dp_MinDist_t
;
{
typedef
perf
::
TestBaseWithParam
<
Size_Dp_MinDist_t
>
Size_Dp_MinDist
;
static
void
drawCircles
(
cv
::
Mat
&
dst
,
const
std
::
vector
<
cv
::
Vec3f
>&
circles
,
bool
fill
)
{
dst
.
setTo
(
cv
::
Scalar
::
all
(
0
));
for
(
size_t
i
=
0
;
i
<
circles
.
size
();
++
i
)
cv
::
circle
(
dst
,
cv
::
Point2f
(
circles
[
i
][
0
],
circles
[
i
][
1
]),
(
int
)
circles
[
i
][
2
],
cv
::
Scalar
::
all
(
255
),
fill
?
-
1
:
1
);
}
};
TEST_P
(
HoughCircles_Perf
,
Performance
)
PERF_TEST_P
(
Size_Dp_MinDist
,
OCL_HoughCircles
,
testing
::
Combine
(
testing
::
Values
(
perf
::
sz720p
,
perf
::
szSXGA
,
perf
::
sz1080p
),
testing
::
Values
(
1.0
f
,
2.0
f
,
4.0
f
),
testing
::
Values
(
1.0
f
,
10.0
f
)))
{
{
const
cv
::
Size
size
=
GET_PARAM
(
0
);
const
cv
::
Size
size
=
std
::
tr1
::
get
<
0
>
(
GetParam
()
);
const
float
dp
=
GET_PARAM
(
1
);
const
float
dp
=
std
::
tr1
::
get
<
1
>
(
GetParam
()
);
const
float
minDist
=
GET_PARAM
(
2
);
const
float
minDist
=
std
::
tr1
::
get
<
2
>
(
GetParam
()
);
const
int
minRadius
=
10
;
const
int
minRadius
=
10
;
const
int
maxRadius
=
30
;
const
int
maxRadius
=
30
;
...
@@ -85,48 +81,18 @@ TEST_P(HoughCircles_Perf, Performance)
...
@@ -85,48 +81,18 @@ TEST_P(HoughCircles_Perf, Performance)
cv
::
circle
(
src
,
center
,
radius
,
cv
::
Scalar
::
all
(
255
),
-
1
);
cv
::
circle
(
src
,
center
,
radius
,
cv
::
Scalar
::
all
(
255
),
-
1
);
}
}
cv
::
ocl
::
oclMat
d_circles
;
cv
::
ocl
::
oclMat
ocl_src
(
src
);
cv
::
ocl
::
oclMat
ocl_circles
;
double
totalgputick
=
0
;
declare
.
time
(
10.0
).
iterations
(
25
);
double
totalgputick_kernel
=
0
;
double
t1
=
0.0
;
TEST_CYCLE
()
double
t2
=
0.0
;
for
(
int
j
=
0
;
j
<
LOOP_TIMES
+
1
;
++
j
)
{
{
cv
::
ocl
::
HoughCircles
(
ocl_src
,
ocl_circles
,
CV_HOUGH_GRADIENT
,
dp
,
minDist
,
cannyThreshold
,
votesThreshold
,
minRadius
,
maxRadius
);
t1
=
(
double
)
cvGetTickCount
();
//gpu start1
cv
::
ocl
::
oclMat
ocl_src
=
cv
::
ocl
::
oclMat
(
src
);
//upload
t2
=
(
double
)
cvGetTickCount
();
//kernel
cv
::
ocl
::
HoughCircles
(
ocl_src
,
d_circles
,
CV_HOUGH_GRADIENT
,
dp
,
minDist
,
cannyThreshold
,
votesThreshold
,
minRadius
,
maxRadius
);
t2
=
(
double
)
cvGetTickCount
()
-
t2
;
//kernel
cv
::
Mat
cpu_dst
;
if
(
d_circles
.
rows
>
0
)
d_circles
.
download
(
cpu_dst
);
//download
t1
=
(
double
)
cvGetTickCount
()
-
t1
;
//gpu end1
if
(
j
==
0
)
continue
;
totalgputick
=
t1
+
totalgputick
;
totalgputick_kernel
=
t2
+
totalgputick_kernel
;
}
}
std
::
cout
<<
"average gpu runtime is "
<<
totalgputick
/
((
double
)
cvGetTickFrequency
()
*
LOOP_TIMES
*
1000.
)
<<
"ms"
<<
std
::
endl
;
cv
::
Mat
circles
(
ocl_circles
);
std
::
cout
<<
"average gpu runtime without data transfer is "
<<
totalgputick_kernel
/
((
double
)
cvGetTickFrequency
()
*
LOOP_TIMES
*
1000.
)
<<
"ms"
<<
std
::
endl
;
SANITY_CHECK
(
circles
);
}
}
INSTANTIATE_TEST_CASE_P
(
Hough
,
HoughCircles_Perf
,
testing
::
Combine
(
testing
::
Values
(
perf
::
sz720p
,
perf
::
szSXGA
,
perf
::
sz1080p
),
testing
::
Values
(
1.0
f
,
2.0
f
,
4.0
f
),
testing
::
Values
(
1.0
f
,
10.0
f
)));
#endif // HAVE_OPENCL
#endif // HAVE_OPENCL
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