# Detection¶

This module supports the follwing detection algorithms. Each of these algorithms come in two flavors, as functions or as classes.

See the file test_detect.py for an example.

### Function¶

pysptools.detection.detect.ACE(M, t)[source]

Performs the adaptive cosin/coherent estimator algorithm for target detection.

Parameters: M – numpy array 2d matrix of HSI data (N x p). t – numpy array A target endmember (p).
Returns: numpy array
Vector of detector output (N).

References

X Jin, S Paswater, H Cline. “A Comparative Study of Target Detection Algorithms for Hyperspectral Imagery.” SPIE Algorithms and Technologies for Multispectral, Hyperspectral, and Ultraspectral Imagery XV. Vol 7334. 2009.

### Class¶

class pysptools.detection.ACE[source]

Performs the adaptive cosin/coherent estimator algorithm for target detection.

detect(M, t, threshold=None)
Parameters: M – numpy array A HSI cube (m x n x p). t – numpy array A target pixel (p). threshold – float or None [default None] Apply a threshold to the detection result. Usefull to isolate the result.
Returns: numpy array
Vector of detector output (m x n x 1).

References

X Jin, S Paswater, H Cline. “A Comparative Study of Target Detection Algorithms for Hyperspectral Imagery.” SPIE Algorithms and Technologies for Multispectral, Hyperspectral, and Ultraspectral Imagery XV. Vol 7334. 2009.

display(whiteOnBlack=True, suffix=None)

Display the target map to a IPython Notebook.

Parameters: whiteOnBlack – boolean [default True] By default, whiteOnBlack=True, the detected signal is white on a black background. You can invert this with whiteOnBlack=False. suffix – string [default None] Suffix to add to the title.
plot(path, whiteOnBlack=True, suffix=None)

Plot the target map.

Parameters: path – string The path where to put the plot. whiteOnBlack – boolean [default True] By default, whiteOnBlack=True, the detected signal is white on a black background. You can invert this with whiteOnBlack=False. suffix – string [default None] Suffix to add to the file name.

## Constrained Energy Minimization (CEM)¶

### Function¶

pysptools.detection.detect.CEM(M, t)[source]

Performs the constrained energy minimization algorithm for target detection.

Parameters: M – numpy array 2d matrix of HSI data (N x p). t – numpy array A target endmember (p).
Returns: numpy array
Vector of detector output (N).

References

Qian Du, Hsuan Ren, and Chein-I Cheng. A Comparative Study of Orthogonal Subspace Projection and Constrained Energy Minimization. IEEE TGRS. Volume 41. Number 6. June 2003.

### Class¶

class pysptools.detection.CEM[source]

Performs the constrained energy minimization algorithm for target detection.

detect(M, t, threshold=None)
Parameters: M – numpy array A HSI cube (m x n x p). t – numpy array A target pixel (p). threshold – float or None [default None] Apply a threshold to the detection result. Usefull to isolate the result.
Returns: numpy array
Vector of detector output (m x n x 1).

References

Qian Du, Hsuan Ren, and Chein-I Cheng. A Comparative Study of Orthogonal Subspace Projection and Constrained Energy Minimization. IEEE TGRS. Volume 41. Number 6. June 2003.

display(whiteOnBlack=True, suffix=None)

Display the target map to a IPython Notebook.

Parameters: whiteOnBlack – boolean [default True] By default, whiteOnBlack=True, the detected signal is white on a black background. You can invert this with whiteOnBlack=False. suffix – string [default None] Suffix to add to the title.
plot(path, whiteOnBlack=True, suffix=None)

Plot the target map.

Parameters: path – string The path where to put the plot. whiteOnBlack – boolean [default True] By default, whiteOnBlack=True, the detected signal is white on a black background. You can invert this with whiteOnBlack=False. suffix – string [default None] Suffix to add to the file name.

## Generalized Likelihood Ratio Test (GLRT)¶

### Function¶

pysptools.detection.detect.GLRT(M, t)[source]

Performs the generalized likelihood test ratio algorithm for target detection.

Parameters: M – numpy array 2d matrix of HSI data (N x p). t – numpy array A target endmember (p).
Returns: numpy array
Vector of detector output (N).

References

T F AyouB, “Modified GLRT Signal Detection Algorithm,” IEEE Transactions on Aerospace and Electronic Systems, Vol 36, No 3, July 2000.

### Class¶

class pysptools.detection.GLRT[source]

Performs the generalized likelihood test ratio algorithm for target detection.

