This tool enables the visualization and analysis of hyperspectral data cubes by allowing users to interactively select points on a False Color Composite (FCC) image. Once the points are selected, the corresponding spectra are plotted for easy inspection, saving to library and to compare with other spectrums.
Repository: https://github.com/SomshuvraBasu/SpectraVis
The spectral visualization module enables comprehensive exploration of pixel spectra within a Hyperspectral Data Cube. This feature allows:
- Detailed visual comparison of spectral signatures
- Interactive examination of individual pixel spectral characteristics
- Intuitive representation of spectral information across multiple bands
A robust spectral library management system that:
- Generates libraries of high-quality, preprocessed spectral signatures
- Ensures data integrity through quality assurance processes
- Provides a comprehensive reference database for spectral analysis
- Supports easy storage and retrieval of known spectral signatures
Advanced spectral matching capabilities utilizing the Spectral Angle Mapper (SAM) algorithm:
- Computes spectral similarity between target pixels and reference spectra
- Treats spectra as vectors in n-dimensional spectral space
- Calculates the spectral angle between compared spectra
- Provides quantitative similarity measurements
- Supports identification and classification of spectral signatures
The Spectral Angle Mapper (SAM) is a geometrical method for spectral matching that:
- Compares the angle between the reference spectrum and target spectrum
- Treats spectra as vectors in n-dimensional space
- Provides a measure of spectral similarity independent of illumination effects
- Input: Two spectra as n-dimensional vectors
- Computation: Calculates the spectral angle between the vectors
- Output: Angle value representing spectral similarity
- Load your hyperspectral data cube and metadata file.
- View the FCC image of the hyperspectral cube.
- Click on the image to select pixels.
- Click the Submit button to display the radiance spectra for the selected pixels.
- Clone the repository:
git clone https://github.com/SomshuvraBasu/SpectraVis.git
- Navigate into the repository directory:
cd SpectraVis
- Install requirements:
pip install -r requirements.txt
Run the tool with the following command:
python app.py



https://www.youtube.com/watch?v=JJNc62DRIW4
SpectraVis.-.HyperSpectral.Image.Analysis.Tool.mp4
app.py
: Entry point of the application.spectralToolsQT.py
: Contains the main implementation classes for the application.utils/
: Contains helper scripts for image generation and plotting.analyseSAM.py
: Compares Spectrums using Spectral Angle Mapper (SAM).FCC.py
: Generates the FCC image from the hyperspectral cube.pixelSpectrum.py
: Extracts the Spectral Data.imageSpectrum.py
: Handles spectra plotting for selected pixels.canvasHandler.py
: Handles the user interface canvas.spectralLib.py
: Loads the spectral library.
Tools/
: Contains the scripts for individual toolsvisualise.py
: Visualising the hyperspectral data cube.createLib.py
: Create a spectral library from the data cube.compare.py
: Compares Spectrums using Spectral Angle Mapper (SAM).
data/
: Contains the hyperspectral data cube and metadata files.
- Python 3.8+
- NumPy
- Matplotlib
- PyQt