Universal viewer with Topdon TC002C Duo radiometric support#29
Open
AronNovak wants to merge 5 commits into
Open
Universal viewer with Topdon TC002C Duo radiometric support#29AronNovak wants to merge 5 commits into
AronNovak wants to merge 5 commits into
Conversation
New src/thermalcam.py auto-detects InfiRay/Topdon USB thermal cameras and decodes real temperatures: TC001 (256x384, /64) and TC002C Duo (512x484, /16, which also yields a clean 512x384 image), with a labelled relative fallback otherwise. Adds docs/TC002C-DUO.md (frame layout + reverse-engineered vendor protocol), requirements.txt, and an experimental command module. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- src/thermal_bridge.py: serve the parsed/colormapped thermal image as an MJPEG-over-HTTP stream so any app (OpenCV, ffmpeg, browser) can consume it like a webcam, no dependency. - thermalcam: --rotate / --flip (live 'o' key) and a clean colormap_frame() method (overlay-free) used by the bridge. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
These cameras occasionally emit a horizontally-tiled/desynced frame. The frame validity check only looked at the temperature band, so such frames slipped through as garbage. Add an image-band alignment guard (mean-abs-difference vs a shifted copy; gradients and flat scenes are exempt) so the viewer and the MJPEG bridge never emit them. The bridge also reopens the camera after a run of unusable frames to recover from a stuck desync. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Reproduce the InfiRay temperature-correction math on Linux from the Android libadvirtemp tables, so the camera can report true object °C off-device: - tables.py extracts the embedded float64 ems/distance/target-temp LUTs into adv_tables.npz via a self-contained ELF reader. - corrector.py: graybody emissivity / reflected-temp inversion (temp_correct), round-trip validated <1e-6 °C against the decoded inverse; temperature-dependent effective-emissivity LUT; Magnus vapour pressure. - profile.py: per-unit JSON profile (keyed by USB serial) with scene defaults and NUC/kt/bt slots filled at provisioning. Vendor-protocol read of per-unit NUC/kt/bt is still to come. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Open the camera's 8x12578 mode (header + 256x192 temperature plane + image) and decode temperature as raw/64 - K, validated against the official app to 0.1 °C (the captured frame's app min/max/avg 22.6/34.7/ 27.8 reproduce exactly). radiometry/duo.py + thermalcam auto-detect/wiring; white_hot grayscale palette default for cleaner detector input. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
src/thermalcam.py, a camera-agnostic rewrite oftc001v4.2.pythat also works with newer InfiRay/Topdon models (tested on a TC002C Duo).--device).256x384(/64) and TC002C Duo512x484(/16, which also gives a clean 512×384 image). Relative fallback otherwise, clearly labelled.CAP_PROP_BUFFERSIZE=1(OpenCV returns desynced buffers),VIDIOC_ENUM_FRAMESIZES(opening an unsupported mode desyncs the stream), skip desynced frames, telemetry trim, fixed-pattern-noise removal.--selftest.docs/TC002C-DUO.mddocuments the frame layout and the reverse-engineered vendor command protocol;src/thermal_protocol.pyis an experimental (dry-run) module for optional NUC/calibration.The original
tc001v4.2.pyis left untouched.