本文整理汇总了Python中skimage.viewer.ImageViewer.image方法的典型用法代码示例。如果您正苦于以下问题:Python ImageViewer.image方法的具体用法?Python ImageViewer.image怎么用?Python ImageViewer.image使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类skimage.viewer.ImageViewer
的用法示例。
在下文中一共展示了ImageViewer.image方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_viewer
# 需要导入模块: from skimage.viewer import ImageViewer [as 别名]
# 或者: from skimage.viewer.ImageViewer import image [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_line_profile_dynamic
# 需要导入模块: from skimage.viewer import ImageViewer [as 别名]
# 或者: from skimage.viewer.ImageViewer import image [as 别名]
def test_line_profile_dynamic():
"""Test a line profile updating after an image transform"""
image = data.coins()[:-50, :] # shave some off to make the line lower
image = skimage.img_as_float(image)
viewer = ImageViewer(image)
lp = LineProfile(limits='dtype')
viewer += lp
line = lp.get_profiles()[-1][0]
assert line.size == 129
assert_almost_equal(np.std(viewer.image), 0.208, 3)
assert_almost_equal(np.std(line), 0.229, 3)
assert_almost_equal(np.max(line) - np.min(line), 0.725, 1)
viewer.image = skimage.img_as_float(median(image,
selem=disk(radius=3)))
line = lp.get_profiles()[-1][0]
assert_almost_equal(np.std(viewer.image), 0.198, 3)
assert_almost_equal(np.std(line), 0.220, 3)
assert_almost_equal(np.max(line) - np.min(line), 0.639, 1)