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
78542854
Commit
78542854
authored
Aug 30, 2011
by
Alexander Mordvintsev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lk_track.py description
parent
39373cd9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
8 deletions
+22
-8
_coverage.py
samples/python2/_coverage.py
+3
-0
lk_track.py
samples/python2/lk_track.py
+19
-8
No files found.
samples/python2/_coverage.py
View file @
78542854
...
...
@@ -11,6 +11,9 @@ for fn in glob('*.py'):
found
|=
set
(
re
.
findall
(
'cv2?
\
.
\
w+'
,
code
))
cv2_used
=
found
&
cv2_callable
cv2_unused
=
cv2_callable
-
cv2_used
with
open
(
'unused_api.txt'
,
'w'
)
as
f
:
f
.
write
(
'
\n
'
.
join
(
sorted
(
cv2_unused
)))
r
=
1.0
*
len
(
cv2_used
)
/
len
(
cv2_callable
)
print
'
\n
cv2 api coverage:
%
d /
%
d (
%.1
f
%%
)'
%
(
len
(
cv2_used
),
len
(
cv2_callable
),
r
*
100
)
...
...
samples/python2/lk_track.py
View file @
78542854
'''
Lucas-Kanade tracker
====================
Lucas-Kanade sparse optical flow demo. Uses goodFeaturesToTrack
for track initialization and back-tracking for match verification
between frames.
Usage
-----
lk_track.py [<video_source>]
Keys
----
ESC - exit
'''
import
numpy
as
np
import
cv2
import
video
from
common
import
anorm2
,
draw_str
from
time
import
clock
help_message
=
'''
USAGE: lk_track.py [<video_source>]
Keys:
SPACE - reset features
'''
lk_params
=
dict
(
winSize
=
(
15
,
15
),
maxLevel
=
2
,
criteria
=
(
cv2
.
TERM_CRITERIA_EPS
|
cv2
.
TERM_CRITERIA_COUNT
,
10
,
0.03
),
...
...
@@ -79,7 +90,7 @@ def main():
try
:
video_src
=
sys
.
argv
[
1
]
except
:
video_src
=
0
print
help_message
print
__doc__
App
(
video_src
)
.
run
()
if
__name__
==
'__main__'
:
...
...
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