SAM

Spectral angle mapper image classification


EnvironmentsPYTHON :: EASI :: MODELER
Batch ModeYes
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Algorithm :: Acknowledgements :: References :: Related

Back to top

Description


Classifies hyperspectral image data, on the basis of a set of reference spectra that define the classes.
The program processes vector-quantized image data generated by the Hierarchical Self- Organizing Cluster Vector Quantization algorithm. Vector-quantized images are processed from 50 to 150 times faster than the corresponding non-vector-quantized images.

The SAM algorithm requires that the image data differ from the physical units of the reference spectra by at most a gain factor that is uniform over all bands. In particular, this means that if the image data are "raw" DN values or represent at- sensor radiance (and therefore exhibit wavelength-specific atmospheric effects) and the reference spectra represent material reflectance then the user should not expect SAM to produce good results.

The image file must contain band response profile metadata.

Back to top

Parameters


Name Type Length Value range
Input Window Integer 0 - 4 Xoffset, Yoffset, Xsize, Ysize
InputBitmap: Input bitmap segment Bitmap port 0 - 1 1 -
Spectral Library* String 1 -    
Output: Output raster channel(s) Raster port 0 - 1024  
OutputClass: Output classification channel* Raster port 1 - 1 1 -
Spectral Angle Threshold Float 0 - 1 0 - 180
Angle Scaling Factor Float 0 - 1 Default: 1.0
Radiometric Transformation Level Integer 0 - 1 0 -
Input: Input raster channel(s) Raster port 0 - 1024  
Wavelength Interval Float 0 - 2  
Valid Bands Only String 0 - 1 YES | NO
Default: NO

* Required parameter
Back to top

Parameter descriptions

Input Window

Optionally specifies the rectangular window (Xoffset, Yoffset, Xsize, Ysize) of image data read from the input channels. If this parameter is not specified, the entire image is processed by default.

Xoffset, Yoffset define the upper-left starting pixel coordinates of the window. Xsize is the number of pixels that define the window width. Ysize is the number of lines that define the window height.

Either DBIW (input window) or DBIB (input bitmap) may be specified.

InputBitmap: Input bitmap segment

Specifies a bitmap segment that describes an image region to which the processing will be restricted.

Either DBIW (input window) or DBIB (input bitmap) may be specified.

Spectral Library

Specifies the name of the input spectra library file.

Output: Output raster channel(s)

Specifies the output channel(s) to which the spectral angles for each class will be written. If this parameter is specified, there must be one output channel for each input reference spectrum. The i'th spectrum in the input spectra library file corresponds to the i'th channel in the specified channel list.

Spectral angles are 32-bit real values between 0 and 180. If output channels are not 32r, spectral angles are truncated to integer values.

Duplicate channels are not allowed. No data set band channels can be selected.

OutputClass: Output classification channel

Specifies the output channel to receive the classification results. The datatype of the output channel must cover the number of spectral records present in the spectral library or clipping of the output results will occur. In most cases, 8-bit unsigned channel are sufficient; however, for larger spectral libraries, a 16-bit unsigned channel may be required.

No data set band channels can be selected.

Spectral Angle Threshold

Optionally specifies the spectral angle threshold, in degrees (between 0 and 180). If, for a given pixel, the spectral angles for all classes are greater than SAMTHRES, that pixel is assigned to the NULL class (value 0).

Angle Scaling Factor

Optionally specifies a scaling factor to apply to the spectral angle values before saving them in the output channels. This is especially useful when the spectral angles are written to 8-bit channels rather than 32-bit real channels.

For example, to change the output range to 0 - 255, set ANGSCALE to 255/180.

A negative value should not be specified for ANGSCALE when output channels are unsigned 8-bit or 32-bit. ANGSCALE must not be zero.

Radiometric Transformation Level

Specifies the radiometric transformations associated with the data set that is applied to the stored pixel values.

RTLEVEL cannot be greater than the number of radiometric transformations available for the selected data set. If this parameter is not specified, it defaults to the number of radiometric transformations present for the selected data set.

Input: Input raster channel(s)

Specifies the input channels on which to perform the classification.

Only data set band channels may be selected.

Wavelength Interval

Specifies that the selected bands are to be restricted to those whose center wavelength is either inside or outside a closed interval, specified in nanometers. By default, no restriction is applied.

The wavelength interval may be specified as follows:

This parameter has no effect if the input file contains no band center wavelength metadata.

Valid Bands Only

Specifies whether the selected bands are to be restricted to those with "plot" or "bmask" (begin mask) quality values. The default is NO.

This parameter has no effect if the input file contains no band-validity metadata.

Back to top

Details

