MUSIC Module

———————————————————————————————————————-
Date : June 2020
Copyright : © 2020 by Arthur Maenhout (Locus) and Ann Crabbé (KU Leuven)
Acknowledgements : Jeroen Degerickx (KU Leuven). Documentation: https://doi.org/10.3390/rs9060565.

This file is part of the Spectral Libraries QGIS plugin and python package.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License (COPYING.txt). If not see www.gnu.org/licenses.
———————————————————————————————————————-
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)

static normalize_brightness(spectra: numpy.array) → numpy.array[source]

Brightness normalization of spectral library or 2D-image

Parameters:spectra – array with m bands x n spectra
Returns:array with normalized spectral