Skip to main content

A package for accurate and vivid visualization of hyperspectral images

Project description

TrueColorHSI

Overview

Traditional methods for visualizing (previewing) hyperspectral images often use only a few selected spectral bands, which can lead to incomplete or distorted images that don't reflect how we truly see the world. These approaches also overlook how our eyes naturally perceive color.

TrueColorHSI solves this by using colorimetric science, standard illuminants, and standard observers to integrate the entire visible spectrum. This results in vivid, accurate images that better represent hyperspectral data and are easier for users to understand, providing a more intuitive and natural way to explore the information.

Setup Instructions

# Clone the repo and cd to the folder.
git clone https://github.com/fz-rit/TrueColorHSI.git
cd TrueColorHSI

# Create a new conda environment with Python 3.9 (not the latest python), 
# since it's relatively more compatible to different packages as of 11/14/2024.
conda create -n truecolorhsi_env python=3.9
conda activate truecolorhsi_env

# Install the dependencies with pip
pip install spectral matplotlib scipy scikit-image pysptools
pip install colour-science


# [Optional] If you want to download the test dataset. Login to huggingface
pip install huggingface_hub
huggingface-cli login # To login, create and add your token according to the guide

Files description

File/Folder Description
Accessories.py Tool function of getting the spectral power distribution of illuminant.
true_color_of_hyperspectral_image.py The true color visualization script.

Usage

  1. Clone the repo and setup the environment;
  2. [Optional: if you want to run the test dataset] Clone the test dataset to a specific folder:
git clone fz-rit-hf/rit-cis-hyperspectral-Symeon # you may need to request for access. 
  1. Adjust the input paths in lines 220-222 in the true_color_of_hyperspectral_image.py file. Then run the script:
python true_color_of_hyperspectral_image.py

Example results

Visualization from RGB bands Figure 1. Visualization from appximated RGB bands (traditional method).

Visualization from colorimetric conversion Figure 2. Visualization from colorimetric conversion (our method).

True color visualization from different illuminants Figure 3. True color visualization using different standard illuminants (D50, D65, D75). Adjusting the chosen illuminant allows for tuning the color temperature.

illuminant_spd_and_CIE_xyz
Figure 4. The spectral power distribution of the D65 illuminant and the CIE xyz curves.

Citation

If you find this repository useful in your research, please consider the following citation.

@article{amiri2024colorimetric,
  title={Colorimetric characterization of multispectral imaging systems for visualization of historical artifacts},
  author={Amiri, Morteza Maali and Messinger, David W and Hanneken, Todd R},
  journal={Journal of Cultural Heritage},
  volume={68},
  pages={136--148},
  year={2024},
  publisher={Elsevier}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

TrueColorHSI-0.1.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

TrueColorHSI-0.1.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file TrueColorHSI-0.1.0.tar.gz.

File metadata

  • Download URL: TrueColorHSI-0.1.0.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.21

File hashes

Hashes for TrueColorHSI-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dc484fc5a8cb2b4732c1e10b8e6b799eb2e389468c6a4cca006bf48335cda74a
MD5 56b3b38eceb10719d9185c6f983a930b
BLAKE2b-256 f6e3d2ef26b26841c6605536b917cdc2ef16b37e2837e1543c60214334be5441

See more details on using hashes here.

File details

Details for the file TrueColorHSI-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: TrueColorHSI-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.21

File hashes

Hashes for TrueColorHSI-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5fd0ef0904e51704d6901c6765eb68803bb9d4c298cf874ad73875c193e10799
MD5 8cb003a7cea1eb4537f6b23f59d1c578
BLAKE2b-256 7e09deda90e83f0c53e8c85d24155fb0609ec2382c7e91d5b7b87df60caefc49

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page