From 22429ee4c9b8628d6382aef45f1a9ef2b4abe907 Mon Sep 17 00:00:00 2001 From: Hans TM <112265332+HansTM@users.noreply.github.com> Date: Wed, 19 Jun 2024 11:55:20 +0000 Subject: [PATCH] Do not convert colors --- services/water_segmentation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/water_segmentation.py b/services/water_segmentation.py index 674dbe5..969cfdd 100644 --- a/services/water_segmentation.py +++ b/services/water_segmentation.py @@ -213,7 +213,7 @@ def extract(original_image: cv2.typing.MatLike): # Inpaint the extracted water region in the enlarged image or make it full white if coverage < 25% if coverage_percentage < 25: - return None, cv2.cvtColor(overlay, cv2.COLOR_BGR2RGB) + return None, overlay # inpainted_image_large = np.ones_like(water_only_large) * 255 else: inpaint_mask_large = cv2.bitwise_not(enlarged_water_contour_mask) @@ -265,4 +265,4 @@ def extract(original_image: cv2.typing.MatLike): # plt.imshow(cv2.cvtColor(inpainted_image_large, cv2.COLOR_BGR2RGB)), plt.title('Inpainted Extracted Water on Enlarged Region') # plt.show() - return cv2.cvtColor(inpainted_image_large, cv2.COLOR_BGR2RGB), cv2.cvtColor(overlay, cv2.COLOR_BGR2RGB) \ No newline at end of file + return inpainted_image_large, overlay \ No newline at end of file