From d407a22fb6cfd282a915e1239cf6db4d91d3f341 Mon Sep 17 00:00:00 2001 From: zrezke Date: Sun, 29 Sep 2024 18:37:48 +0200 Subject: [PATCH] BGR2RGB on undistorted frames --- rerun_py/depthai_viewer/_backend/packet_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rerun_py/depthai_viewer/_backend/packet_handler.py b/rerun_py/depthai_viewer/_backend/packet_handler.py index 7faf91cd624a..90ff9ddde0ce 100644 --- a/rerun_py/depthai_viewer/_backend/packet_handler.py +++ b/rerun_py/depthai_viewer/_backend/packet_handler.py @@ -200,7 +200,7 @@ def _log_img_frame( # If the image is a cv frame try to undistort and rectify it if intrinsics_matrix is not None and distortion_coefficients is not None: if frame.getType() == dai.RawImgFrame.Type.NV12: - img_frame = frame.getCvFrame() + img_frame = cv2.cvtColor(frame.getCvFrame(), cv2.COLOR_BGR2RGB) map_x, map_y = cv2.initUndistortRectifyMap( intrinsics_matrix, distortion_coefficients, None, intrinsics_matrix, (w, h), cv2.CV_32FC1 )