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()