IDCubeCloud Documentation

Spectral Library

Match spectra to references, build custom libraries, and perform reference-based classification.

Technical Reference Revised September 2026

1. Overview

The Spectral Library provides a set of reference spectra (vegetation types, soils, water, minerals, man-made surfaces) that can be matched against any pixel or region of interest in the loaded scene. It enables rapid material identification without labeled training data.

Key points

  • Built-in library of 17 reference spectra covering common land-cover types (Vegetation, Water, Soil, Mineral, Man-made, Other).
  • Searchable ECOSTRESS reference browser for loading published spectra into your session.
  • Supports a Custom Library - add your own spectra from the current scene or from uploaded files.
  • Favorites keep frequently used spectra available across sessions.
  • Three similarity metrics available: SAM, SID, and Euclidean Distance.
  • Whole-image classification assigns the closest library match to every pixel.

Matching scope: matching and classification run against the spectra you select in the Custom and Favorites lists. The built-in reference library is excluded by default so generic reference materials do not dilute results.

2. What the Spectral Library Does

1. Loaded hyperspectral scene [H x W x B]

2. User selects a pixel or region of interest

3. Pixel spectrum extracted to compared to each reference spectrum in the library

4. Similarity score computed for each reference (SAM / SID / Euclidean)

5. Top N matches ranked and displayed with scores (optional)

6. Whole-image classification: every pixel compared to all references each pixel assigned to the closest matching material class classified map displayed in viewer

3. Where to Find It

1. Load any dataset from My Files or the Satellite page.

2. Click Spectral Library in the feature toolbar.

3. The Spectral Library panel appears in the left sidebar, and the spectral signature chart updates in the right panel.

4. Step-by-Step Workflow

Step 1 Load Data

Any loaded scene works. Satellite data or lab-acquired hyperspectral files are both supported.

Step 2 Open Spectral Library

Click Spectral Library in the feature toolbar.

Step 3 Select Matching Algorithm

Choose from the algorithm dropdown

Algorithm
Full Name
Best For
SAM
Spectral Angle Mapper
Shape-based matching; insensitive to illumination differences
SID
Spectral Information Divergence
Probabilistic; sensitive to subtle spectral differences
ED
Euclidean Distance
Simple magnitude-based; sensitive to brightness differences

Step 4 Set Number of Matches

Set Top to the number of best matches to display (default: 5).

Step 5 Click on a Pixel

Move the cursor over the image and click a pixel - or the live spectrum updates automatically as you hover. Click Match Pixel (x, y) to run the comparison.

Step 6 Review Results

The sidebar shows the top N matches with their scores. Lower SAM/SID scores = better match.

5. Matching Algorithms Explained

Spectral Angle Mapper (SAM)

Measures the angle between two spectra treated as vectors in N-dimensional space. A smaller angle = greater similarity.

  • Range: 0 (perfect match) to π/2 (orthogonal, no similarity)
  • Advantage: Insensitive to brightness/illumination differences
  • Disadvantage: Cannot distinguish materials with similar shapes but different reflectance magnitudes

Spectral Information Divergence (SID)

Treats spectra as probability distributions and measures the divergence between them.

  • Range: 0 (identical) to higher values (dissimilar)
  • Advantage: Captures spectral variability beyond shape
  • Use when: Distinguishing materials with subtle differences (e.g., vegetation stress levels)

Euclidean Distance (ED)

Standard L2 distance between spectral vectors.

  • Advantage: Simple and fast
  • Disadvantage: Sensitive to overall brightness; normalize spectra first for best results

6. Output and Interpretation

Output
What It Shows
Match list
Top N reference matches ranked by similarity score
Spectral Signature chart
Overlay of the pixel spectrum and matched reference spectra
Classified map
(Whole-image only) Color-coded raster with each pixel assigned a class

Score interpretation for SAM

SAM Score
Interpretation
< 0.05
Excellent match
0.05 - 0.15
Good match
0.15 - 0.30
Moderate - possible match
> 0.30
Poor match - unlikely same material

7. Custom Library, ECOSTRESS and Favorites

Build a custom library

1. Open the Custom dropdown in the Spectral Library bar.

2. Add spectra in any of these ways

  • Upload .txt - import a wavelength/value spectrum file.
  • Capture Spectrum - draw a region on the image to capture its mean spectrum, then name and save it.
  • ECOSTRESS - open the browser, search the reference collection, and load a spectrum into the session.

3. Saved spectra can be kept for the session only, or saved to the cloud so they persist across sessions.

4. Tick the checkbox beside each spectrum you want included in matching. The count of selected spectra is shown in the list header.

Favorites

  • Click the star beside any spectrum to add it to Favorites.
  • Favourites persist across sessions and appear in their own dropdown.
  • A favourite ECOSTRESS spectrum that is not currently loaded shows a Load button to pull it back into the session.

If you run a match with nothing selected, the panel reports that no spectra are selected rather than returning an empty result.

8. Whole-Image Classification

The Classify button runs spectral matching across every pixel in the scene:

1. Set a Threshold (default 0.3 for SAM) - pixels with no match scoring below this threshold are left unclassified.

2. Click Classify (SAM) (or the selected algorithm).

3. The classified map appears in the viewer - each class has a distinct color.

Threshold
Effect
Low (0.1)
Only very close matches are classified; many pixels unclassified
Medium (0.3)
Balanced - recommended starting point
High (0.5+)
Nearly all pixels classified; more false positives

9. Known Limitations

Limitation
Detail
Library wavelength mismatch
Built-in library spectra are resampled to match the loaded data's wavelengths. Coarse spectral resolution reduces discrimination ability.
Scale dependency (ED)
Euclidean distance is sensitive to data scaling. Normalize bands if using ED.
No atmospheric correction check
Library spectra assume surface reflectance. Raw DN data will not match well.
Whole-image speed
Large scenes may take several seconds for full classification.

10. Common Use Cases

Use Case
Workflow
Identify unknown pixel material
Load scene to Spectral Library to click pixel to review top matches
Map vegetation vs bare soil
Spectral Library to Classify (SAM, threshold 0.2)
Build site-specific reference library
Identify representative pixels to Add to Custom Library to Classify
Validate clustering output
Clustering to click cluster centroid to Spectral Library match

Part of the IDCubeCloud User Documentation - see also: PCA Guide, Vegetation Indices Guide, Clustering Guide.

Manual revision: September 2026

↑ Back to top