Open zxdawn opened 10 months ago
I have tested the preliminary version of KMF using the lan sample data and found there seems something wrong .... The notebook is on the gist.
Original data:
Normalized data:
Original data:
Normalized data:
In the gist notebook, did you intend for your normalization to use an average over rows (as opposed to the entire image)? That is what your function appears to be doing.
The kernel matched filter (KMF) is defined in Kwon & Nasrabadi (2007).
Briefly, Given kernel function and target/background matrix, the KMFresponse is given by:
$\hat{K}$ is the centered kernel (Gram) matrix, K = K(X, X) = (K)ij the N × N kernel matrix whose entries are the dot products 〈φ(xi ),φ(x j )〉.
$\hat{k}$ is a kernel, such as linear kernel, polynomial kernel and Gaussian Radial Bases Function kernel (RBF).
The inverse $\hat{K}^{-2}$ may not be numerically stable if the background spectral samples are not independent. Therefore, the pseudo-inverse of K is used, which is based on eigenvalue decomposition, where eigenvectors with eigenvalues larger than
eigval_min
are used.