From 160fac43f864d04e3a9d0300971350578e932503 Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Sat, 5 Nov 2016 18:43:05 +0000 Subject: [PATCH] - run forever if --seconds==0 git-svn-id: http://moon:8086/svn/software/trunk/projects/opencv@348 b431acfa-c32f-4a4a-93f1-934dc6c82436 --- lasertrack.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lasertrack.py b/lasertrack.py index bff74d4..5f289da 100755 --- a/lasertrack.py +++ b/lasertrack.py @@ -24,7 +24,7 @@ from piCameraPipeline.VideoSource import VideoSource # construct the argument parse and parse the arguments ap = argparse.ArgumentParser() -ap.add_argument("-n", "--seconds", type=int, default=10, +ap.add_argument("-n", "--seconds", type=int, default=0, help="# of seconds to run") ap.add_argument("-r", "--framerate", type=int, default=30, help="Framerate in frame/s") @@ -216,7 +216,12 @@ if with_ev3: print("[INFO] sampling THREADED frames from `" + videoFile + "` at " + str(framerate) + " frame/s") try: - time.sleep(seconds) + if seconds != 0: + time.sleep(seconds) + else: + while True: + time.sleep(1.0) + except(KeyboardInterrupt): print ("\nKeyboardInterrupt") @@ -230,7 +235,12 @@ else: print("[INFO] sampling THREADED frames from `" + videoFile + "` at " + str(framerate) + " frame/s") try: - time.sleep(seconds) + if seconds != 0: + time.sleep(seconds) + else: + while True: + time.sleep(1.0) + except(KeyboardInterrupt): print ("\nKeyboardInterrupt")