def asarray(self, axis=3):
"""
This function ...
:return:
"""
# Get a list that contains the frames
frame_list = self.frames.as_list()
# Stack the frames into a 3D numpy array
if axis == 3: return np.dstack(frame_list)
elif axis == 2: return np.hstack(frame_list)
elif axis == 1: return np.vstack(frame_list)
elif axis == 0: return np.stack(frame_list)
else: raise ValueError("'axis' parameter should be integer 0-3")
# -----------------------------------------------------------------
评论列表
文章目录