HV SDK
Rust based library with HSI related functions, with bindings available for other programming languages (Python bindings currently available and C/C++ bindings coming soon).
The library makes it easy to work with different HSI sources as it supports input and output of multiple datacube file formats (currently PAM, ENVI and TIFF as well as live camera data. In this way it is easy to move from a proof of concept phase to a final solution, as well as being able to debug workflows using saved data.
The HV SDK is used as the backend for the HSI related functionality of the HV Explorer. This makes it easy to take a workflow from the HV Explorer and implement it as a standalone program using the HV SDK library.
The HV SDK library provides a generic interface for working with HSI files and live camera data. Using lazy operations and streaming, it optimizes memory and cpu usage for defined operations.
The HSI Tools library is still under development.
The alpha version has been released in March 2025. Live data capture support is expected by the end of 2025.
Python >= 3.10
RAM: 8Gb (minimum recommended)
Installation
- Python package:
pip install qtec-hv-sdk --index-url https://gitlab.com/api/v4/projects/67863505/packages/pypi/simple
Tutorial
Reading and writing datacubes
import hsi
img = hsi.open("path/to/file.hdr") # Expects ENVI file due to the extension
img.write("path/to/output.pam") # Writes PAM format
Changing the interleave type
See exporting datacubes under the HV Explorer tutorial for details on the relevance of using the correct interleave when writing datacubes.
import hsi
a = hsi.open("path/to/file.hdr").to_numpy_with_interleave(hsi.bil)
Reflectance calibration
import hsi
from hsi.preprocessing import make_reference, reflectance_calibration
img = hsi.open("path/to/file.hdr")
dark = hsi.open("path/to/dark_file.hdr")
white_ref = make_reference(img[:100, :, :])
dark_ref = make_reference(dark)
reflectance = reflectance_calibration(img, white_ref, dark_ref)
Examples
See Recipes from the official docs for more examples, including PCA.
Support
Report bugs by writing an email to: hv-sdk-support