This function performs the BandMax background suppression algorithm to derive a subset of significant bands using input target and background spectra. The resulting band subset can be used to highlight targets and suppress backgrounds in a classification or other analysis.
Syntax
Result = ENVI_BANDMAX_SELECT_BANDS(TargetSpectra, BackgroundSpectra [, GOOD_BAND_COUNT=variable] [, GOOD_BAND_LIST=variable] [, SIGNIFICANCE=variable] [, THRESHOLD=value])
Return Value
The return value is an array of band positions that are the best for differentiating between the target and background spectra. This value can be used as a POS input to other ENVI Classic processing functions. If no significant bands are found, a value of –1 is returned.
Arguments
TargetSpectra
This is an array of one or more spectra representing the input targets.
BackgroundSpectra
This is an array of one or more spectra representing the input backgrounds. These spectra must have the same number of bands as the TargetSpectra argument.
Keywords
GOOD_BAND_COUNT (optional)
Use this keyword to specify a named variable that contains a scalar value with the number of significant bands found by the BandMax algorithm.
GOOD_BAND_LIST (optional)
Use this keyword to specify a named variable that contains an array of zeros and ones, indicating which bands the BandMax algorithm determines are significant. Each value is set to 0 (indicating this band should be ignored for processing) or 1 (indicating this band is significant for isolating the targets from the background data). If no significant bands are found, the variable returned by this keyword is undefined.
SIGNIFICANCE (optional)
Use this keyword to specify a named variable that contains an array of band significance values. The array returned by this keyword contains floating-point values ranging from 0 to 1. Each value indicates how well the corresponding band differentiates between target and background spectra. If an error is encountered in the processing, a value of –1 is returned.
THRESHOLD (optional)
Use this keyword to specify a floating-point value ranging from 0.0 to 1.0. This value represents the threshold for the minimum significance value that determines which bands this function returns. The default threshold value is calculated to select 25% of the input bands, but never less than six bands. If you specify an undefined named variable for this keyword, the default threshold value is returned for that variable.
Examples
The following example uses the cup95eff.int file, which is provided in your installation of ENVI Classic:
Windows: C:\Program Files\INSTALL_DIR\ENVIxx\classic\data
UNIX and Linux: INSTALL_DIR/envixx/classic/data
Where xx is the software version number.
The jpl1.sli file is in the envixx\classic\spec_lib\jpl_lib directory. Input image wavelengths are derived from the cup95eff.int file to resample the spectra from the library in the jpl1.sli file. One resampled spectrum is used as a target, and another is used as the background in the BandMax algorithm.
PRO BandMaxExample
compile_opt IDL2
wavelengths are used to resample the input spectra.
cupriteFile = envi_pickfile(filter='*.int', $
title='Find the "cup95eff.int" File')
if (cupriteFile eq '') then return
envi_open_file, cupriteFile, r_fid=cupriteFID
envi_file_query, cupriteFID, wl=cupriteWLs
and wavelengths. The number of samples value
specific spectra in the library. The
resample the input spectra.
libFile=envi_pickfile(filter='*.sli', $
title='Find the "jpl1.sli" File')
if (libFile eq '') then return
envi_open_file, libFile, r_fid=libFID
envi_file_query, libFID, ns=libNS, wl=libWLs
library.
libSpectrum3=envi_get_slice(fid=libFID, $
line=3, pos=0, xs=0, xe=libNS - 1)
envi_resample_spectra, libWLs, libSpectrum3, cupriteWLs, $
targetSpectrum
the input spectral library.
libSpectrum83 = envi_get_slice(fid=libFID, line=83, $
pos=0, xs=0, xe=libNS - 1)
image.
envi_resample_spectra, libWLs, libSpectrum83, cupriteWLs, $
backgroundSpectrum
Kaolinite background to obtain a subset for the
subset = envi_bandmax_select_bands(targetSpectrum, $
backgroundSpectrum)
the POS keyword of any ENVI library routine. It
differentiate the target from the background
print, subset
envi_batch_exit
END
This example produces the following subset of band positions:
2 3 6 11 14 15 17 18 21 29 30 35 37
API Version
4.3