SAM – Spectral Angle Map

SAM with an input and a reference image, and its argument dialog Spectral Angle Map (SAM) compares a reference region of an image with every pixel in the image. The output shows how closely the spectrum of each pixel matches the spectrum of the reference.

Inputs

SAM has two inputs, an input image and a reference image. Both must have the same number of spectral bands (at least 2). The reference image can be cropped to a very small region, or it can be the whole image, with the reference window entered in SAM's “roi” argument. If you give no window, the reference is the average of the whole image.

Reference regions

To use several reference regions, enter several windows in “roi”, one set of four numbers after another. Then choose “regions”:

  • average: all the regions are averaged into one reference, and the output has one band.
  • separate: each region is a separate reference, and the output has one band per window.

Output values

Each pixel is treated as a vector with as many dimensions as spectral bands. Each output value is the angle, in radians, between the reference vector and the pixel's vector, so 0 means the pixel has the same spectrum as the reference.

  • For images with only positive values, such as unsigned integers, the values range from 0 to π/2.
  • For floating-point images with negative values, they range from 0 to π.

The output is floating point.