Skip to content

Commit

Permalink
Merge pull request #13 from AI-SIP/develop
Browse files Browse the repository at this point in the history
Fix: 색상인식구간과 인페인팅반지름 변경
  • Loading branch information
semnisem authored Aug 20, 2024
2 parents 0c66dd4 + 5de9d26 commit d0fe5da
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/ColorRemover.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ def combine_alpha(self, image_rgb):
def masking(self, image_rgb): # important
image_mask = image_rgb.copy()
image_hsv = cv2.cvtColor(image_mask, cv2.COLOR_BGR2HSV)
lower_bound = np.array([105, 10, 30]) # blue's hue is 105~135
upper_bound = np.array([135, 255, 255])
lower_bound = np.array([95, 10, 30]) # blue's hue is 105~120
upper_bound = np.array([120, 255, 255])
self.masks = cv2.inRange(image_hsv, lower_bound, upper_bound)

if self.size > 1024 * 1536:
Expand All @@ -42,7 +42,7 @@ def masking(self, image_rgb): # important
def inpainting(self, image_rgb):
if self.masks is not None and isinstance(self.masks, np.ndarray):
inpainted_image = image_rgb.copy()
inpainted_image = cv2.inpaint(inpainted_image, self.masks, 5, cv2.INPAINT_TELEA)
inpainted_image = cv2.inpaint(inpainted_image, self.masks, 4, cv2.INPAINT_TELEA)
# blurred_region = cv2.GaussianBlur(inpainted_image, (10, 10), 1.5)
# inpainted_image[self.masks != 0] = blurred_region[self.masks != 0]
return inpainted_image
Expand Down

0 comments on commit d0fe5da

Please sign in to comment.