spectral
spectral copied to clipboard
Add kernel matched filter
The kernel matched filter (KMF) is defined in Kwon & Nasrabadi (2007).
Briefly, Given kernel function and target/background matrix, the KMFresponse is given by:
\begin{align}
y(\hat{k}_r) = \frac{\hat{k}_t^T \hat{K}^{-2} \hat{k}_x}{\hat{k}_t^T \hat{K}^{-2} \hat{k}_t} \\
where:
\hat{k}_{t}^T=k_{t}^T-\frac{1}{N} \sum_{i=1}^N k\left(x_i, t\right) \overrightarrow{1} \\
\hat{k}_{x}^T=k_{x}^T-\frac{1}{N} \sum_{i=1}^N k\left(x_i, x\right) \overrightarrow{1} \\
\end{align}
$\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.
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.
MF
KMF with poly kernel
Original data:
Normalized data:
KMF with rbf kernel
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.
Yes, because most push-broom sensors have a slightly nonuniform behavior at different cross-track positions. I see someone applied it here.
I have also tested with some small real data and the result is also strange. Here's the gist.