detect(M, t, threshold=None)
Parameters: M – numpy array A HSI cube (m x n x p). t – numpy array A target pixel (p). threshold – float or None [default None] Apply a threshold to the detection result. Usefull to isolate the result.
Returns: numpy array
Vector of detector output (m x n x 1).
References
T. F. AyouB, “Modified GLRT Signal Detection Algorithm,” IEEE Transactions on Aerospace and Electronic Systems, Vol 36, No 3, July 2000.
display(whiteOnBlack=True, suffix=None)

Display the target map to a IPython Notebook.

Parameters: whiteOnBlack – boolean [default True] By default, whiteOnBlack=True, the detected signal is white on a black background. You can invert this with whiteOnBlack=False. suffix – string [default None] Suffix to add to the title.
plot(path, whiteOnBlack=True, suffix=None)

Plot the target map.

Parameters: path – string The path where to put the plot. whiteOnBlack – boolean [default True] By default, whiteOnBlack=True, the detected signal is white on a black background. You can invert this with whiteOnBlack=False. suffix – string [default None] Suffix to add to the file name.

## MatchedFilter¶

### Function¶

pysptools.detection.detect.MatchedFilter(M, t)[source]

Performs the matched filter algorithm for target detection.

Parameters: M – numpy array 2d matrix of HSI data (N x p). t – numpy array A target endmember (p).
Returns: numpy array
Vector of detector output (N).

References

X Jin, S Paswater, H Cline. “A Comparative Study of Target Detection

Algorithms for Hyperspectral Imagery.” SPIE Algorithms and Technologies for Multispectral, Hyperspectral, and Ultraspectral Imagery XV. Vol 7334. 2009.

### Class¶

class pysptools.detection.MatchedFilter[source]

Performs the matched filter algorithm for target detection.

detect(M, t, threshold=None)
Parameters: M – numpy array A HSI cube (m x n x p). t – numpy array A target pixel (p). threshold – float or None [default None] Apply a threshold to the detection result. Usefull to isolate the result.
Returns: numpy array
Vector of detector output (m x n x 1).

References

Qian Du, Hsuan Ren, and Chein-I Cheng. A Comparative Study of Orthogonal Subspace Projection and Constrained Energy Minimization. IEEE TGRS. Volume 41. Number 6. June 2003.

display(whiteOnBlack=True, suffix=None)

Display the target map to a IPython Notebook.

Parameters: whiteOnBlack – boolean [default True] By default, whiteOnBlack=True, the detected signal is white on a black background. You can invert this with whiteOnBlack=False. suffix – string [default None] Suffix to add to the title.
plot(path, whiteOnBlack=True, suffix=None)

Plot the target map.

Parameters: path – string The path where to put the plot. whiteOnBlack – boolean [default True] By default, whiteOnBlack=True, the detected signal is white on a black background. You can invert this with whiteOnBlack=False. suffix – string [default None] Suffix to add to the file name.

## Othogonal Subspace Projection (OSP)¶

### Function¶

pysptools.detection.detect.OSP(M, E, t)[source]

Performs the othogonal subspace projection algorithm for target detection.

Parameters: M – numpy array 2d matrix of HSI data (N x p). E – numpy array 2d matrix of background endmebers (p x q). t – numpy array A target endmember (p).
Returns: numpy array
Vector of detector output (N).

References

Qian Du, Hsuan Ren, and Chein-I Cheng. “A Comparative Study of Orthogonal Subspace Projection and Constrained Energy Minimization.” IEEE TGRS. Volume 41. Number 6. June 2003.

### Class¶

class pysptools.detection.OSP[source]

Performs the othogonal subspace projection algorithm for target detection.

detect(M, E, t, threshold=None)
Parameters: M – numpy array A HSI cube (m x n x p). E – numpy array Background pixels (n x p). t – numpy array A target pixel (p). threshold – float or None [default None] Apply a threshold to the detection result. Usefull to isolate the result.
Returns: numpy array
Vector of detector output (m x n x 1).

References

Qian Du, Hsuan Ren, and Chein-I Cheng. “A Comparative Study of Orthogonal Subspace Projection and Constrained Energy Minimization.” IEEE TGRS. Volume 41. Number 6. June 2003.

display(whiteOnBlack=True, suffix=None)

Display the target map to a IPython Notebook.

Parameters: whiteOnBlack – boolean [default True] By default, whiteOnBlack=True, the detected signal is white on a black background. You can invert this with whiteOnBlack=False. suffix – string [default None] Suffix to add to the title.
plot(path, whiteOnBlack=True, suffix=None)

Plot the target map.

Parameters: path – string The path where to put the plot. whiteOnBlack – boolean [default True] By default, whiteOnBlack=True, the detected signal is white on a black background. You can invert this with whiteOnBlack=False. suffix – string [default None] Suffix to add to the file name.