The Spectral Angle Mapper (SAM) is designed to classify hyperspectral image data, on the basis of a set of reference spectra that define the classes. SAM computes the "spectral angle" between each band vector in a specified region (DBIW) of the input image (FILI) and each of the spectra read from the input spectra file (SPECFILE). The spectral are treated as band vectors for the purpose of the angle computation. A classification channel (DBCLASS) indicates, for each image pixel, the input reference spectrum with which it has the smallest angle (the minimum spectral angle). Pixels are assigned to the NULL (0) class if the minimum spectral angle is greater than the specified threshold value (SAMTHRES).

If desired, the spectral angles for each class can be saved to a set of output image channels (DBOC). The spectral angle is a 32-bit real value between 0 and 180. Each spectral angle can be multiplied by a real scaling factor (ANGSCALE) before being saved. This is useful when saving spectral angle values on 8-bit channels, to make use of the full range of values (between 0 and 255).

Only image pixels under the bitmap (DBIB) or the input image window (DBIW) are classified.

If necessary, the input reference spectra are automatically resampled to match the image wavelength sampling.

The SAM results are unaffected by the relative scaling of the image band vectors and the reference spectra. This is because the angle between two vectors depends only on the directions of the vectors and not on their magnitudes. Therefore, if the image data differs from the physical units of the reference spectra by only a "gain" factor that is uniform over all bands, the SAM results will be exactly the same as if the image data were perfectly calibrated to the reference spectra units. Note that this is generally not the case if the reference spectra represent material reflectance and the image data are "raw" DN values or represent at-sensor radiance. In such cases, the image values will contain atmospheric absorption features that require at least band-specific (non-uniform) gain values for removal.

A tabular summary of the classification results is printed to the REPORT device.

Back to top

Algorithm

This program is based on an algorithm developed by Dr. J.W. Boardman of the Center for the Study of Earth from Space (CSES), Cooperative Institute for Research in Environmental Studies (CIRES) and the Department of Geological Sciences, University of Colorado, Boulder.

The Spectral Angle Mapper (SAM) algorithm is described in pages 156-157 of the following article:

Kruse, F.A., Lefkoff, A.B., Boardman, J.W., Heidebrecht, K.B., Shapiro, A.T., Barloon, P.J., and Goetz, A.F.H. (1993), "The Spectral Image Processing System (SIPS) - Interactive Visualization and Analysis of Imaging Spectrometer Data", Remote Sensing of Environment, Vol. 44, pp. 145-163.

The algorithm computes the angle between a band-vector from an image and a reference spectrum that is interpreted as a vector. This angle is meant to be interpreted as a measure of "spectral similarity" between the band-vector and the reference spectrum; the smaller the angle, the greater the similarity.

The algorithm assumes that the reference spectrum represents the same wavelength sampling as the image (that is, that the number of measurement values in the reference spectrum equals the number of bands in the image, and that the band center wavelength values match the wavelength coordinates of the reference spectrum measurement values).

The angle between a band vector, B, and a reference spectrum, R, is computed as follows:

B(i)  = band-vector values (i = 1 to n)
R(i)  = reference spectrum values (i = 1 to n)

|B|   = square root of ( sum of (B(i)*B(i)) )
|R|   = square root of ( sum of (R(i)*R(i)) )

angle = arccos ( (Sum of (B(i)*R(i))) / ( |B| * |R| ) )

This measure of similarity is insensitive to gain factors because the angle between two vectors is invariant with respect to the lengths of the vectors. As a result, laboratory-measured material spectra can be directly compared to remotely sensed apparent reflectance spectra (from hyperspectral images), which inherently have an unknown gain factor related to topographic illumination effects.

The angle between each reference spectrum and each band vector is computed. SAM assigns the angles to the output channels (DBOC). Then, each pixel is assigned to the class defined by the reference spectrum with which its band vector has the smallest angle (unless the angle is greater than the threshold value (SAMTHRES), in which case the pixel is assigned the NULL class). The class assigned to each pixel is saved in the output classification channel (DBCLASS).

Back to top

Acknowledgements

PCI Geomatics received financial support from the Canadian Space Agency/L'Agence Spatiale Canadienne through the Earth Observation Application Development Program (EOADP) for the development of this software, under contract 9F028-0-4902/12.

Back to top

References

Boardman, J. W., "Analysis, understanding and visualization of hyperspectral data as convex sets in n-space", SPIE Proceedings, Vol. 2480. pp. 14-22. 1995.

Kruse, F.A., Lefkoff, A.B., Boardman, J.W., Heidebrecht, K.B., Shapiro, A.T., Barloon, P.J., and Goetz, A.F.H. (1993), "The Spectral Image Processing System (SIPS) - Interactive Visualization and Analysis of Imaging Spectrometer Data", Remote Sensing of Environment, Vol. 44, pp. 145-163.

© PCI Geomatics Enterprises, Inc.®, 2024. All rights reserved.