Python scipy.misc 模块-lena() 实例源码

Python scipy.misc 模块,lena() 实例源码

我们从Python开源项目中,提取了以下1代码示例,用于说明如何使用scipy.misc.lena()

项目:tools    作者:kastnerkyle    | 项目源码 | 文件源码
def test_graphcut():
    import matplotlib.pyplot as plt
    from scipy.misc import lena
    im = lena()
    # Any bigger and my weak laptop gets memory errors
    bounds = (50, 50)
    im = imresize(im, bounds, interp="bicubic")
    all_matches, all_splits = graphcut(im, split_type="mean")

    to_plot = all_splits[-1]
    f, axarr = plt.subplots(2, len(to_plot) // 2)
    for n in range(len(to_plot)):
        axarr.ravel()[n].imshow(to_plot[n], cmap="gray")
        axarr.ravel()[n].set_xticks([])
        axarr.ravel()[n].set_yticks([])
    plt.show()

相关文章

Python setuptools.dep_util 模块,newer_pairwise_group() ...
Python chainer.utils.type_check 模块,eval() 实例源码 我...
Python chainer.utils.type_check 模块,prod() 实例源码 我...
Python chainer.utils.type_check 模块,expect() 实例源码 ...
Python multiprocessing.managers 模块,BaseProxy() 实例源...
Python multiprocessing.managers 模块,RemoteError() 实例...