hyperspec2srgb

The hyperspec2srgb function creates a sRGB colour image from a hyperspectral image matrix. For example from hyperspectral images of the spectral simulation tool LUMOS.

Usage:

srgb = hyperspec2srgb(im,lam)

Where:

ParameterDescription
srgbIs the returned srgb image colour matrix.
im Is the hyperspectral image input struct or matrix:
struct containing the field lambda and image
3-dim matrix: rows \times columns \times wavelengths
lamDefines the wavelengths of the hyperspectral image, vector.

Examples

Plot sRGB image derived from hyperspectral image data:

IM = readhyperspec('hyperspec.mat')
srgb = hyperspec2srgb(IM);
image(srgb)
axis equal off

See also: readhyperspec

Result:


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.