nishanth-saka commited on
Commit
466bed0
·
verified ·
1 Parent(s): 98c8877

Threshold Updated to 7,7

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -124,8 +124,8 @@ 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
+ kernel = np.ones((7, 7), np.uint8) # slightly larger kernel
128
+ mask_binary = (mask_alpha > 0.07).astype(np.uint8) * 255 # slightly stricter threshold
129
  mask_eroded = cv2.erode(mask_binary, kernel, iterations=3) # balanced erosion
130
 
131