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

  >  Docs Center  >  Using ENVI  >  RX Anomaly Detection


RX Anomaly Detection

RX Anomaly Detection

RX Anomaly Detection uses the Reed-Xiaoli Detector (RXD) algorithm to detect the spectral or color differences between a region to be tested and its neighboring pixels or the entire dataset.

You can also write a script to perform RX anomaly detection using ENVIRXAnomalyDetectionTask.

See the following sections:


The Reed-Xiaoli Detector (RXD) algorithm extracts targets that are spectrally distinct from the image background. For RXD to be effective, the anomalous targets must be sufficiently small, relative to the background. Results from RXD analysis are unambiguous and have proven very effective in detecting subtle spectral features. ENVI implements the standard RXD algorithm:

Where r is the sample vector, m is the sample mean, and KLxL is the sample covariance matrix.

RXD works with multispectral and hyperspectral images. Bad pixels or lines appear as anomalous, but they do not affect the detection of other, valid anomalies. As with any spectral algorithm, exclusion of bad bands increases the accuracy of results. Currently, this algorithm does not differentiate detected anomalies from one another.

Run the RX Anomaly Detection Tool

  1. From the Toolbox, select Anomaly Detection > RX Anomaly Detection. The File Selection dialog appears.
  2. Select a multi-band file for input. Perform optional spatial and spectral subsetting and/or masking, and click OK.
  3. Click OK. The RX Anomaly Detection Parameters dialog appears.
  4. Select an algorithm from the Anomaly Detection Method drop-down list. The choices are:
    • RXD: Standard RXD algorithm
    • UTD: Uniform Target Detector, in which the anomaly is defined using (1 - μ) as the matched signature, rather than (r - μ). UTD and RXD work exactly the same, but instead of using a sample vector from the data (as with RXD), UTD uses the unit vector. UTD extracts background signatures as anomalies and provides a good estimate of the image background.
    • RXD-UTD: A hybrid of the RXD and UTD methods, in which (r - 1) is used as the matched signature. This is a variant of the UTD approach. Subtracting UTD from RXD suppresses the background and enhances the anomalies of interest. The best condition to use RXD-UTD is when the anomalies have an energy level that is comparable to, or less than, that of the background. In this case, using UTD by itself does not detect the anomalies, but using RXD-UTD enhances them.
  5. From the Mean Calculation Method drop-down list, select how the mean spectrum will be determined. The choices are:
    • Global: The mean spectrum will be derived from the full dataset
    • Local: The mean spectrum will be derived from a localized kernel around the pixel
  6. In the Kernel Size field, enter the kernel size (in pixels) around a given pixel that will be used to create a mean spectrum. Use an odd number. The minimum value is 3, and the maximum value is (number of columns - 1) less than (number of rows - 1). The default value is 9.
  7. Choose the Yes option for Suppress Vegetation if you want to suppress the vegetation signal in the image. See Vegetation Suppression for details. The default option is No.
  8. Enter a filename and location for the Output Raster.
  9. Enable the Preview check box to see a preview of the settings before you click OK to process the data. The preview is calculated only on the area in the Image window and uses the resolution level at which you are viewing the image. See Preview for details on the results.
  10. Enable the Display result check box to display the output image in the Image window when processing is complete.
  11. Click OK. A processing status dialog appears while ENVI builds a covariance matrix and calculates a mean spectrum. ENVI adds the resulting output to the Data Manager and, if the Display Result check box was enabled, adds the layer to the Layer Manager and displays the output in the Image window.

Bright pixels in the output image represent targets that are spectrally distinct from the image background.


Chang, C.-I., and S.-S. Chiang. "Anomaly Detection and Classification for Hyperspectral Imagery." IEEE Transactions on Geoscience and Remote Sensing 40, No. 6 (2002): 1314-1325.

Reed I., and X. Yu, "Adaptive Multiple-Band CFAR Detection of an Optical Pattern with Unknown Spectral Distribution." IEEE Transactions on Acoustics, Speech and Signal Processing 38 (1990): 1760-1770.

See Also

Anomaly Detection, SPEAR Anomaly Detection, THOR Anomaly Detection

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