MCPcopy
hub / github.com/makelove/OpenCV-Python-Tutorial / StatValue

Class StatValue

官方samples/common.py:154–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152 print("%.2f ms" % ((clock()-start)*1000))
153
154class StatValue:
155 def __init__(self, smooth_coef = 0.5):
156 self.value = None
157 self.smooth_coef = smooth_coef
158 def update(self, v):
159 if self.value is None:
160 self.value = v
161 else:
162 c = self.smooth_coef
163 self.value = c * self.value + (1.0-c) * v
164
165class RectSelector:
166 def __init__(self, win, callback):

Callers 1

video_threaded.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected