Python SDK for Umeko ESP32 thermal imaging camera
Project description
umeko-py-thermal
English | 中文
Python SDK for Umeko ESP32-based thermal imaging cameras.
Read temperature matrices in real-time over serial port — no GUI boilerplate required.
Supported sensors (auto-detected):
| Sensor | Resolution | Data format |
|---|---|---|
| Heimann | 32×32 | uint16 raw → °C |
| Melexis MLX90640 | 32×24 | float °C |
| Melexis MLX90641 | 16×12 | float °C |
Install
pip install umeko-py-thermal
Requires Python ≥ 3.8, pyserial, numpy, and Pillow.
Quick start
from umeko_thermal import ThermalCamera
# Auto-detect serial port
cam = ThermalCamera(auto_detect=True)
cam.connect()
# Stream 100 frames
for frame in cam.stream(max_frames=100):
print(f"max={frame.max():.1f}°C min={frame.min():.1f}°C")
cam.disconnect()
Or use the context manager:
from umeko_thermal import ThermalCamera
with ThermalCamera(port="COM3") as cam:
for frame in cam.stream(max_frames=200):
mat = frame.to_numpy() # shape: (height, width)
img = frame.to_image(scale=10, colormap="stream")
img.save("thermal.png")
Live preview window
with ThermalCamera(port="COM3") as cam:
cam.show(scale=15, colormap="inferno")
Opens a small blocking window that renders the live stream.
Everything runs on the main thread — no background workers. Closing the window stops the stream, drains the serial buffer, and returns control to your script.
Device filesystem
The camera can store .bin snapshots on its internal flash:
files = cam.list_files() # [FileInfo(name="IMG_001.bin", size=2048, type="32x32")]
frame = cam.read_file("IMG_001.bin")
frame.to_image().save("snapshot.png")
cam.delete_file("IMG_001.bin")
cam.clear_all_files()
API at a glance
| Method | Description |
|---|---|
cam.connect() |
Open serial port |
cam.disconnect() |
Close serial port |
cam.stream(...) |
Generator yielding ThermalFrame |
cam.show(...) |
Blocking live preview window |
cam.list_files() |
List stored .bin snapshots |
cam.read_file(name) |
Read a stored snapshot |
cam.delete_file(name) |
Delete a snapshot |
cam.clear_all_files() |
Wipe all snapshots |
cam.list_calibrations() |
Read temperature calibration table |
cam.reboot_to_bootloader() |
Enter bootloader |
cam.reverse_screen_color() |
Flip device screen colors |
ThermalFrame
| Property / Method | Returns |
|---|---|
frame.data |
list[list[float]] temperature matrix (°C) |
frame.width, frame.height |
Resolution |
frame.max() |
Highest temperature |
frame.min() |
Lowest temperature |
frame.mean() |
Average temperature |
frame.get(x, y) |
Temperature at pixel (x, y) |
frame.to_numpy() |
np.ndarray shape (height, width) |
frame.to_image(scale=10, colormap="stream") |
PIL.Image.Image (RGB) |
Documentation
See docs/SDK.md for the full design spec and protocol details.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file umeko_py_thermal-0.1.0.tar.gz.
File metadata
- Download URL: umeko_py_thermal-0.1.0.tar.gz
- Upload date:
- Size: 17.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea427438495c65e6076eb0ef193041c28472458856b91271f4f7ea5f5974f7e1
|
|
| MD5 |
554e36944c728db05867cea3660eadf9
|
|
| BLAKE2b-256 |
59b06af78239303d3bdd03ee8720290cd73bb29a28f0b6917687e10aa5771d0a
|
File details
Details for the file umeko_py_thermal-0.1.0-py3-none-any.whl.
File metadata
- Download URL: umeko_py_thermal-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c17daa6bfc8ef598be3352c19fec34ee8ceb00b84d89db7fb6574660e8b9e06
|
|
| MD5 |
cff957812151da5c4f39879a83affb1a
|
|
| BLAKE2b-256 |
f5c3458af6f1c9c036d24aa44d239d5786fd5c39f6eb32b7946ce435ee61a463
|