video.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:vbcg 作者: nspi 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号