This task performs a mixture tuned matched filter (MTMF) supervised classification.
Example
This example performs the following steps:
- Opens an AVIRIS hyperspectral image subset.
- Runs a forward minimum noise transform (MNF) to reduce noise in the data.
- Defines three regions of interest (ROIs), each containing nine pixels of a common material.
- Retrieves the spectra from the ROIs and uses their means as endmembers for mixture tuned matched filtering (MTMF).
- Runs the MTMF task, which performs matched filtering and adds an infeasibility image to the results. The infeasibility image is used to reduce the number of false positives that are sometimes found when using matched filtering.
- Displays the result. To see all of the bands, open the Data Manager. ENVI creates three MF Score images (one for each ROI) and three Infeasibility images.
e = ENVI()
File = Filepath('AVIRISReflectanceSubset.dat', $
SUBDIR=['data', 'hyperspectral'], $
ROOT_DIR=e.Root_Dir)
Raster = e.OpenRaster(File)
Task = ENVITask('ForwardMNFTransform')
Task.INPUT_RASTER = Raster
Task.Execute
Subset = ENVISubsetRaster(Task.OUTPUT_RASTER, BANDS=LINDGEN(25))
nSpectra = 9d
roi1 = ENVIROI(NAME='Green Field')
pixelAddr1 = [[77,182],[78,182],[79,182], $
[77,183],[78,183],[79,183], $
[77,184],[78,184],[79,184]]
roi1.AddPixels, pixelAddr1, SPATIALREF=Subset.SPATIALREF
roi2 = ENVIROI(NAME='Soil')
pixelAddr2 = [[386,285],[387,285],[388,285], $
[386,286],[387,286],[388,286], $
[386,287],[387,287],[388,287]]
roi2.AddPixels, pixelAddr2, SPATIALREF=Subset.SPATIALREF
roi3 = ENVIROI(NAME='Ground')
pixelAddr3 = [[296,326],[297,326],[298,326], $
[296,327],[297,327],[298,327], $
[296,328],[297,328],[298,328]]
roi3.AddPixels, pixelAddr3, SPATIALREF=Subset.SPATIALREF
spectra1 = Subset.GetData(ROI=roi1)
mean1 = Total(spectra1,1) / nSpectra
spectra2 = Subset.Getdata(ROI=roi2)
mean2 = Total(spectra2,1) / nSpectra
spectra3 = Subset.GetData(ROI=roi3)
mean3 = Total(spectra3,1) / nSpectra
endmembers = [[mean1],[mean2],[mean3]]
Task = ENVITask('MixtureTunedMatchedFilter')
Task.INPUT_RASTER = Subset
Task.ENDMEMBERS = endmembers
Task.NAMES = ['Green Field', 'Soil', 'Ground']
Task.Execute
dataColl = e.Data
dataColl.Add, Task.OUTPUT_RASTER
View = e.GetView()
Layer = View.CreateLayer(Task.OUTPUT_RASTER)
Syntax
Result = ENVITask('MixtureTunedMatchedFilter')
Input properties (Set, Get): BACKGROUND_THRESHOLD, ENDMEMBERS, INPUT_RASTER, NAMES, OUTPUT_RASTER_URI, USE_SUBSPACE_BACKGROUND
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:
BACKGROUND_THRESHOLD (optional)
Specify the background threshold to use when calculating statistics using the subspace background. The default value is 0.9.
ENDMEMBERS (required)
Specify an array that is [number of bands, number of classes].
INPUT_RASTER (required)
Specify a raster on which to perform the matched filter classification.
NAMES (optional)
This is an array of endmember names.
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.
USE_SUBSPACE_BACKGROUND (optional)
Specify whether to use the subspace background in statistics calculation. The default value is true.
Version History
API Version
4.3
See Also
ENVITask, MatchedFilter Task, ForwardMNFTransform Task