picam.py 文件源码

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

项目:MMM-Facial-Recognition-Tools 作者: paviro 项目源码 文件源码
def run(self):
        with picamera.PiCamera() as camera:
            camera.resolution = (620, 540)
            if self.preview:
                camera.start_preview(fullscreen=False, window = (100, 20, 620, 540))
            stream = io.BytesIO()
            for stream in camera.capture_continuous(stream, format='jpeg', use_video_port=True):
                self.lock.acquire()
                try:
                    # swap the stream for the buffer
                    temp = stream
                    stream = self.buffer
                    self.buffer = temp
                    stream.truncate()
                    stream.seek(0)
                finally:
                    self.lock.release()
                if self.running is False:
                    break
            if self.preview:
                camera.stop_preview()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号