updated video_threaded.py sample:
- switch btw threaded and non-threaded mode - performance counters - description
This commit is contained in:
@@ -126,6 +126,17 @@ def Timer(msg):
|
||||
finally:
|
||||
print "%.2f ms" % ((clock()-start)*1000)
|
||||
|
||||
class StatValue:
|
||||
def __init__(self, smooth_coef = 0.5):
|
||||
self.value = None
|
||||
self.smooth_coef = smooth_coef
|
||||
def update(self, v):
|
||||
if self.value is None:
|
||||
self.value = v
|
||||
else:
|
||||
c = self.smooth_coef
|
||||
self.value = c * self.value + (1.0-c) * v
|
||||
|
||||
class RectSelector:
|
||||
def __init__(self, win, callback):
|
||||
self.win = win
|
||||
|
Reference in New Issue
Block a user