From: Alexander Mordvintsev Date: Tue, 30 Aug 2011 09:34:06 +0000 (+0000) Subject: lk_track.py description X-Git-Tag: accepted/2.0/20130307.220821~1944 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=785428546beb3903b61d2c0bd1866f8013e6027d;p=profile%2Fivi%2Fopencv.git lk_track.py description --- diff --git a/samples/python2/_coverage.py b/samples/python2/_coverage.py index cdad18a..e64c7c9 100644 --- a/samples/python2/_coverage.py +++ b/samples/python2/_coverage.py @@ -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 ) diff --git a/samples/python2/lk_track.py b/samples/python2/lk_track.py index 10e3961..0cbd52e 100644 --- a/samples/python2/lk_track.py +++ b/samples/python2/lk_track.py @@ -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 [] + + +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 [] - -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__':