diff --git a/track.py b/track.py index ed9dc47..b5a7f4e 100644 --- a/track.py +++ b/track.py @@ -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()