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
ddfcaf9b
Commit
ddfcaf9b
authored
Jul 16, 2015
by
Kurnianggoro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change the timer using flann, higher precission
parent
ba6f122d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
multitracker.cpp
modules/tracking/samples/multitracker.cpp
+12
-6
No files found.
modules/tracking/samples/multitracker.cpp
View file @
ddfcaf9b
...
...
@@ -11,6 +11,7 @@
#include <opencv2/tracking.hpp>
#include <opencv2/videoio.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/flann.hpp>
#include <iostream>
#include <cstring>
#include <ctime>
...
...
@@ -66,7 +67,7 @@ int main( int argc, char** argv ){
}
// timer
c
lock_t
timer
;
c
vflann
::
StartStopTimer
timer
;
// for showing the speed
double
fps
;
...
...
@@ -116,18 +117,23 @@ int main( int argc, char** argv ){
if
(
frame
.
rows
==
0
||
frame
.
cols
==
0
)
break
;
// update the tracking result
timer
=
clock
();
// start the timer
timer
.
start
();
//update the tracking result
trackers
.
update
(
frame
);
timer
=
clock
()
-
timer
;
fps
=
(
double
)
CLOCKS_PER_SEC
/
(
double
)
timer
;
// calculate the processing speed
timer
.
stop
();
fps
=
1.0
/
timer
.
value
;
timer
.
reset
();
// draw the tracked object
for
(
unsigned
i
=
0
;
i
<
trackers
.
objects
.
size
();
i
++
)
rectangle
(
frame
,
trackers
.
objects
[
i
],
Scalar
(
255
,
0
,
0
),
2
,
1
);
// draw the processing speed
sprintf
(
buffer
,
"speed: %.0
2
f fps"
,
fps
);
sprintf
(
buffer
,
"speed: %.0f fps"
,
fps
);
text
=
buffer
;
putText
(
frame
,
text
,
Point
(
20
,
20
),
FONT_HERSHEY_PLAIN
,
1
,
Scalar
(
255
,
255
,
255
));
...
...
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