本文整理汇总了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;未经允许,请勿转载。 |
请发表评论