def get_frame(self):
"""This function delivers frames from the camera or the hard disk for the GUI
Returns:
status -- False if user has not pressed ''start'' button. If pressed, returns True
frame -- A black frame is the user has not pressed ''start'' button. Otherwise frame from camera or disk
"""
# Waiting for the user to press the ''start'' button
if self.eventVideoReady.is_set():
# Read current frame from thread
frame = self.currentFrame
# Convert color to RGB
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
# Return status and frame
return True, frame
else:
# Return false as status and black frame
return False, np.zeros((480, 640, 3), np.uint8)
评论列表
文章目录