glcf.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:rastercube 作者: terrai 项目源码 文件源码
def plot_glcf_labelmap(labels, ax=None):
    import pylab as pl
    if ax is None:
        ax = pl.subplot(111)

    vimg = glcf_to_rgb(labels)
    vimg[labels.mask] = (0, 0, 0)
    ax.imshow(vimg, interpolation='nearest')

    lgd_patches = []
    for glcf_type in sorted(np.unique(labels)):
        if glcf_type is ma.masked:
            continue
        lgd_patches.append(
            mpatches.Patch(
                color=np.array(CMAP[glcf_type]) / 255.,
                label=CLASSES_NAMES[glcf_type]
            )
        )
    ax.legend(loc='upper center', bbox_to_anchor=(0.5, -0.05),
              handles=lgd_patches)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号