Main Content

Hyperspectral Image Processing

Import, export, process, and visualize hyperspectral data

Hyperspectral Imaging Library for Image Processing Toolbox™ provides MATLAB® functions and tools for hyperspectral and multispectral image processing and visualization.

Use the functions in this library to read, write, and process data captured by using the hyperspectral and multispectral imaging sensors in a variety of file formats. The library supports national imagery transmission format (NITF), environment for visualizing images (ENVI), tagged image file format (TIFF), metadata text extension (MTL), hierarchical data format (HDF), and standard archive format for Europe (SAFE) file formats.

The library presents a set of algorithms for band selection, denoising, radiometric and atmospheric correction, dimensionality reduction, endmember extraction, abundance map estimation, spectral matching, anomaly detection, computing spectral indices, and segmentation.

The Hyperspectral Viewer app enables you to read hyperspectral and multispectral data, display metadata and geospatial information, visualize individual band images and their histograms, create a spectrum plot for a pixel or region in a data cube, plot endmembers, generate different color or false-color representations, compute spectral indices, and export results.

To perform hyperspectral and multispectral image analysis, download the Hyperspectral Imaging Library for Image Processing Toolbox from the Add-On Explorer. For more information on downloading add-ons, see Get and Manage Add-Ons.

Apps

Hyperspectral ViewerVisualize hyperspectral and multispectral data

Functions

expand all

Read and Write

hypercubeRead hyperspectral data
imhypercubeRead hyperspectral image (Since R2025a)
geohypercubeRead hyperspectral image with geospatial information (Since R2025a)
multicubeRead multispectral data (Since R2025a)
immulticubeRead multispectral image (Since R2025a)
geomulticubeRead multispectral image with geospatial information (Since R2025a)
enviwriteWrite hyperspectral data to ENVI file format
enviinfoRead metadata from ENVI header file
gatherRead data cube of spectral image into workspace (Since R2025a)

ROI Selection

assignDataAssign new data to spectral image data cube
cropDataCrop regions-of-interest of spectral image

Band Selection, Removal, and Resampling

selectBandsSelect bands from spectral image
removeBandsRemove spectral bands from spectral image
resampleBandsResample multispectral data (Since R2025a)

Color Transformation

colorizeEstimate color image of spectral image

Block Processing

applyApply function to each block of spectral image (Since R2025a)
denoiseNGMeetDenoise hyperspectral images using non-local meets global approach
sharpencnmfSharpen hyperspectral data using coupled nonnegative matrix factorization (CNMF) method

Radiometric Calibration

dn2radianceConvert digital number to radiance
dn2reflectanceConvert digital number to reflectance
radiance2ReflectanceConvert radiance to reflectance

Atmospheric Correction

correctOOBCorrect out-of-band effect using sensor spectral response
empiricalLineEmpirical line calibration of hyperspectral data
fastInScenePerform fast in-scene atmospheric correction
flatFieldApply flat field correction to spectral data
iarrApply internal average relative reflectance (IARR) correction to spectral data
logResidualsApply log residual correction to spectral data
rrsCompute remote sensing reflectance
subtractDarkPixelSubtract dark pixel value from spectral data
sharcPerform atmospheric correction using satellite hypercube atmospheric rapid correction (SHARC)

Spectral Correction

smileMetricCompute spectral smile metrics of hyperspectral data (Since R2021a)
reduceSmileReduce spectral smile effect in hyperspectral data cube
hyperpcaPrincipal component analysis of hyperspectral data
hypermnfMaximum noise fraction transform of hyperspectral data
inverseProjectionReconstruct data cube from principal component bands
ppiExtract endmember signatures using pixel purity index
fippiExtract endmember signatures using fast iterative pixel purity index
nfindrExtract endmember signatures using N-FINDR
countEndmembersHFCFind number of endmembers
estimateAbundanceLSEstimate abundance maps
readEcostressSigRead data from ECOSTRESS spectral library
resampleSignatureResample spectral signature to required wavelengths (Since R2024a)
removeContinuumNormalize spectral signature (Since R2024a)
samMeasure spectral similarity using spectral angle mapper
sidMeasure spectral similarity using spectral information divergence
jmsamMeasure spectral similarity using Jeffries Matusita-Spectral Angle Mapper method
sidsamMeasure spectral similarity using spectral information divergence-spectral angle mapper hybrid method
ns3Measure normalized spectral similarity score
spectralMatchIdentify unknown regions or materials using spectral library
detectTargetDetect target in hyperspectral and multispectral image (Since R2024a)
anomalyRXDetect anomalies using Reed-Xiaoli detector
spectralIndicesCompute spectral indices
customSpectralIndexCompute spectral index using custom formula (Since R2023a)
ndviNormalized difference vegetation index
hyperslic2-D superpixel oversegmentation of hyperspectral images (Since R2023b)
hyperseganchor Segment hyperspectral and multispectral images using fast spectral clustering with anchor graphs (Since R2024a)

Topics

Get Started

Classification

Region Identification

Digital Twin

Segmentation

Featured Examples