Improve thermal camera library with community fixes#20
Closed
tdamsma wants to merge 29 commits into
Closed
Conversation
Added all changes to main
…operly search for interpreter
error was ``` cv2.error: OpenCV(4.10.0) 👎 error: (-5:Bad argument) in function 'inRange' > Overload resolution failed: > - upperb is not a numpy array, neither a scalar > - Expected Ptr<cv::UMat> for argument 'upperb' ```
…ix ruff findings Introduces an "AppState" as an intermediate solution for global variables. This makes access to global stuff more visible, but should vanish step by step (by more explicit dependency injection and data modelling)
Make project capable of running inside a virtual environment and format sources
…metimes returns wrong values during startup
irpythermal.py changes: - calibrate_raw() now detects both cold AND hot stuck pixels using symmetric 5% threshold (previously only detected cold pixels) Source: diminDDL/IR-Py-Thermal PR stawel#4 diminDDL#4 - Add save_calibration() and load_calibration() methods to persist reference frame and dead pixel mask as .npy files across restarts Source: MCMH2000/OpenHD_HT301_Driver noise_pattern_calibration.npy approach https://github.com/MCMH2000/OpenHD_HT301_Driver - Fix resource leak in find_device(): release cameras that don't match supported resolutions instead of leaving them open - Replace bare except with except Exception
Cast x, y, tx, ty coordinates to int() before passing to cv2.line() and cv2.putText(). OpenCV requires integer coordinates and fails with float values from numpy operations. Source: uncommitted fix found on remote machine /home/daniel/git/t2s/
Replace skimage.exposure.equalize_hist + rescale_intensity with cv2.normalize + cv2.equalizeHist. Same visual result, eliminates the scikit-image dependency (and its transitive deps) making deployment on headless Linux machines simpler.
Convert build system from poetry-core to uv/PEP 621 project format. Add missing runtime dependencies (av, opencv-python, pyusb, imageio).
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.
Summary
Incorporates improvements from the ht301_hacklib community ecosystem into the CEAD fork.
Hot pixel detection + persistent calibration (
irpythermal.py)calibrate_raw()now detects both cold AND hot stuck pixels using a symmetric 5% threshold. Previously only cold/dead pixels were detected, leaving hot/stuck pixels uncorrected.save_calibration(path)/load_calibration(path)methods to persist reference frame and dead pixel mask as.npyfiles, surviving restarts without re-running shutter calibration.noise_pattern_calibration.npyapproachfind_device()now releases cameras that don't match supported resolutionsexcept:withexcept Exception:OpenCV int cast fix (
utils.py)int()indrawTemperature()— OpenCV rejects float coordinates from numpy/home/daniel/git/t2s/)Remove skimage dependency (
opencv.py)skimage.exposure.equalize_hist+rescale_intensitywithcv2.normalize+cv2.equalizeHistBuild system (
pyproject.toml)References
Test plan
ssh thijsd@172.16.88.136)opencv.py— verify live view with temperature overlay