lk_track.py description

This commit is contained in:
Alexander Mordvintsev 2011-08-30 09:34:06 +00:00
parent 39373cd9f9
commit 785428546b
2 changed files with 22 additions and 8 deletions

View File

@ -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 )

View File

@ -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__':