From f4eeadf19707cc7d7e292a5c3c619e5cc78ec196 Mon Sep 17 00:00:00 2001 From: HeadTriXz Date: Mon, 3 Jun 2024 22:31:18 +0200 Subject: [PATCH] fix: revert white borders for top-down images --- src/calibration/data.py | 6 ++---- src/simulation/main.py | 4 +--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/calibration/data.py b/src/calibration/data.py index c169770..433891b 100644 --- a/src/calibration/data.py +++ b/src/calibration/data.py @@ -51,7 +51,7 @@ def transform(self, images: list[np.ndarray]) -> np.ndarray: if self.topdown_matrix is None: raise ValueError("Calibrator has not been calibrated yet.") - stitched = np.full(self.stitched_shape[::-1], 255, dtype=np.uint8) + stitched = np.zeros(self.stitched_shape[::-1], dtype=np.uint8) futures = [] for i, image in enumerate(images): @@ -70,9 +70,7 @@ def transform(self, images: list[np.ndarray]) -> np.ndarray: stitched, self.topdown_matrix, self.output_shape, - flags=cv2.INTER_NEAREST, - borderMode=cv2.BORDER_CONSTANT, - borderValue=(255, 255, 255) + flags=cv2.INTER_NEAREST ) def _stitch_image(self, stitched: np.ndarray, image: np.ndarray, idx: int) -> np.ndarray: diff --git a/src/simulation/main.py b/src/simulation/main.py index c076882..5d6447e 100644 --- a/src/simulation/main.py +++ b/src/simulation/main.py @@ -65,9 +65,7 @@ def get_sim_image_generator() -> Generator[np.ndarray, None, None]: front_view, calibration.topdown_matrix, calibration.output_shape, - flags=cv2.INTER_NEAREST, - borderMode=cv2.BORDER_CONSTANT, - borderValue=(255, 255, 255) + flags=cv2.INTER_NEAREST ) if config["telemetry"]["enabled"] and telemetry.any_listening():