With our database, we provide a set of functions for opening and manipulating the hyperspectral images in MATLAB. These functions can be downloaded as a zipped file:
Naturally, make sure that all of the documents within the Zip file are copied to a folder on your MATLAB path. For more information about the MATLAB path, please see here.
An example session
If you plan on using our PCA reduced hyperspectral images, then a usual session would proceed as follows:
Function descriptions
Summaries of each command in the suite are provided below:
colormatch(hyper)
The colormatch function takes a hyper-spectral image as input and returns two matrices:
rgb, containing the corresponding RGB values for a SONY OLED PVM-2541A by default. rgb has the same number of rows and columns as the input hyper-spectral image, but it only has three layers for the red (R), green (G), and blue (B) chanenls, respectively.
xyz, containing the corresponding XYZ values in the CIE1931 XYZ colorspace. xyz has the same number of rows and columns as the input hyper-spectral image, but it only has three layers for the X, Y, and Z chanenls, respectively.
To convert from the spectra in the hyperspectral image to corresponding rgb and xyz values, colormatch first goes pixel-by-pixel and applies the following transformations at each pixel: