This task performs Adaptive Coherence Estimator (ACE) target detection analysis, using the mean and covariance from subspace background statistics.
Example
ACE target detection involves multiple steps, as this code example demonstrates:
- Open a spectral library.
- Open a hyperspectral image.
- Get the wavelength values and units from the image.
- Choose an individual spectrum from the spectral library.
- Resample the spectrum to the wavelengths of the image.
- Compute subspace background statistics.
- Run ACE target detection.
- Display the resulting image. Brighter pixels represent a close match to the Dry Grass spectrum.
This example takes several minutes to complete. Copy and paste the following code into the IDL Editor:
e = ENVI()
specLibFile = FILEPATH('veg_2grn.sli', ROOT_DIR=e.ROOT_DIR, $
SUBDIR=['resource', 'speclib', 'veg_lib'])
specLib = ENVISpectralLibrary(specLibFile)
file = FILEPATH('AVIRISReflectanceSubset.dat', $
ROOT_DIR=e.ROOT_DIR, $
SUBDIRECTORY = ['data', 'hyperspectral'])
raster = e.OpenRaster(file)
metadata = raster.METADATA
wavelengths = metadata['Wavelength']
wavelengthUnits = metadata['Wavelength Units']
Task1 = ENVITask('GetSpectrumFromLibrary')
Task1.INPUT_SPECTRAL_LIBRARY = specLib
Task1.SPECTRUM_NAME = 'Dry Grass'
Task1.Execute
Task2 = ENVITask('ResampleSpectrum')
Task2.INPUT_SPECTRUM = Task1.SPECTRUM
Task2.INPUT_WAVELENGTHS = Task1.WAVELENGTHS
Task2.INPUT_WAVELENGTH_UNITS = Task1.WAVELENGTH_UNITS
Task2.RESAMPLE_WAVELENGTHS = wavelengths
Task2.RESAMPLE_WAVELENGTH_UNITS = wavelengthUnits
Task2.Execute
ACETask = ENVITask('SpectralAdaptiveCoherenceEstimatorUsingSubspaceBackgroundStatistics')
ACETask.INPUT_RASTER = raster
ACETask.SPECTRA = Task2.OUTPUT_SPECTRUM
ACETask.THRESHOLD = 0.6
ACETask.Execute
DataColl = e.Data
DataColl.Add, ACETask.OUTPUT_RASTER
View = e.GetView()
Layer = View.CreateLayer(ACETask.OUTPUT_RASTER)
Syntax
Result = ENVITask('SpectralAdaptiveCoherenceEstimatorUsingSubspaceBackgroundStatistics')
Input parameters (Set, Get): INPUT_RASTER, NAMES, OUTPUT_RASTER_URI, REGULARIZATION_METHOD, REGULARIZATION_TOLERANCE, SPECTRA, THRESHOLD
Output parameters (Get only): OUTPUT_RASTER
Parameters marked as "Set" are those that you can set to specific values. You can also retrieve their current values any time. Parameters marked as "Get" are those whose values you can retrieve but not set.
Input Parameters
INPUT_RASTER (required)
Specify a raster on which to perform the target detection.
NAMES (optional)
Specify an array of target names. The array size must be [number of targets].
OUTPUT_RASTER_URI (optional)
Specify a string with the fully qualified filename and path of the associated OUTPUT_RASTER.
- If you do not specify this parameter, or set it to an exclamation symbol (!), ENVI creates a temporary file.
- If you set it to the hash symbol (#), ENVI creates a file in the temporary directory, but this file will not be deleted when ENVI closes.
REGULARIZATION_METHOD (optional)
Specify a method for regularizing the covariance matrix:
- Diagonal: Diagonal loading, increasing all singular values by the tolerance value.
- Dominant: Dominant mode rejection, setting singular values less than the tolerance value to their mean.
- None: No regularization is used.
- Shrink: Shrinkage of singular values based on the tolerance value.
- Threshold: Singular values less than the tolerance value are set to the tolerance value.
- Truncate (default): Singular values less than the tolerance value are set to zero.
REGULARIZATION_TOLERANCE (optional)
Specify the tolerance value to use for matrix regularization. If not set, the following values will be used based on the regularization method
- Diagonal: Ten times the smallest nonzero singular value.
- Dominant: The value prescribed by Gavish & Donoho.
- None: N/A
- Shrink: The Oracle Approximating Shrinkage (OAS) estimator.
- Threshold: The largest singular value times the machine precision.
- Truncate (default): The largest singular value times the machine precision.
SPECTRA (required)
Specify a floating-point array with the target spectra. The array size is [number of bands, number of target spectra].
THRESHOLD (optional)
Specify the fraction of the background to use for calculating the subspace background statistics. The data type is floating-point. The allowable range is 0.5 to 1.0 (the entire image).
Output Parameters
OUTPUT_RASTER
This is a reference to the output raster of filetype ENVI.
Methods
Execute
Parameter
ParameterNames
Properties
DESCRIPTION
DISPLAY_NAME
NAME
REVISION
TAGS
Version History
ENVI 5.2.1 |
Introduced |
ENVI 6.2 |
Added the NAMES, REGULARIZATION_METHOD and REGULARIZATION_TOLERANCE parameters.
|
See Also
ENVITask, SpectralAdaptiveCoherenceEstimator Task, SpectralSubspaceBackgroundStatistics Task, Masking Support in ENVITasks