mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 06:03:15 +08:00
lk_track.py description
This commit is contained in:
parent
39373cd9f9
commit
785428546b
@ -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 '\ncv2 api coverage: %d / %d (%.1f%%)' % ( len(cv2_used), len(cv2_callable), r*100 )
|
||||
|
@ -1,16 +1,27 @@
|
||||
'''
|
||||
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__':
|
||||
|
Loading…
Reference in New Issue
Block a user