freealise commited on
Commit
f787c64
·
verified ·
1 Parent(s): f3058ae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
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] = (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_)
 
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_)