Skip to main content

vispek-hc

SDK and command line for the Vispek HC1500 multispectral camera: one USB camera plus 17 switchable LED bands from 255 nm to 1050 nm. A capture is 17 frames taken one after another, one LED at a time.

中文说明

Status

Pre-release, under private development. Checked on one real HC1500 so far: serial protocol, frames, parameter lock, black level, timing, a scan of LEDs 5-17 and a white reference on white paper, and a scan of all 17 channels including the UV LEDs (see docs/acceptance/). A real reflectance standard has not been tried yet. Everything below runs today on the simulated device that ships with the package (--simulate). Camera parameters can be locked on macOS (verified on the device) and on Linux (built, not verified), not yet on Windows; see docs/platforms.md.

Install

Python 3.11 or newer, and ffmpeg on the PATH to read the camera.

From a checkout (the only way until the first release):

git clone https://github.com/vispek/vispek-hc-camera
cd vispek-hc-camera
uv sync                              # or: python -m venv .venv && .venv/bin/pip install -e .
uv run vispek-hc check --simulate    # the whole stack on the simulated device

Once released, install the command into its own environment with uv tool install vispek-hc or pipx install vispek-hc. A plain pip install into the system Python is refused on current Linux and macOS (PEP 668); use one of the two, or a virtual environment.

A first picture, without hardware

uv run vispek-hc demo -o demo

That scans an invented scene on the simulated device, makes a white reference, computes relative reflectance, writes rgb.png, cir.png, ndvi.png and spectra.csv into demo/, and checks the result against the scene it simulated (PASS). The same, step by step:

uv run vispek-hc record -o sample --simulate              # dark frame + LEDs 5-17
uv run vispek-hc reference white -o white --simulate      # the white board, same settings
uv run vispek-hc calibrate --white white -o calibration
uv run vispek-hc reflectance sample --calib calibration -o cube.npz
uv run vispek-hc view sample --calib calibration --mode ndvi -o ndvi.png

No real sample pictures are distributed with the software.

With a device

uv run vispek-hc check               # what is missing, with a hint for each problem
uv run vispek-hc record -o first     # about 10 s; macOS asks for camera access the first time
uv run vispek-hc view first -o first.png

When nothing is missing, check also lights LED 6 (520 nm, visible) for 0.3 s to confirm that the serial port and the camera belong to the same device; devices --pair runs that probe on its own. The camera is found by itself on all three systems; --camera names another. Add --json to any command for one machine-readable object on stdout (docs/cli.md).

Shortest path
macOS brew install ffmpeg, then vispek-hc setup (compiles the camera-control helper; needs xcode-select --install) to lock camera parameters; check; record. Without the helper, record --unlocked
Linux apt install ffmpeg v4l-utils; sudo usermod -aG dialout $USER and log in again; check; record -o first (built, not verified on a device yet)
Windows winget install ffmpeg; install the CH341 serial driver; allow desktop apps to use the camera; check; record -o first --unlocked (parameter locking is not built yet)

Details and what --unlocked costs you: docs/platforms.md.

What the data looks like

A capture is a folder of lossless frames with capture.json. A cube has the raw frames and one number per pixel and band:

import json, numpy as np

z = np.load("cube.npz", allow_pickle=False)  # written by 'vispek-hc reflectance'
values = z["values"].astype(np.float32)  # (H, W, B), axes Y, X, B
valid = np.isfinite(values) & ((z["mask"] & 7) == 0)
rgb = z["rgb"]  # (H, W, B, 3) uint8 raw code values
band_ids, nm = z["band_ids"].tolist(), z["wavelengths_nm"]
meta = json.loads(str(z["metadata_json"]))

Or in Python from the start:

import vispek_hc

capture = vispek_hc.capture("first-scan", simulate=True)  # drop simulate with hardware
cube = capture.cube()  # .values (H, W, bands), .rgb, .mask, .bands

What the numbers are. Pixel values are 8-bit code values after the camera's own image processing. They are not linear radiance, relative reflectance is an index and not a physical reflectance, and band wavelengths are nominal LED centre wavelengths, not a sensor response. Read docs/calibration.md before you compare two scans.

Documentation

License

Apache-2.0, see LICENSE and NOTICE. Trademarks: TRADEMARKS.md.

Metadata

Release files for vispek-hc 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vispek-hc 0.1.0
File Size Uploaded
vispek_hc-0.1.0.tar.gz 360.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vispek-hc 0.1.0
File Interpreter ABI Platform
vispek_hc-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 513.9 kB

Release files / vispek_hc-0.1.0.tar.gz

Download URL vispek_hc-0.1.0.tar.gz
Size 360.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3a16385df8b6baa40128c281d9c0b8e5a5a3df1f9a0915da4a1ef00b43d5d8c9
BLAKE2b-256 checksum
How to use checksums
4b422eca8b9869cf54bd9ec6f54dbf9ad5ed620803d6ad30e806e9627e9d404c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / vispek_hc-0.1.0-py3-none-any.whl

Download URL vispek_hc-0.1.0-py3-none-any.whl
Size 153.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
570afc8b0f5013b408a5e2bf56a92f4f8913355e37d8022513eed92a0c692c40
BLAKE2b-256 checksum
How to use checksums
6e6180ebf7d1256ac857436cb8530bd43331c4a78ab976cd4645d9bb3510fdc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page