From b4c14fe9504fa00b3d70f78e516eaac7fdc05323 Mon Sep 17 00:00:00 2001 From: appleb_m Date: Thu, 16 Apr 2026 11:50:41 +0200 Subject: [PATCH] GUI: fixed camera image bug --- src/aare/gui/threads/camera_thread.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/aare/gui/threads/camera_thread.py b/src/aare/gui/threads/camera_thread.py index aba490d3..456d0642 100644 --- a/src/aare/gui/threads/camera_thread.py +++ b/src/aare/gui/threads/camera_thread.py @@ -82,12 +82,11 @@ class SampleCameraThread(QThread): except: continue - if header and header.get("type") == "uint8": + if header: h, w = header["shape"][:2] raw = np.frombuffer(data, np.uint8).reshape((h, w)) rgb = cv2.cvtColor(raw, cv2.COLOR_BAYER_GB2RGB) # choose correct Bayer order - #rgb = cv2.flip(rgb, 0) if self.__measure_focus: gray = cv2.cvtColor(rgb, cv2.COLOR_RGB2GRAY) @@ -103,7 +102,7 @@ class SampleCameraThread(QThread): qimage = QImage(rgb.data, rgb.shape[1], rgb.shape[0], QImage.Format.Format_RGB888).copy() self.camera_image.emit(QPixmap.fromImage(qimage)) else: - print("Sample camera image has wrong dimensions") + print("NO HEADER in zmq stream") except zmq.Again: # Timeout occurred now = time.perf_counter() elapsed = now - self.__fps_window_start