MUSIC Module¶
-
class
spectral_libraries.core.music.
Music
[source]¶ Bases:
object
MUSIC (multiple signal classification) is a library pruning technique that operates on a full image.
This technique reduces the dimensionality of an image to kf eigenvectors, and prunes a library according to the smallest distances to this subspace.
Citation: Iordache, M.D., Bioucas-Dias, J.M., Plaza, A., Somers, B., 2014, MUSIC-CSR: Hyperspectral unmixing via multiple signal classification and collaborative sparse regression, IEEE Transactions on Geoscience and Remote Sensing, 52, p. 4364–4382.
-
estimate_noise
(image)[source]¶ Hyperspectral noise estimation, by assuming that the reflectance at a given band is well modelled by a linear regression on the remaining bands.
Parameters: image – 2D hyperspectral data set (m bands x n pixels) Returns: the noise estimates for every pixel (m x n)
-
execute
(library: numpy.array, image: numpy.array, library_size: int, min_eig: int = 15, log: callable = <built-in function print>) → dict[source]¶ This technique reduces the dimensionality of an image to kf eigenvectors, and select library spectra according to the smallest distances to this subspace.
Parameters: - library – the original spectral library to be pruned (bands x spectra), reflectance, no bad bands
- image – image used for pruning (bands x rows x columns) reflectance, no bad bands
- library_size – pruned library size
- min_eig – minimum number of eigenvectors to be retained from the image to calculate MUSIC distances
- log – communicate messages (point to the print_log tab in the GUI; otherwise print to the console)
Returns: dictionary with each output metric as a numpy array in a key-value pair - music_indices: indices of the pruned library - eigenvectors: first kf eigenvectors of image subspace (needed for sparse unmixing)
kf = estimated number of eigenvectors in the image estimated by Hysime algorithm
- music_distances: MUSIC distances of the pruned library spectra to the image, sorted from low to high
-
static
flatten_image
(image: numpy.array) → numpy.array[source]¶ Store the image as a line (2D array).
Parameters: image – 3D image (m bands x n rows x p columns) Returns: 2D image (m bands x n.p spectra
-
hysime2
(image, min_eig)[source]¶ Hysime2 algorithm
Parameters: - image – 2D hyperspectral data set (m bands x n pixels)
- min_eig – minimum number of eigenvectors to be retained from the image to calculate MUSIC distances
Returns: signal subspace dimension (tuple), eigenvectors that span the signal subspace (in the columns)
-