stawel / ht301_hacklib

ht-301 thermal camera opencv lib
GNU General Public License v3.0
56 stars 31 forks source link

V2 #13

Closed tdamsma closed 3 months ago

tdamsma commented 1 year ago

Ok, so this might be a bit of an uncalled for update / rewrite. But here is what I did:

I understand if this is somewhat impossible to review. Even more so because I have not been able to test this on anything but my TS2+ camera. I first intended to only copy the parameters from lamnguyenvu98 but then I went a bit overboard

tdamsma commented 1 year ago

If you somehow accept this PR, I think the readme / supported camera list also needs an update before this is merged

dzid26 commented 1 year ago

I have T2L and your version worked. Unlike master that was freezing at self.cap.read().

I just need to limit resolution search to video_dev = self.find_device(256) as I guess I had some 640x480 webcam in the system.

wrtlprnft commented 7 months ago

To make it work with a HT-301, I had to fix a typo (?) in the supported_widths set:

diff --git a/ht301_hacklib.py b/ht301_hacklib.py
index 257979c..7f22af0 100755
--- a/ht301_hacklib.py
+++ b/ht301_hacklib.py
@@ -26,7 +26,7 @@ def read_u8(arr_u16, offset, step):

 class Camera:
     """Class for reading data from the XTherm/HT301/InfiRay thermal cameras"""
-    supported_widths = {240, 256, 392, 640}
+    supported_widths = {240, 256, 384, 640}
     ZEROC = 273.15
     distance_multiplier = 1.0
     offset_temp_shutter = 0.0

At least now it fits the cases in Camera.init_parameters.