freealise commited on
Commit
dd5a8d5
·
verified ·
1 Parent(s): e2cd3e8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -145,7 +145,7 @@ def logscale(linear):
145
  def linscale(linear):
146
  return int(math.log2(linear))
147
 
148
- def remove_bg(fl, i):
149
  global fl_
150
  fr = cv2.imread(fl)
151
 
@@ -173,7 +173,7 @@ def remove_bg(fl, i):
173
 
174
  fr_diff = cv2.dilate(cv2.erode(fr_diff, element), element)
175
 
176
- if i % 2: # odd: is photo without the flash
177
  fr = cv2.imread(fl_).astype(np.uint8)
178
  fr = fr_diff - fr
179
  cv2.imwrite(fl_, fr)
 
145
  def linscale(linear):
146
  return int(math.log2(linear))
147
 
148
+ def remove_bg(fl, count):
149
  global fl_
150
  fr = cv2.imread(fl)
151
 
 
173
 
174
  fr_diff = cv2.dilate(cv2.erode(fr_diff, element), element)
175
 
176
+ if count % 2: # odd: is photo without the flash
177
  fr = cv2.imread(fl_).astype(np.uint8)
178
  fr = fr_diff - fr
179
  cv2.imwrite(fl_, fr)