freealise commited on
Commit
a5fbd82
·
verified ·
1 Parent(s): 8477f00

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -153,10 +153,10 @@ def remove_bg(fl):
153
  #correct hue against light
154
  bg_gray = cv2.cvtColor(cv2.cvtColor(bg, cv2.COLOR_BGR2GRAY), cv2.COLOR_GRAY2BGR)
155
  bg_diff = (bg-bg_gray).astype(np.int16)
156
- frame = (frame.astype(np.int16)-bg_diff).astype(np.uint8)
157
 
158
  #remove regions of low saturation (get scene without shadow)
159
- m = cv2.inRange(cv2.cvtColor(frame, cv2.COLOR_RGB2HSV), np.array([0,0,0]), np.array([180,32,256]))
160
  frame[m>0] = (127,127,127)
161
  frame = cv2.medianBlur(frame, b)
162
 
 
153
  #correct hue against light
154
  bg_gray = cv2.cvtColor(cv2.cvtColor(bg, cv2.COLOR_BGR2GRAY), cv2.COLOR_GRAY2BGR)
155
  bg_diff = (bg-bg_gray).astype(np.int16)
156
+ frame_c = (frame.astype(np.int16)-bg_diff).astype(np.uint8)
157
 
158
  #remove regions of low saturation (get scene without shadow)
159
+ m = cv2.inRange(cv2.cvtColor(frame_c, cv2.COLOR_RGB2HSV), np.array([0,0,0]), np.array([180,32,256]))
160
  frame[m>0] = (127,127,127)
161
  frame = cv2.medianBlur(frame, b)
162