"fingerprints": fingerprints
}
counts = np.zeros(shape=(self.h, self.w), dtype=int)
locations = {}
for fingerprint in fingerprints:
x, y = fingerprint["location"]
counts[x,y] += 1
l = locations.get((x,y)) or []
l.append(fingerprint["key"])
locations[x,y] = l
if show_summary == True:
l = [ [x, y, locs] for (x, y), locs in locations.items() ]
detail = "\n".join("{},{}: {}".format(x, y, loc) for x, y, loc in sorted(l, key = operator.itemgetter(0, 1)))
grid = "\n".join(["".join(["{:3}".format(cnt) for cnt in row]) for row in counts])
return grid + "\n" + detail
return result