nishanth-saka commited on
Commit
4a7957f
·
verified ·
1 Parent(s): 69e2a87

CONSTANT K = 7

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -124,8 +124,9 @@ def _process_saree_core(base_image: Image.Image, pattern_image: Image.Image):
124
  mask_alpha = np.array(mask_img)[:, :, 3].astype(np.float32) / 255.0
125
 
126
  # 1. Slightly stronger shrink (balanced)
127
- kernel = np.ones((5, 5), np.uint8) # slightly larger kernel
128
- mask_binary = (mask_alpha > 0.05).astype(np.uint8) * 255 # slightly stricter threshold
 
129
  mask_eroded = cv2.erode(mask_binary, kernel, iterations=3) # balanced erosion
130
 
131
 
 
124
  mask_alpha = np.array(mask_img)[:, :, 3].astype(np.float32) / 255.0
125
 
126
  # 1. Slightly stronger shrink (balanced)
127
+ k =7
128
+ kernel = np.ones((k, k), np.uint8) # slightly larger kernel
129
+ mask_binary = (mask_alpha > k/100).astype(np.uint8) * 255 # slightly stricter threshold
130
  mask_eroded = cv2.erode(mask_binary, kernel, iterations=3) # balanced erosion
131
 
132