• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python verify.verify_image函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中verify.verify_image函数的典型用法代码示例。如果您正苦于以下问题:Python verify_image函数的具体用法?Python verify_image怎么用?Python verify_image使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了verify_image函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_capture_sequence_to_file

def test_capture_sequence_to_file(
        camera, previewing, mode, tmpdir, use_video_port):
    resolution, framerate = mode
    filenames = [os.path.join(str(tmpdir), 'image%d.jpg' % i) for i in range(3)]
    camera.capture_sequence(filenames, use_video_port=use_video_port)
    for filename in filenames:
        verify_image(filename, 'jpeg', resolution)
开发者ID:GMercat,项目名称:picamera,代码行数:7,代码来源:test_capture.py


示例2: test_capture_to_file

def test_capture_to_file(
        camera, previewing, resolution, filename_format_options, use_video_port):
    filename, format, options = filename_format_options
    camera.capture(filename, use_video_port=use_video_port, **options)
    if 'resize' in options:
        resolution = options['resize']
    verify_image(filename, format, resolution)
开发者ID:RoboPython,项目名称:picamera,代码行数:7,代码来源:test_capture.py


示例3: test_capture_sequence_to_stream

def test_capture_sequence_to_stream(
        camera, previewing, resolution, use_video_port):
    streams = [io.BytesIO() for i in range(3)]
    camera.capture_sequence(streams, use_video_port=use_video_port)
    for stream in streams:
        stream.seek(0)
        verify_image(stream, 'jpeg', resolution)
开发者ID:RoboPython,项目名称:picamera,代码行数:7,代码来源:test_capture.py


示例4: test_capture_to_stream

def test_capture_to_stream(
        camera, previewing, resolution, format_options, use_video_port):
    stream = io.BytesIO()
    format, options = format_options
    if 'resize' in options:
        resolution = options['resize']
    camera.capture(stream, format, use_video_port=use_video_port, **options)
    stream.seek(0)
    verify_image(stream, format, resolution)
开发者ID:RoboPython,项目名称:picamera,代码行数:9,代码来源:test_capture.py


示例5: test_capture_continuous_to_file

def test_capture_continuous_to_file(
        camera, previewing, resolution, tmpdir, use_video_port):
    for i, filename in enumerate(
            camera.capture_continuous(os.path.join(
                str(tmpdir), 'image{counter:02d}.jpg'),
                use_video_port=use_video_port)):
        verify_image(filename, 'jpeg', resolution)
        if i == 3:
            break
开发者ID:RoboPython,项目名称:picamera,代码行数:9,代码来源:test_capture.py


示例6: test_capture_to_file

def test_capture_to_file(
        camera, previewing, mode, filename_format_options, use_video_port):
    filename, format, options = filename_format_options
    resolution, framerate = mode
    if resolution == (2592, 1944) and 'resize' in options:
        pytest.xfail('Camera runs out of memory with this combination')
    camera.capture(filename, use_video_port=use_video_port, **options)
    if 'resize' in options:
        resolution = options['resize']
    verify_image(filename, format, resolution)
开发者ID:qnmlgdsb,项目名称:picamera,代码行数:10,代码来源:test_capture.py


示例7: test_capture_sequence_to_file

def test_capture_sequence_to_file(
        camera, mode, tmpdir, use_video_port, burst):
    resolution, framerate = mode
    filenames = [os.path.join(str(tmpdir), 'image%d.jpg' % i) for i in range(3)]
    try:
        camera.capture_sequence(
                filenames, use_video_port=use_video_port, burst=burst)
        for filename in filenames:
            verify_image(filename, 'jpeg', resolution)
    except picamera.PiCameraRuntimeError:
        assert use_video_port and burst
开发者ID:frederoni,项目名称:picamera,代码行数:11,代码来源:test_capture.py


示例8: test_capture_to_stream

def test_capture_to_stream(
        camera, previewing, mode, format_options, use_video_port):
    stream = io.BytesIO()
    format, options = format_options
    resolution, framerate = mode
    if resolution == (2592, 1944) and 'resize' in options:
        pytest.xfail('Camera runs out of memory with this combination')
    if 'resize' in options:
        resolution = options['resize']
    camera.capture(stream, format, use_video_port=use_video_port, **options)
    stream.seek(0)
    verify_image(stream, format, resolution)
