Correct array dimensions for 'sam' function?

2 views (last 30 days)
I have an array (called 'DataCube') that has size [1024, 1280, 427]. It was formed from 16-bit images of a 2-d scene (1280x1024 pixels) that was captured at 427 different wavelengths. The scene contains up to 10 different materials to be identified.
Using a spectrometer, the reflectance spectrum of a reference sample of each material was captured. The reference spectrum had 2580 wavelength data points. I could therefore construct an array called 'endmembers' that has dimension size [2580, 10]. Important: Note that the wavelength interval in 'endmembers' is much finer than the interval in 'DataCube'.
I would like to use the 'sam' function to compute the spectral angular distance between each endmember and the spectrum of each pixel in the hypercube. An example is shown here:
However, in that example, the number of wavelength bands in the 'DataCube' is equal to the number of wavelength bands in 'endmembers'.
How can I best process my 'endmembers' array so that it will be correctly interpreted by 'sam'? I think that I may have to use some form of interpolation to reduce the size of my 'endmembers' to [427, 10]. The wavelength values in 'DataCube' are whole numbers (e.g. 550, 552, 554 etc.) but the wavelength values in 'endmembers' are fractions (e.g. 549.908, 550.226, 550.544, 550.861 etc).
  1 Comment
Steve Francis
Steve Francis on 9 Jan 2023
Also, I assume that all values can all be doubles? The example shows the the endmembers as int16.

Sign in to comment.

Answers (0)


Find more on Elementary Polygons in Help Center and File Exchange




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by