Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
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_contrib
Commits
5bbca68d
Commit
5bbca68d
authored
Aug 16, 2017
by
Vladislav Sovrasov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bioinspired: add time measurement in sample
parent
ca7683ee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
retinaDemo.cpp
modules/bioinspired/samples/retinaDemo.cpp
+13
-7
No files found.
modules/bioinspired/samples/retinaDemo.cpp
View file @
5bbca68d
...
...
@@ -101,16 +101,23 @@ int main(int argc, char* argv[])
cv
::
UMat
retinaOutput_magno
;
// processing loop with stop condition
bool
continueProcessing
=
true
;
// FIXME : not yet managed during process...
while
(
continueProcessing
)
int64
totalTime
=
0
;
int64
totalFrames
=
0
;
while
(
true
)
{
// if using video stream, then, grabbing a new frame, else, input remains the same
if
(
videoCapture
.
isOpened
())
videoCapture
>>
inputFrame
;
if
(
inputFrame
.
empty
())
break
;
// run retina filter
int64
frameTime
=
cv
::
getTickCount
();
myRetina
->
run
(
inputFrame
);
// Retrieve and display retina output
frameTime
=
cv
::
getTickCount
()
-
frameTime
;
totalTime
+=
frameTime
;
totalFrames
++
;
myRetina
->
getParvo
(
retinaOutput_parvo
);
myRetina
->
getMagno
(
retinaOutput_magno
);
cv
::
imshow
(
"retina input"
,
inputFrame
);
...
...
@@ -121,13 +128,12 @@ int main(int argc, char* argv[])
if
(
key
==
'q'
)
break
;
}
}
catch
(
cv
::
Exception
e
)
std
::
cout
<<
"
\n
Mean frame processing time: "
<<
(
totalTime
/
cv
::
getTickFrequency
())
/
totalFrames
<<
" s"
<<
std
::
endl
;
std
::
cout
<<
"Retina demo end"
<<
std
::
endl
;
}
catch
(
const
cv
::
Exception
&
e
)
{
std
::
cerr
<<
"Error using Retina : "
<<
e
.
what
()
<<
std
::
endl
;
}
// Program end message
std
::
cout
<<
"Retina demo end"
<<
std
::
endl
;
return
0
;
}
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