def timer(self):
"""docstring for timer"""
if self.RUN:
# print 'New Frame', self.idx
flag = time.time()
self.readIMG() # read new frame
self.correlation_tracker() # update correlation_tracker(s)
# self.display() # display img and boxes
self.checkState()
self.singleLog()
# self.log()
time_consumed = time.time() - flag
if time_consumed > 0.04:
print 'Time > 40 ms!'
Timer(0, self.timer).start() # excuted instantly
else:
Timer(0.04 - time_consumed, self.timer).start() # excute this function every 40 ms
return
评论列表
文章目录