freealise commited on
Commit
5474c8a
·
verified ·
1 Parent(s): 22a27bb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -580,7 +580,7 @@ def draw_mask(l, t, v, d, evt: gr.EventData):
580
  dilation = cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (15-(t*2+1), 15-(t*2+1)), (t, t))
581
  mask = cv2.dilate(mask, dilation)
582
 
583
- bd = cv2.convertScaleAbs(cv2.Laplacian(bg, cv2.CV_64F)).astype(np.uint8)
584
 
585
  #indices = np.arange(0,256) # List of all colors
586
  #divider = np.linspace(0,255,l+1)[1] # we get a divider
@@ -599,7 +599,7 @@ def draw_mask(l, t, v, d, evt: gr.EventData):
599
  res = center[label.flatten()]
600
  bg = res.reshape((bg.shape))
601
 
602
- bg[bd>12] = 0
603
  bg[mask>0] = 0
604
  bg[bg==255] = 0
605
 
 
580
  dilation = cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (15-(t*2+1), 15-(t*2+1)), (t, t))
581
  mask = cv2.dilate(mask, dilation)
582
 
583
+ bd = cv2.convertScaleAbs(cv2.Laplacian(bg, cv2.CV_64F, ksize=5)).astype(np.uint8)
584
 
585
  #indices = np.arange(0,256) # List of all colors
586
  #divider = np.linspace(0,255,l+1)[1] # we get a divider
 
599
  res = center[label.flatten()]
600
  bg = res.reshape((bg.shape))
601
 
602
+ bg[bd>8] = 0
603
  bg[mask>0] = 0
604
  bg[bg==255] = 0
605