Update app.py
Browse files
app.py
CHANGED
|
@@ -167,7 +167,8 @@ def remove_bg(fl):
|
|
| 167 |
#remove regions of low saturation and lightness (get scene without shadow)
|
| 168 |
m = cv2.inRange(cv2.cvtColor(frame_c, cv2.COLOR_RGB2HSV), np.array([0,0,0]), np.array([180,32,64]))
|
| 169 |
mask = cv2.inRange(blur_s, 0, 127)
|
| 170 |
-
|
|
|
|
| 171 |
frame = cv2.medianBlur(frame, b)
|
| 172 |
|
| 173 |
|
|
|
|
| 167 |
#remove regions of low saturation and lightness (get scene without shadow)
|
| 168 |
m = cv2.inRange(cv2.cvtColor(frame_c, cv2.COLOR_RGB2HSV), np.array([0,0,0]), np.array([180,32,64]))
|
| 169 |
mask = cv2.inRange(blur_s, 0, 127)
|
| 170 |
+
masks = np.bitwise_and(m, mask)
|
| 171 |
+
frame[masks>0] = (127,127,127)
|
| 172 |
frame = cv2.medianBlur(frame, b)
|
| 173 |
|
| 174 |
|