Update app.py
Browse files
app.py
CHANGED
@@ -196,8 +196,11 @@ def remove_bg(fl, s, l, v):
|
|
196 |
m_ = cv2.inRange(frame_, np.array([1,1,1]), np.array([127,127,127]))
|
197 |
frame_[m_>0] = (127,127,127)
|
198 |
|
199 |
-
|
200 |
-
|
|
|
|
|
|
|
201 |
|
202 |
cv2.imwrite(fl, frame_)
|
203 |
return fl
|
|
|
196 |
m_ = cv2.inRange(frame_, np.array([1,1,1]), np.array([127,127,127]))
|
197 |
frame_[m_>0] = (127,127,127)
|
198 |
|
199 |
+
frame_ = 255 - frame_
|
200 |
+
m_ = cv2.inRange(frame_, np.array([255,255,255]), np.array([255,255,255]))
|
201 |
+
frame_[m_>0] = (128,128,128)
|
202 |
+
m_ = cv2.inRange(frame_, np.array([127,127,127]), np.array([127,127,127]))
|
203 |
+
frame_[m_>0] = (255,255,255)
|
204 |
|
205 |
cv2.imwrite(fl, frame_)
|
206 |
return fl
|