dist.py 文件源码

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

项目:pysptools 作者: ctherien 项目源码 文件源码
def classify(fn, M, E):
    """
    Classify SAM or SID on a HSI cube
    Can't be use with NormXCorr
    """
    import pysptools.util as util
    width, height, bands = M.shape
    M = util.convert2d(M)
    cmap = np.zeros(M.shape[0])
    for i in range(M.shape[0]):
        T = M[i]
        floor = np.PINF
        k = 0
        for j in range(E.shape[0]):
            R = E[j]
            result = fn(T, R)
            if result < floor:
                floor = result
                k = j
        cmap[i] = k
    return util.convert3d(cmap, width, height)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号