def get_dist(matches):
    """Gets distance to the closest match of every point"""
    output = []
    for x in matches:
        dic = []
        for y in x:
            min_dist = 255
            for z in x:
                if y != z and max(abs(y[0] - z[0]), abs(y[1] - z[1])
                    ) < min_dist:
                    min_dist = max(abs(y[0] - z[0]), abs(y[1] - z[1]))
            dic.append(min_dist)
        output.append(dic)
    return output
