detect.py 文件源码

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

项目:pysptools 作者: ctherien 项目源码 文件源码
def OSP(M, E, t):
    """
    Performs the othogonal subspace projection algorithm for target
    detection.

    Parameters:
        M: `numpy array`
            2d matrix of HSI data (N x p).

        E: `numpy array`
            2d matrix of background endmebers (p x q).

        t: `numpy array`
            A target endmember (p).

    Returns: `numpy array`
        Vector of detector output (N).

    References:
        Qian Du, Hsuan Ren, and Chein-I Cheng. "A Comparative Study of
        Orthogonal Subspace Projection and Constrained Energy Minimization."
        IEEE TGRS. Volume 41. Number 6. June 2003.
    """
    N, p = M.shape
    P_U = np.eye(p, dtype=np.float) - np.dot(E.T, lin.pinv(E.T))
    tmp = np.dot(t.T, np.dot(P_U, t))
    nu = np.zeros(N, dtype=np.float)
    for k in range(N):
        nu[k] = np.dot(t.T, np.dot(P_U, M[k])) / tmp
    return nu
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号