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
7a2a810d
Commit
7a2a810d
authored
Nov 06, 2013
by
Peng Xiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update retina_ocl.cpp
parent
8adebcbc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
12 deletions
+7
-12
retina_ocl.cpp
samples/ocl/retina_ocl.cpp
+7
-12
No files found.
samples/ocl/retina_ocl.cpp
View file @
7a2a810d
...
...
@@ -26,7 +26,7 @@ int main(int argc, char* argv[])
ocl
::
setBinaryDiskCache
();
const
char
*
keys
=
"{ h | help | false | print help message }"
"{ c |
use_cpp | false | use cpp
(original version) or gpu(OpenCL) to process the image }"
"{ c |
cpu | false | use cpu
(original version) or gpu(OpenCL) to process the image }"
"{ i | image | cat.jpg | specify the input image }"
;
CommandLineParser
cmd
(
argc
,
argv
,
keys
);
...
...
@@ -38,12 +38,12 @@ int main(int argc, char* argv[])
}
String
fname
=
cmd
.
get
<
String
>
(
"i"
);
bool
useCP
P
=
cmd
.
get
<
bool
>
(
"c"
);
bool
useCP
U
=
cmd
.
get
<
bool
>
(
"c"
);
cv
::
Mat
input
=
imread
(
fname
);
if
(
input
.
empty
())
{
help
(
cmd
,
fname
+
" not found!"
);
help
(
cmd
,
"Error opening: "
+
fname
);
return
EXIT_FAILURE
;
}
//////////////////////////////////////////////////////////////////////////////
...
...
@@ -59,7 +59,7 @@ int main(int argc, char* argv[])
cv
::
Mat
retina_parvo
;
cv
::
Mat
retina_magno
;
if
(
useCP
P
)
if
(
useCP
U
)
{
retina
=
cv
::
bioinspired
::
createRetina
(
input
.
size
());
retina
->
clearBuffers
();
...
...
@@ -73,10 +73,9 @@ int main(int argc, char* argv[])
int64
temp_time
=
0
,
total_time
=
0
;
int
loop_counter
=
0
;
static
bool
initialized
=
false
;
for
(;
loop_counter
<=
total_loop_count
;
++
loop_counter
)
{
if
(
useCP
P
)
if
(
useCP
U
)
{
temp_time
=
cv
::
getTickCount
();
retina
->
run
(
input
);
...
...
@@ -92,17 +91,13 @@ int main(int argc, char* argv[])
oclRetina
->
getMagno
(
retina_magno_ocl
);
}
// will not count the first loop, which is considered as warm-up period
if
(
initialized
)
if
(
loop_counter
>
0
)
{
temp_time
=
(
cv
::
getTickCount
()
-
temp_time
);
total_time
+=
temp_time
;
printf
(
"Frame id %2d: %3.4fms
\n
"
,
loop_counter
,
(
double
)
temp_time
/
cv
::
getTickFrequency
()
*
1000.0
);
}
else
{
initialized
=
true
;
}
if
(
!
useCPP
)
if
(
!
useCPU
)
{
retina_parvo
=
retina_parvo_ocl
;
retina_magno
=
retina_magno_ocl
;
...
...
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