Update app.py
Browse files
app.py
CHANGED
@@ -196,10 +196,12 @@ 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 |
frame_ = 255 - frame_
|
200 |
m_ = cv2.inRange(frame_, np.array([255,255,255]), np.array([255,255,255]))
|
201 |
-
frame_[m_>0] = (
|
202 |
-
m_ = cv2.inRange(frame_, np.array([
|
203 |
frame_[m_>0] = (255,255,255)
|
204 |
|
205 |
cv2.imwrite(fl, frame_)
|
|
|
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 |
+
#shadow is black, bg is white, fg is gray
|
201 |
frame_ = 255 - frame_
|
202 |
m_ = cv2.inRange(frame_, np.array([255,255,255]), np.array([255,255,255]))
|
203 |
+
frame_[m_>0] = (127,127,127)
|
204 |
+
m_ = cv2.inRange(frame_, np.array([128,128,128]), np.array([128,128,128]))
|
205 |
frame_[m_>0] = (255,255,255)
|
206 |
|
207 |
cv2.imwrite(fl, frame_)
|