当前位置: 首页>>代码示例>>Python>>正文


Python ImageViewer.image方法代码示例

本文整理汇总了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)
开发者ID:haohao200609,项目名称:Hybrid,代码行数:21,代码来源:test_viewer.py

示例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)
开发者ID:Rapternmn,项目名称:scikit-image,代码行数:24,代码来源:test_plugins.py


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