Fit SpectralAngleMapper

Spectral Angle Mapper (SAM). Samples are first normalizes to the unit sphere and then classified using nearest neighbour. See Docs Center > Using ENVI > Spectral Angle Mapper for a more details description.

The Spectral Angle Mapper (SAM) classifier works by comparing the spectral angles between the spectral signature of a pixel and reference spectral signatures for various classes. SAM is advantageous for hyperspectral image classification because it takes into account the spectral information across many narrow wavelength bands, allowing it to capture subtle differences in spectral signatures.It is particularly useful in scenarios where different materials or land cover types have similar spectral shapes but differ in their angles in hyperspectral space.

Usage:

  1. Start the algorithm from the Processing Toolbox panel.

  2. Select a training dataset or create one by clicking the processing algorithm icon, then click run.

    ../../../../_images/fitspectralangle_interface.png

Parameters

Classifier [string]

Scikit-learn python code. See Normalizer, KNeighborsClassifier for information on different parameters.

Default:

from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import Normalizer
from sklearn.neighbors import KNeighborsClassifier

classifier = make_pipeline(Normalizer(), KNeighborsClassifier(n_neighbors=1))
Training dataset [file]

Training dataset pickle file used for fitting the classifier. If not specified, an unfitted classifier is created.

Outputs

Output classifier [fileDestination]

Pickle file destination.

Command-line usage

>qgis_process help enmapbox:FitSpectralanglemapper:

----------------
Arguments
----------------

classifier: Classifier
    Default value:  from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import Normalizer
from sklearn.neighbors import KNeighborsClassifier

classifier = make_pipeline(Normalizer(), KNeighborsClassifier(n_neighbors=1))
    Argument type:  string
    Acceptable values:
            - String value
            - field:FIELD_NAME to use a data defined value taken from the FIELD_NAME field
            - expression:SOME EXPRESSION to use a data defined value calculated using a custom QGIS expression
dataset: Training dataset (optional)
    Argument type:  file
    Acceptable values:
            - Path to a file
outputClassifier: Output classifier
    Argument type:  fileDestination
    Acceptable values:
            - Path for new file

----------------
Outputs
----------------

outputClassifier: <outputFile>
    Output classifier