groundTruthSpectralImage
Description
Add-On Required: This feature requires the Hyperspectral Imaging Library for Image Processing Toolbox add-on.
The groundTruthSpectralImage object contains information about
the data source, label definitions, and label data for a spectral image. You can import or
export a groundTruthSpectralImage object to or from the Spectral Image Labeler
app. Manage labeled ground truth data for applications such as pixel classification and
semantic segmentation using this object and its functions.
Note
The Hyperspectral Imaging Library for Image Processing Toolbox™ requires desktop MATLAB®, as MATLAB Online™ and MATLAB Mobile™ do not support the library.
Creation
To manually export a
groundTruthSpectralImageobject from the Spectral Image Labeler app to a MAT file, on the Labeler tab of the app toolstrip, select Export and, under Labels, select To File.To manually export a
groundTruthSpectralImageobject from the Spectral Image Labeler app to the workspace, on the Labeler tab of the app toolstrip, select Export and, under Labels, select To Workspace.To create a
groundTruthSpectralImageobject programmatically, use thegroundTruthSpectralImagefunction.
Syntax
Description
creates a gTruth = groundTruthSpectralImage(dataSource,labelDefs)groundTruthSpectralImage object for the data source
dataSource, and specifies the label definitions to include.
specifies the existing labels for regions of interest (ROI) in the data.gTruth = groundTruthSpectralImage(dataSource,labelDefs,labelData)
specifies the resolution to which to resample all spectral bands of the data source, if
the data source is a multispectral image, using any combination of input arguments from
previous syntaxes.gTruth = groundTruthSpectralImage(___,Resolution=resolution)
Input Arguments
Output Arguments
Properties
Object Functions
changeFilePaths | Change file paths in ground truth data for spectral images |
merge | Merge two or more groundTruthSpectralImage objects |
selectLabelsByGroup | Select labels by group in ground truth data for spectral image |
selectLabelsByName | Select labels by name in ground truth data for spectral image |
Examples
Version History
Introduced in R2026a