freealise commited on
Commit
e026b12
1 Parent(s): c17c917

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -7
app.py CHANGED
@@ -582,13 +582,7 @@ def draw_mask(l, t, th, v, d, evt: gr.EventData):
582
 
583
  #bd = cv2.convertScaleAbs(cv2.Laplacian(bg, cv2.CV_64F, 5))
584
 
585
- n = int((bg.shape[0]*bg.shape[1]) / (256*256))
586
- _bg = cv2.medianBlur(bg, 255)
587
-
588
- for i in range(0, n):
589
- _bg = cv2.medianBlur(_bg, 255)
590
-
591
- bg = cv2.convertScaleAbs(bg.astype(np.int16)-_bg.astype(np.int16)).astype(np.uint8)
592
 
593
  #indices = np.arange(0,256) # List of all colors
594
  #divider = np.linspace(0,255,l+1)[1] # we get a divider
 
582
 
583
  #bd = cv2.convertScaleAbs(cv2.Laplacian(bg, cv2.CV_64F, 5))
584
 
585
+ bg = ((bg - 127) * 2).astype(np.uint8)
 
 
 
 
 
 
586
 
587
  #indices = np.arange(0,256) # List of all colors
588
  #divider = np.linspace(0,255,l+1)[1] # we get a divider