开发者ID:qnmlgdsb,项目名称:picamera,代码行数:12,代码来源:test_capture.py


示例9: test_capture_sequence_to_stream

def test_capture_sequence_to_stream(
        camera, mode, format_options, use_video_port, burst):
    format, options = format_options
    resolution, framerate = mode
    expected_failures(resolution, format, use_video_port, burst)
    streams = [io.BytesIO() for i in range(3)]
    camera.capture_sequence(
            streams, format=format,
            use_video_port=use_video_port, burst=burst)
    for stream in streams:
        stream.seek(0)
        verify_image(stream, format, resolution)
开发者ID:GeorgeCazenavette,项目名称:picamera,代码行数:12,代码来源:test_capture.py


示例10: test_capture_to_file

def test_capture_to_file(
        camera, previewing, mode, filename_format_options, use_video_port):
    filename, format, options = filename_format_options
    resolution, framerate = mode
    if resolution == (2592, 1944) and format == 'gif' and not use_video_port:
        pytest.xfail('Camera fails to produce output with max. res GIFs')
    if resolution == (2592, 1944) and format == 'bmp':
        pytest.xfail('Camera fails to produce output with max. res BMPs')
    camera.capture(filename, use_video_port=use_video_port, **options)
    if 'resize' in options:
        resolution = options['resize']
    verify_image(filename, format, resolution)
开发者ID:frederoni,项目名称:picamera,代码行数:12,代码来源:test_capture.py


示例11: test_capture_continuous_to_stream

def test_capture_continuous_to_stream(
        camera, previewing, resolution, use_video_port):
    stream = io.BytesIO()
    for i, foo in enumerate(
            camera.capture_continuous(stream, format='jpeg',
                use_video_port=use_video_port)):
        stream.truncate()
        stream.seek(0)
        verify_image(stream, 'jpeg', resolution)
        stream.seek(0)
        if i == 3:
            break
开发者ID:RoboPython,项目名称:picamera,代码行数:12,代码来源:test_capture.py


示例12: test_capture_sequence_to_stream

def test_capture_sequence_to_stream(
        camera, mode, use_video_port, burst):
    resolution, framerate = mode
    streams = [io.BytesIO() for i in range(3)]
    try:
        camera.capture_sequence(
                streams, use_video_port=use_video_port, burst=burst)
        for stream in streams:
            stream.seek(0)
            verify_image(stream, 'jpeg', resolution)
    except picamera.PiCameraRuntimeError:
        assert use_video_port and burst
开发者ID:frederoni,项目名称:picamera,代码行数:12,代码来源:test_capture.py


示例13: test_capture_continuous_to_file

def test_capture_continuous_to_file(
        camera, mode, ext_format_options, tempdir, use_video_port, burst):
    ext, format, options = ext_format_options
    resolution, framerate = mode
    expected_failures(resolution, format, use_video_port, burst)
    for i, filename in enumerate(
            camera.capture_continuous(os.path.join(
                tempdir, 'image{counter:02d}%s' % ext),
                format=format if format in RAW_FORMATS else None,
                use_video_port=use_video_port, burst=burst)):
        verify_image(filename, format, resolution)
        if i == 3:
            break
开发者ID:GeorgeCazenavette,项目名称:picamera,代码行数:13,代码来源:test_capture.py


示例14: test_capture_continuous_to_file

def test_capture_continuous_to_file(
        camera, mode, tmpdir, use_video_port, burst):
    resolution, framerate = mode
    try:
        for i, filename in enumerate(
                camera.capture_continuous(os.path.join(
                    str(tmpdir), 'image{counter:02d}.jpg'),
                    use_video_port=use_video_port, burst=burst)):
            verify_image(filename, 'jpeg', resolution)
            if i == 3:
                break
    except picamera.PiCameraRuntimeError:
        assert use_video_port and burst
开发者ID:frederoni,项目名称:picamera,代码行数:13,代码来源:test_capture.py


示例15: test_capture_to_file

def test_capture_to_file(
        camera, previewing, mode, filename_format_options, use_video_port):
    filename, format, options = filename_format_options
    resolution, framerate = mode
    expected_failures(resolution, format, use_video_port)
    camera.capture(
            filename,
            # Check that in the case of cooked formats, capture correctly
            # derives the format from the extension
            format=format if format in RAW_FORMATS else None,
            use_video_port=use_video_port, **options)
    if 'resize' in options:
        resolution = options['resize']
    verify_image(filename, format, resolution)
