def flush(self):
super(PiMotionArray, self).flush()
width, height = self.size or self.camera.resolution
cols = ((width + 15) // 16) + 1
rows = (height + 15) // 16
b = self.getvalue()
frames = len(b) // (cols * rows * motion_dtype.itemsize)
self.array = np.frombuffer(b, dtype=motion_dtype).reshape((frames, rows, cols))
评论列表
文章目录