Skip to content
This repository has been archived by the owner on Nov 15, 2024. It is now read-only.

Commit

Permalink
Do not convert colors
Browse files Browse the repository at this point in the history
  • Loading branch information
HansTM committed Jun 19, 2024
1 parent 5825752 commit 22429ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions services/water_segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
return inpainted_image_large, overlay

0 comments on commit 22429ee

Please sign in to comment.