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 available video devices (V4L2 on Linux, MSMF or DSHOW on Windows).
  • 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 with V4L2) or Windows (tested with MSMF/DSHOW).
  • 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.3.tar.gz (13.2 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.3-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file pythermalcamera-0.1.3.tar.gz.

File metadata

  • Download URL: pythermalcamera-0.1.3.tar.gz
  • Upload date:
  • Size: 13.2 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.3.tar.gz
Algorithm Hash digest
SHA256 7958b777683391482f56aac8ff4807017fab7f06f9a99179b99300d61a2cd2f0
MD5 8e6dabb7c10388697e4a07562b8a099a
BLAKE2b-256 6b57f75813a78b9b4d8b92198169171beb456185544b87cf81f9791c995f8fd5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pythermalcamera-0.1.3.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.3-py3-none-any.whl.

File metadata

File hashes

Hashes for pythermalcamera-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e4a33a399de47cfde8c61c20d0f3265430158bc0bdbc5c9fd1400b3a6a37767e
MD5 fc947c86b3148c7377ac7b1e479078a0
BLAKE2b-256 b3cce0eb7c8c86e609d9630a15e301407d41dc1e977261b6068992b3252e7f93

See more details on using hashes here.

Provenance

The following attestation bundles were made for pythermalcamera-0.1.3-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