Skip to content

Commit

Permalink
Fix background averaging. Close #11
Browse files Browse the repository at this point in the history
  • Loading branch information
colinlaney authored Jun 14, 2021
1 parent 31e178e commit 9f9fa58
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion track.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ def trace(filename):
ret, frame = cap.read()
if frame is None:
break
background = cv2.addWeighted(frame, 0.5 - i_frame / n_frames, background, 0.5 + i_frame / n_frames, 0)
background = cv2.addWeighted(frame, 0.5 * (1 - i_frame / n_frames),
background, 0.5 * (1 + i_frame / n_frames), 0)
i_frame += 1
cap = cv2.VideoCapture(filename)
ret, frame = cap.read()
Expand Down

0 comments on commit 9f9fa58

Please sign in to comment.