本文整理汇总了Python中skimage.viewer.ImageViewer.save_to_file方法的典型用法代码示例。如果您正苦于以下问题:Python ImageViewer.save_to_file方法的具体用法?Python ImageViewer.save_to_file怎么用?Python ImageViewer.save_to_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类skimage.viewer.ImageViewer
的用法示例。
在下文中一共展示了ImageViewer.save_to_file方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_viewer
# 需要导入模块: from skimage.viewer import ImageViewer [as 别名]
# 或者: from skimage.viewer.ImageViewer import save_to_file [as 别名]
def test_viewer():
astro = data.astronaut()
coins = data.coins()
view = ImageViewer(astro)
import tempfile
_, filename = tempfile.mkstemp(suffix='.png')
view.show(False)
view.close()
view.save_to_file(filename)
view.open_file(filename)
assert_equal(view.image, astro)
view.image = coins
assert_equal(view.image, coins),
view.save_to_file(filename),
view.open_file(filename),
view.reset_image(),
assert_equal(view.image, coins)
示例2: test_viewer_with_overlay
# 需要导入模块: from skimage.viewer import ImageViewer [as 别名]
# 或者: from skimage.viewer.ImageViewer import save_to_file [as 别名]
def test_viewer_with_overlay():
img = data.coins()
ov = OverlayPlugin(image_filter=sobel)
viewer = ImageViewer(img)
viewer += ov
import tempfile
_, filename = tempfile.mkstemp(suffix='.png')
ov.color = 3
assert_equal(ov.color, 'yellow')
viewer.save_to_file(filename)
ov.display_filtered_image(img)
assert_equal(ov.overlay, img)
ov.overlay = None
assert_equal(ov.overlay, None)
ov.overlay = img
assert_equal(ov.overlay, img)
assert_equal(ov.filtered_image, img)