Skip to main content

A Python library for interacting with the Topdon TC001 thermal camera.

Project description

pythermalcamera - Topdon TC001 Thermal Camera Library

PyPI version

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-python
    • numpy

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:

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

pythermalcamera-0.1.2.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

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

pythermalcamera-0.1.2-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

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

Hashes for pythermalcamera-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b75394b784b1e04f0eb476f5ad07cc65bb74e990c8d262c4eedd0092f1ee7ee0
MD5 0b91fada1779feed339fd062e26e1997
BLAKE2b-256 936b3d82cb460cc1abeb96e8726359f3c65207bf8d7c0d1f6be40ecda5023d41

See more details on using hashes here.

Provenance

The following attestation bundles were made for pythermalcamera-0.1.2.tar.gz:

Publisher: publish.yml on matt-wood-ct/PyThermalCamera

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pythermalcamera-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for pythermalcamera-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d13795e1e670268072e6edf147b925eb5295bdb2699cc1e8e01e84ab4618cfc0
MD5 b77cecc9a4ae50121ef944437bef596e
BLAKE2b-256 ca0effd2aee218a53f9129da63a8dd5a876e7306fb6ea7e3aa31bf1617135051

See more details on using hashes here.

Provenance

The following attestation bundles were made for pythermalcamera-0.1.2-py3-none-any.whl:

Publisher: publish.yml on matt-wood-ct/PyThermalCamera

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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