GUI: fixed camera image bug

This commit is contained in:
2026-04-16 11:50:41 +02:00
parent 74c3a9f4ba
commit b4c14fe950
+2 -3
View File
@@ -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