Skip to content

Commit

Permalink
Use 15% fuzz (instead of 10%) when finding last frame (#786)
Browse files Browse the repository at this point in the history
And also make sure there's no pixel match.
  • Loading branch information
soulgalore authored Feb 21, 2019
1 parent 43bb94a commit 643387d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions vendor/visualmetrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,10 +638,8 @@ def eliminate_duplicate_frames(directory):
break

# Do another pass looking for the last frame but with an allowance for up
# to a 10% difference in individual pixels to deal with noise
# around text. We can also have a diff of 0.05% of pixels, without that
# we pickup small changes at the end of the video
max_pixel_diff = math.ceil(width * height * 0.0005)
# to a 15% difference in individual pixels to deal with noise
# around text.
files = sorted(glob.glob(os.path.join(directory, 'ms_*.png')))
count = len(files)
duplicates = []
Expand All @@ -650,7 +648,7 @@ def eliminate_duplicate_frames(directory):
baseline = files[0]
previous_frame = baseline
for i in xrange(1, count):
if frames_match(baseline, files[i], 10, max_pixel_diff, crop, None):
if frames_match(baseline, files[i], 15, 0, crop, None):
if previous_frame is baseline:
duplicates.append(previous_frame)
else:
Expand Down

0 comments on commit 643387d

Please sign in to comment.