camera.py 文件源码

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

项目:pytRobot 作者: ggljzr 项目源码 文件源码
def capture_img(img_path='img.jpg', res=(1024,768), vflip=True):
    """
    Captures image with PiCamera and saves it to given path.
    It cannot be used when camera is active 
    (for example when it is used by mjpg-streamer). In that case
    exception ``PiCameraMMALError`` will be raised.
    """
    camera = PiCamera()

    camera.resolution = res
    camera.vflip = vflip

    print('CAMERA: Capturing image...')
    camera.capture(img_path)
    print('CAMERA: Image saved in {}'.format(img_path))

    camera.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号