def put(self, name, frame):
if self.type==self.DIR:
cv2.imwrite(self.path+"/"+name, frame)
elif self.type==self.IMG:
cv2.imwrite(self.path, frame)
elif self.type==self.VID:
if self.writer is None:
if hasattr(cv2, 'VideoWriter_fourcc'):
fcc=cv2.VideoWriter_fourcc(*'MJPG')
else:
fcc=cv2.cv.CV_FOURCC(*'MJPG')
self.writer = cv2.VideoWriter(self.path, fcc, int(self.fps), (frame.shape[1], frame.shape[0]))
self.writer.write(frame)
else:
pass
评论列表
文章目录