开发者ID:JacobSamro,项目名称:picamera,代码行数:14,代码来源:test_capture.py


示例16: test_capture_to_stream

def test_capture_to_stream(
        camera, previewing, mode, format_options, use_video_port):
    stream = io.BytesIO()
    format, options = format_options
    resolution, framerate = mode
    if resolution == (2592, 1944) and format == 'gif' and not use_video_port:
        pytest.xfail('Camera fails to produce output with max. res GIFs')
    if resolution == (2592, 1944) and format == 'bmp':
        pytest.xfail('Camera fails to produce output with max. res BMPs')
    if 'resize' in options:
        resolution = options['resize']
    camera.capture(stream, format, use_video_port=use_video_port, **options)
    stream.seek(0)
    verify_image(stream, format, resolution)
开发者ID:frederoni,项目名称:picamera,代码行数:14,代码来源:test_capture.py


示例17: test_capture_sequence_to_file

def test_capture_sequence_to_file(
        camera, mode, ext_format_options, tempdir, use_video_port, burst):
    ext, format, options = ext_format_options
    resolution, framerate = mode
    expected_failures(resolution, format, use_video_port, burst)
    filenames = [
        os.path.join(tempdir, 'image%d%s' % (i, ext))
        for i in range(3)
        ]
    camera.capture_sequence(
            filenames, format=format,
            use_video_port=use_video_port, burst=burst)
    for filename in filenames:
        verify_image(filename, format, resolution)
开发者ID:GeorgeCazenavette,项目名称:picamera,代码行数:14,代码来源:test_capture.py


示例18: test_capture_continuous_to_stream

def test_capture_continuous_to_stream(
        camera, mode, format_options, use_video_port, burst):
    format, options = format_options
    resolution, framerate = mode
    expected_failures(resolution, format, use_video_port, burst)
    stream = io.BytesIO()
    for i, foo in enumerate(
            camera.capture_continuous(stream, format=format,
                use_video_port=use_video_port, burst=burst)):
        stream.truncate()
        stream.seek(0)
        verify_image(stream, format, resolution)
        stream.seek(0)
        if i == 3:
            break
开发者ID:GeorgeCazenavette,项目名称:picamera,代码行数:15,代码来源:test_capture.py


示例19: test_capture_continuous_to_stream

def test_capture_continuous_to_stream(
        camera, mode, use_video_port, burst):
    resolution, framerate = mode
    stream = io.BytesIO()
    try:
        for i, foo in enumerate(
                camera.capture_continuous(stream, format='jpeg',
                    use_video_port=use_video_port, burst=burst)):
            stream.truncate()
            stream.seek(0)
            verify_image(stream, 'jpeg', resolution)
            stream.seek(0)
            if i == 3:
                break
    except picamera.PiCameraRuntimeError:
        assert use_video_port and burst
开发者ID:frederoni,项目名称:picamera,代码行数:16,代码来源:test_capture.py


示例20: test_split_and_capture

def test_split_and_capture(camera, previewing, resolution):
    if resolution == (2592, 1944):
        pytest.xfail('Cannot encode video at max resolution')
    v_stream1 = tempfile.SpooledTemporaryFile()
    v_stream2 = tempfile.SpooledTemporaryFile()
    c_stream1 = tempfile.SpooledTemporaryFile()
    camera.start_recording(v_stream1, format='h264')
    try:
        camera.wait_recording(1)
        camera.capture(c_stream1, format='jpeg', use_video_port=True)
        camera.split_recording(v_stream2)
        camera.wait_recording(1)
    finally:
        camera.stop_recording()
    v_stream1.seek(0)
    v_stream2.seek(0)
    c_stream1.seek(0)
    verify_image(c_stream1, 'jpeg', resolution)
    verify_video(v_stream1, 'h264', resolution)
    verify_video(v_stream2, 'h264', resolution)
开发者ID:RoboPython,项目名称:picamera,代码行数:20,代码来源:test_record.py



注:本文中的verify.verify_image函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python verify.verify_video函数代码示例发布时间:2022-05-26
下一篇:
Python glance_verifier._verify_validity函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap