Endmembers Extraction Algorithms (EEA)

This module Supports following endmembers extraction algorithms:

See also

See the file test_eea.py for an example.

Note

Regarding the normalize parameter, if you have data that are out of bound in your HSI cube, the use of normalize is not recommended. You must clean up the data before using this parameter.

Automatic Target Generation Process (ATGP)

Function

pysptools.eea.eea.ATGP(data, q)[source]

Automatic Target Generation Process endmembers induction algorithm

Parameters:
  • datanumpy array 2d matrix of HSI data ((m x n) x p)
  • qint Number of endmembers to be induced (positive integer > 0)
Returns: tuple: numpy array, numpy array
  • Set of induced endmembers (N x p).
  • Induced endmembers indexes vector.

References

A. Plaza, C.-I. Chang, “Impact of Initialization on Design of Endmember Extraction Algorithms”, Geoscience and Remote Sensing, IEEE Transactions on, vol. 44, no. 11, pgs. 3397-3407, 2006.


Class

class pysptools.eea.ATGP[source]

Automatic target generation process endmembers induction algorithm.

display(axes=None, suffix=None)

Display the endmembers to a IPython Notebook.

Parameters:
  • axes

    dictionary [default None] * axes[‘wavelength’] : a wavelengths list (1D python list).

    If None or not specified the list is automaticaly numbered starting at 1.
    • axes[‘x’] : the x axis label, ‘Wavelength’ if None or not specified. axes[‘x’] is copied verbatim.
    • axes[‘y’] : the y axis label, ‘Brightness’ if None or not specified. axes[‘y’] is copied verbatim.
  • suffixstring [default None] Suffix to add to the title.
extract(M, q, normalize=False, mask=None)

Extract the endmembers.

Parameters:
  • Mnumpy array A HSI cube (m x n x p).
  • qint Number of endmembers to be induced (positive integer > 0).
  • normalizeboolean [default False] Normalize M before unmixing.
  • masknumpy array [default None] A binary mask, if True the corresponding signal is part of the endmembers search.
Returns: numpy array
Set of induced endmembers (N x p).

References

A. Plaza y C.-I. Chang, “Impact of Initialization on Design of Endmember Extraction Algorithms”, Geoscience and Remote Sensing, IEEE Transactions on, vol. 44, no. 11, pgs. 3397-3407, 2006.

get_idx()[source]
Returns: numpy array
Array of indices into the HSI cube corresponding to the induced endmembers
plot(path, axes=None, suffix=None)

Plot the endmembers.

Parameters:
  • pathstring The path where to put the plot.
  • axes

    dictionary [default None] * axes[‘wavelength’] : a wavelengths list (1D python list).

    If None or not specified the list is automaticaly numbered starting at 1.
    • axes[‘x’] : the x axis label, ‘Wavelength’ if None or not specified. axes[‘x’] is copied verbatim.
    • axes[‘y’] : the y axis label, ‘Brightness’ if None or not specified. axes[‘y’] is copied verbatim.
  • suffixstring [default None] Suffix to add to the file name.

Fast Iterative Pixel Purity Index (FIPPI)

Function

pysptools.eea.eea.FIPPI(M, q=None, far=None, maxit=None)[source]

Fast Iterative Pixel Purity Index (FIPPI) endmqbers induction algorithm.

Parameters:
  • Mnumpy array 2d matrix of HSI data ((m x n) x p)
  • qint [default None] Number of endmembers to be induced, if None use HfcVd to determine the number of endmembers to induce.
  • farfloat [default None] False alarm rate(s), a parameter to HfcVd equal to 10**-5 by default.
  • maxit`int [default None] Maximum number of iterations. Default = 3*p.
Returns: tuple: numpy array, numpy array
  • Set of induced endmembers (N x p).
  • Array of indices into the array data corresponding to the induced endmembers.

References

Chang, C.-I., “A fast iterative algorithm for implementation of pixel purity index”, Geoscience and Remote Sensing Letters, IEEE, vol. 3, no. 1, pags. 63-67, 2006.


Class

class pysptools.eea.FIPPI[source]

Fast Iterative Pixel Purity Index (FIPPI) endmembers induction algorithm.

display(axes=None, suffix=None)

Display the endmembers to a IPython Notebook.

Parameters:
  • axes

    dictionary [default None] * axes[‘wavelength’] : a wavelengths list (1D python list).

    If None or not specified the list is automaticaly numbered starting at 1.
    • axes[‘x’] : the x axis label, ‘Wavelength’ if None or not specified. axes[‘x’] is copied verbatim.
    • axes[‘y’] : the y axis label, ‘Brightness’ if None or not specified. axes[‘y’] is copied verbatim.
  • suffixstring [default None] Suffix to add to the title.
extract(M, q=None, maxit=None, normalize=False, mask=None)

Extract the endmembers.

Parameters:
  • Mnumpy array A HSI cube (m x n x p).
  • qint [default None] Number of endmembers to be induced, if None use HfcVd to determine the number of endmembers to induce.
  • maxitint [default None] Maximum number of iterations. Default = 3*q.
  • normalizeboolean [default False] Normalize M before unmixing.
  • masknumpy array [default None] A binary mask, when True the corresponding signal is part of the endmembers search.
Returns: numpy array
Set of induced endmembers (N x p).

References

Chang, C.-I., “A fast iterative algorithm for implementation of pixel purity index”, Geoscience and Remote Sensing Letters, IEEE, vol. 3, no. 1, pags. 63-67, 2006.

get_idx()[source]
Returns: numpy array
Array of indices into the HSI cube corresponding to the induced endmembers.
plot(path, axes=None, suffix=None)

Plot the endmembers.

Parameters:
  • pathstring The path where to put the plot.
  • axes

    dictionary [default None] * axes[‘wavelength’] : a wavelengths list (1D python list).

    If None or not specified the list is automaticaly numbered starting at 1.
    • axes[‘x’] : the x axis label, ‘Wavelength’ if None or not specified. axes[‘x’] is copied verbatim.
    • axes[‘y’] : the y axis label, ‘Brightness’ if None or not specified. axes[‘y’] is copied verbatim.
  • suffixstring [default None] Suffix to add to the file name.

N-FINDR

Class

class pysptools.eea.NFINDR[source]

N-FINDR endmembers induction algorithm.

display(axes=None, suffix=None)

Display the endmembers to a IPython Notebook.

Parameters:
  • axes

    dictionary [default None] * axes[‘wavelength’] : a wavelengths list (1D python list).

    If None or not specified the list is automaticaly numbered starting at 1.
    • axes[‘x’] : the x axis label, ‘Wavelength’ if None or not specified. axes[‘x’] is copied verbatim.
    • axes[‘y’] : the y axis label, ‘Brightness’ if None or not specified. axes[‘y’] is copied verbatim.
  • suffixstring [default None] Suffix to add to the title.
extract(M, q, transform=None, maxit=None, normalize=False, ATGP_init=False, mask=None)

Extract the endmembers.

Parameters:
  • Mnumpy array A HSI cube (m x n x p).
  • qint The number of endmembers to be induced.
  • transformnumpy array [default None] The transformed ‘M’ cube by MNF (m x n x components). In this case the number of components must == q-1. If None, the built-in call to PCA is used to transform M in q-1 components.
  • maxitint [default None] The maximum number of iterations. Default is 3*p.
  • normalizeboolean [default False] If True, M is normalized before doing the endmembers induction.
  • ATGP_initboolean [default False] Use ATGP to generate the first endmembers set instead of a random selection.
  • masknumpy array [default None] A binary mask, when True the corresponding signal is part of the endmembers search.
Returns: numpy array
Set of induced endmembers (N x p).

References

Winter, M. E., “N-FINDR: an algorithm for fast autonomous spectral end-member determination in hyperspectral data”, presented at the Imaging Spectrometry V, Denver, CO, USA, 1999, vol. 3753, pgs. 266-275.

Note

The division by (factorial(p-1)) is an invariant for this algorithm, for this reason it is skipped.

get_idx()[source]
Returns
: numpy array
Array of indices into the HSI cube corresponding to the induced endmembers
get_iterations()[source]
Returns
: int
The number of iterations.
plot(path, axes=None, suffix=None)

Plot the endmembers.

Parameters:
  • pathstring The path where to put the plot.
  • axes

    dictionary [default None] * axes[‘wavelength’] : a wavelengths list (1D python list).

    If None or not specified the list is automaticaly numbered starting at 1.
    • axes[‘x’] : the x axis label, ‘Wavelength’ if None or not specified. axes[‘x’] is copied verbatim.
    • axes[‘y’] : the y axis label, ‘Brightness’ if None or not specified. axes[‘y’] is copied verbatim.
  • suffixstring [default None] Suffix to add to the file name.

Pixel Purity Index (PPI)

Function

pysptools.eea.eea.PPI(M, q, numSkewers, ini_skewers=None)[source]

Performs the pixel purity index algorithm for endmember finding.

Parameters:
  • Mnumpy array 2d matrix of HSI data ((m x n) x p).
  • qint Number of endmembers to find.
  • numSkewersint Number of “skewer” vectors to project data onto.
  • ini_skewersnumpy array [default None] You can generate skewers from another source.
Returns: numpy array
Recovered endmembers (N x p).

Class

class pysptools.eea.PPI[source]

Performs the pixel purity index algorithm for endmembers finding.

display(axes=None, suffix=None)

Display the endmembers to a IPython Notebook.

Parameters:
  • axes

    dictionary [default None] * axes[‘wavelength’] : a wavelengths list (1D python list).

    If None or not specified the list is automaticaly numbered starting at 1.
    • axes[‘x’] : the x axis label, ‘Wavelength’ if None or not specified. axes[‘x’] is copied verbatim.
    • axes[‘y’] : the y axis label, ‘Brightness’ if None or not specified. axes[‘y’] is copied verbatim.
  • suffixstring [default None] Suffix to add to the title.
extract(M, q, numSkewers=10000, normalize=False, mask=None)

Extract the endmembers.

Parameters:
  • Mnumpy array A HSI cube (m x n x p).
  • qint Number of endmembers to find.
  • numSkewersint [default 10000] Number of “skewer” vectors to project data onto. In general, recommendation from the literature is 10000 skewers.
  • masknumpy array [default None] A binary mask, when True the corresponding signal is part of the endmembers search.
Returns: numpy array
Recovered endmembers (N x p).
get_idx()[source]
Returns: numpy array
Array of indices into the HSI cube corresponding to the induced endmembers
plot(path, axes=None, suffix=None)

Plot the endmembers.

Parameters:
  • pathstring The path where to put the plot.
  • axes

    dictionary [default None] * axes[‘wavelength’] : a wavelengths list (1D python list).

    If None or not specified the list is automaticaly numbered starting at 1.
    • axes[‘x’] : the x axis label, ‘Wavelength’ if None or not specified. axes[‘x’] is copied verbatim.
    • axes[‘y’] : the y axis label, ‘Brightness’ if None or not specified. axes[‘y’] is copied verbatim.
  • suffixstring [default None] Suffix to add to the file name.