Created
May 23, 2017 15:58
-
-
Save kphrx/26379c1beb77cfdefde4ef356afac0c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
import sys | |
import os | |
import itertools | |
import pypuzzle | |
from glob import glob | |
puzzle = pypuzzle.Puzzle() | |
flist = [] | |
cflist = [] | |
dl = [] | |
dirname = sys.argv[1] | |
for e in ['png', 'jpg']: | |
flist.extend(glob('%s/*.%s'%(dirname,e))) | |
for fn in itertools.combinations(flist, 2): | |
cflist.append(list(fn)) | |
for cf in cflist: | |
# Get distance between two image files | |
distance = puzzle.get_distance_from_file(cf[0], cf[1]) | |
if distance < 0.1: | |
dl.append(distance, i) | |
print(dl) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment