def CEM(M, t):
"""
Performs the constrained energy minimization algorithm for target
detection.
Parameters:
M: `numpy array`
2d matrix of HSI data (N x p).
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.
"""
def corr(M):
p, N = M.shape
return np.dot(M, M.T) / N
N, p = M.shape
R_hat = corr(M.T)
Rinv = lin.inv(R_hat)
denom = np.dot(t.T, np.dot(Rinv, t))
t_Rinv = np.dot(t.T, Rinv)
return np.dot(t_Rinv , M[0:,:].T) / denom
评论列表
文章目录