A Python library for interacting with the Topdon TC001 thermal camera.
Project description
pythermalcamera - Topdon TC001 Thermal Camera Library
A Python library for interacting with the Topdon TC001 thermal camera. This library simplifies device discovery, provides a live interactive preview with temperature analysis, and supports capturing full-resolution thermal images with associated JSON metadata.
Features
- Auto-Detection: Automatically finds the correct video device ID for the TC001 by scanning
/dev/video*. - Live Preview: Interactive window showing the thermal heatmap with a center crosshair, HUD, and real-time statistics (Min/Max/Avg).
- Area of Interest (ROI): Interactively select a region in the preview to focus temperature analysis (statistics will only reflect the chosen box).
- High-Quality Captures: Save colorized heatmaps as PNG and full temperature metadata as JSON.
- Marker Overlays: Toggleable hotspot and coldspot markers on both the preview and captured images.
- Background Threading: Optionally run the preview in a non-blocking background thread while performing other tasks in the main script.
- Extensive Metadata: Captures include timestamps, raw temperature stats, ROI coordinates, and all rendering settings (colormap, alpha, blur, etc.).
Prerequisites
- Hardware: Topdon TC001 Thermal Camera.
- Operating System: Linux (developed and tested on Linux with V4L2).
- Dependencies:
opencv-pythonnumpy
Installation
Install the library directly from PyPI:
pip install pythermalcamera
Usage
Quick Start (CLI Demo)
Once installed, you can run the built-in demo to see the library in action. This will auto-detect your TC001 and start an interactive preview:
# Start interactive preview
pythermalcamera
# Alternatively, run as a module:
python3 -m pythermalcamera
# Use --preview to run in background and take a manual capture after 5s
pythermalcamera --preview
# Enable markers on the manual capture
pythermalcamera --markers
Basic Library API
from pythermalcamera import ThermalCamera
import cv2
# Initialize with auto-detection and non-blocking preview
with ThermalCamera(include_preview=True) as cam:
# Do something else while the preview runs...
import time
time.sleep(5)
# Take a manual snapshot with specific settings
result = cam.capture(
filename_prefix="Snapshot",
colormap=cv2.COLORMAP_MAGMA,
include_markers=True
)
if result:
print(f"Captured {result['image']}")
print(f"Max Temp: {result['metadata']['max_temp']}°C")
Interactive Controls (Preview Window)
When the preview window is active, use the following keyboard shortcuts:
| Key | Action |
|---|---|
| q | Quit preview |
| p | Take snapshot (saves PNG + JSON) |
| r | Reset/Clear ROI (Area of Interest) |
| m | Cycle through available colormaps |
| h | Toggle HUD (On-screen statistics) |
| k | Toggle markers (hotspot/coldspot) for snapshots |
| a/z | Increase / Decrease Blur |
| s/x | Increase / Decrease Marker Threshold |
| d/c | Increase / Decrease Display Scale |
| f/v | Increase / Decrease Contrast (Alpha) |
Mouse Controls:
- Left-Click & Drag: Select an Region of Interest (ROI) box on the preview.
Metadata Format
Snapshots generate a .json file containing:
timestamp: Unix timestamp of the capture.center_temp,max_temp,min_temp,avg_temp: Temperature readings in Celsius.max_pos,min_pos: Pixel coordinates of the hotspot and coldspot.roi: Coordinates of the active ROI at the time of capture.settings: All rendering parameters used to generate the PNG (colormap, scale, blur, etc.).
Credits and Attribution
This library is inspired by and based on the work of:
- Les Wright's PyThermalCamera: https://github.com/leswright1977/PyThermalCamera
- Researcher LeoDJ: For their significant contributions and enhancements to the thermal camera research. Specifically, huge kudos to LeoDJ for reverse engineering the thermal image format to extract raw temperature data.
License
This project is licensed under the MIT License - see the LICENSE file for details (if provided).
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
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 pythermalcamera-0.1.2.tar.gz.
File metadata
- Download URL: pythermalcamera-0.1.2.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b75394b784b1e04f0eb476f5ad07cc65bb74e990c8d262c4eedd0092f1ee7ee0
|
|
| MD5 |
0b91fada1779feed339fd062e26e1997
|
|
| BLAKE2b-256 |
936b3d82cb460cc1abeb96e8726359f3c65207bf8d7c0d1f6be40ecda5023d41
|
Provenance
The following attestation bundles were made for pythermalcamera-0.1.2.tar.gz:
Publisher:
publish.yml on matt-wood-ct/PyThermalCamera
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pythermalcamera-0.1.2.tar.gz -
Subject digest:
b75394b784b1e04f0eb476f5ad07cc65bb74e990c8d262c4eedd0092f1ee7ee0 - Sigstore transparency entry: 1201667439
- Sigstore integration time:
-
Permalink:
matt-wood-ct/PyThermalCamera@bc4951df636a208fd2d727dc883bd258b08e5f5e -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/matt-wood-ct
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bc4951df636a208fd2d727dc883bd258b08e5f5e -
Trigger Event:
release
-
Statement type:
File details
Details for the file pythermalcamera-0.1.2-py3-none-any.whl.
File metadata
- Download URL: pythermalcamera-0.1.2-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d13795e1e670268072e6edf147b925eb5295bdb2699cc1e8e01e84ab4618cfc0
|
|
| MD5 |
b77cecc9a4ae50121ef944437bef596e
|
|
| BLAKE2b-256 |
ca0effd2aee218a53f9129da63a8dd5a876e7306fb6ea7e3aa31bf1617135051
|
Provenance
The following attestation bundles were made for pythermalcamera-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on matt-wood-ct/PyThermalCamera
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pythermalcamera-0.1.2-py3-none-any.whl -
Subject digest:
d13795e1e670268072e6edf147b925eb5295bdb2699cc1e8e01e84ab4618cfc0 - Sigstore transparency entry: 1201667487
- Sigstore integration time:
-
Permalink:
matt-wood-ct/PyThermalCamera@bc4951df636a208fd2d727dc883bd258b08e5f5e -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/matt-wood-ct
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bc4951df636a208fd2d727dc883bd258b08e5f5e -
Trigger Event:
release
-
Statement type: