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

Method read

官方samples/video.py:66–80  ·  view source on GitHub ↗
(self, dst=None)

Source from the content-addressed store, hash-verified

64 pass
65
66 def read(self, dst=None):
67 w, h = self.frame_size
68
69 if self.bg is None:
70 buf = np.zeros((h, w, 3), np.uint8)
71 else:
72 buf = self.bg.copy()
73
74 self.render(buf)
75
76 if self.noise > 0.0:
77 noise = np.zeros((h, w, 3), np.int8)
78 cv2.randn(noise, np.zeros(3), np.ones(3)*255*self.noise)
79 buf = cv2.add(buf, noise, dtype=cv2.CV_8UC3)
80 return True, buf
81
82 def isOpened(self):
83 return True

Callers

nothing calls this directly

Calls 2

renderMethod · 0.95
addMethod · 0.45

Tested by

no test coverage detected