python类lena()的实例源码

image_tools.py 文件源码 项目:tools 作者: kastnerkyle 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
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()


问题


面经


文章

微信
公众号

扫码关注公众号