Scene basis functions - ISET/isetcam GitHub Wiki


Scene spectral basis representations

A scene's radiance data can be large: one value per spatial sample per wavelength. Even though the underlying spectral curves are sampled at many wavelengths, natural illuminants and surface reflectances are usually well approximated by a small number of basis functions — a handful of principal components typically captures most of the variance in a set of measured spectra. ISETCam stores and transmits large spectral datasets (particularly hyperspectral scenes) using this compressed, linear-model representation rather than the full wavelength-by-wavelength array.

The representation

A basis-function scene is stored as:

  • basis — a small set of spectral basis functions (for example, the leading principal components of a set of measured reflectances or radiances).
  • mcCOEF — the per-pixel coefficients that weight those basis functions at each spatial location.
  • an optional imgMean — a mean spectrum added back after reconstruction, when the basis was computed from mean-subtracted data (i.e., principal components rather than a plain SVD).

Reconstructing the scene

sceneFromBasis reconstructs the full spectral radiance from this compressed form:

% sceneS is a structure with fields mcCOEF, basis, and (optionally) imgMean,
% as returned when downloading a compressed hyperspectral dataset.
scene = sceneFromBasis(sceneS);

Internally this is a linear transform: photon radiance at each pixel is the basis functions weighted by that pixel's coefficients (imageLinearTransform(mcCOEF, basis.basis')), with the mean spectrum added back in if one was stored. The result is an ordinary ISETCam scene structure, usable anywhere a scene created by sceneCreate or sceneFromFile is used.

This is the representation used by many of the hyperspectral and multispectral datasets downloaded with ieWebGet — see Spectral Scene Data for the datasets themselves and their physical calibration, and Scene Radiance for the uncompressed scene representation this reconstructs.