Welcome to the Harris Geospatial product documentation center. Here you will find reference guides, help documents, and product libraries.


  >  Docs Center  >  ENVI API  >  Processing  >  ENVISpectralAdaptiveCoherenceEstimatorUsingSubspaceBackgroundStatisticsTask

ENVISpectralAdaptiveCoherenceEstimatorUsingSubspaceBackgroundStatisticsTask

ENVISpectralAdaptiveCoherenceEstimatorUsingSubspaceBackgroundStatisticsTask

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:

  1. Open a spectral library.
  2. Open a hyperspectral image.
  3. Get the wavelength values and units from the image.
  4. Choose an individual spectrum from the spectral library.
  5. Resample the spectrum to the wavelengths of the image.
  6. Compute subspace background statistics.
  7. Run ACE target detection.
  8. 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:

; Launch the application
e = ENVI()
 
; Open a spectral library
specLibFile = FILEPATH('veg_2grn.sli', ROOT_DIR=e.ROOT_DIR, $
  SUBDIR=['resource', 'speclib', 'veg_lib'])
specLib = ENVISpectralLibrary(specLibFile)
 
; Open a hyperspectral image       
file = FILEPATH('AVIRISReflectanceSubset.dat', $
  ROOT_DIR=e.ROOT_DIR, $
  SUBDIRECTORY = ['data', 'hyperspectral'])
raster = e.OpenRaster(file)
 
; Get wavelength values and units from raster
metadata = raster.METADATA
wavelengths = metadata['Wavelength']
wavelengthUnits = metadata['Wavelength Units']
 
; Get the selected spectrum from spectral library
Task1 = ENVITask('GetSpectrumFromLibrary')
Task1.INPUT_SPECTRAL_LIBRARY = specLib
Task1.SPECTRUM_NAME = 'Dry Grass'
Task1.Execute
 
; Get the resample spectrum task from the catalog of ENVITasks
Task2 = ENVITask('ResampleSpectrum')
 
; Define inputs
; Spectrum from library to be resampled
Task2.INPUT_SPECTRUM = Task1.SPECTRUM
 
; Wavelengths from spectral library
Task2.INPUT_WAVELENGTHS = Task1.WAVELENGTHS
 
; Wavelength units from spectral library
Task2.INPUT_WAVELENGTH_UNITS = Task1.WAVELENGTH_UNITS
 
; Wavelengths from raster
Task2.RESAMPLE_WAVELENGTHS = wavelengths
 
; Wavelength units from raster
Task2.RESAMPLE_WAVELENGTH_UNITS = wavelengthUnits
 
; Run the resample spectrum task
Task2.Execute
 
; Get the ACE task from the catalog of ENVITasks
ACETask = ENVITask('SpectralAdaptiveCoherenceEstimatorUsingSubspaceBackgroundStatistics')
 
; Define inputs
ACETask.INPUT_RASTER = raster
ACETask.SPECTRA = Task2.OUTPUT_SPECTRUM
ACETask.THRESHOLD = 0.6
 
; Define outputs
ACETask.OUTPUT_RASTER_URI = e.GetTemporaryFilename()
 
; Run the task
ACETask.Execute
 
; Get the collection of data objects currently available in the Data Manager
DataColl = e.Data
 
; Add the output to the Data Manager
DataColl.Add, ACETask.Output_Raster
 
; Display the result
View1 = e.GetView()
Layer1 = View1.CreateLayer(ACETask.Output_Raster)

Syntax


Result = ENVITask('SpectralAdaptiveCoherenceEstimatorUsingSubspaceBackgroundStatistics')

Input properties (Set, Get): INPUT_RASTER, OUTPUT_RASTER_URI, SPECTRA, THRESHOLD

Output properties (Get only): OUTPUT_RASTER

Properties marked as "Set" are those that you can set to specific values. You can also retrieve their current values any time. Properties marked as "Get" are those whose values you can retrieve but not set.

Methods


This task inherits the following methods from ENVITask:

AddParameter

Execute

Parameter

ParameterNames

RemoveParameter

Properties


This task inherits the following properties from ENVITask:

COMMUTE_ON_DOWNSAMPLE

COMMUTE_ON_SUBSET

DESCRIPTION

DISPLAY_NAME

NAME

REVISION

TAGS

This task also contains the following properties:

INPUT_RASTER (required)

Specify a raster on which to perform the target detection.

OUTPUT_RASTER

This is a reference to the output raster of filetype ENVI.

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 property, or set it to an exclamation symbol (!), a temporary file will be created.

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).

Version History


ENVI 5.2, Service Pack 1

Introduced

API Version


3.2

See Also


ENVITask, ENVITask::Parameter, ENVISubsetRaster, ENVISpectralAdaptiveCoherenceEstimatorTask, ENVISpectralSubspaceBackgroundStatisticsTask



© 2018 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us