# TODO refactor show_all, do_something
# TODO refactor this into smaller functions
lines = [dst_sort(l) for l in lines]
+ an0 = (sum([l[0] for l in lines[0]]) / len(lines[0]) - pi / 2)
+ an1 = (sum([l[0] for l in lines[1]]) / len(lines[1]) - pi / 2)
+ if an0 > an1:
+ lines = [lines[1], lines[0]]
+
intersections = intersections_from_angl_dist(lines, image.size)
if show_all:
y = (c1 * a2 - a1 * c2) / delim
return x, y
+# TODO remove the parameter get_all
def intersections_from_angl_dist(lines, size, get_all=True):
"""Take grid-lines and size of the image. Return intersections."""
- lines1 = map(lambda l: to_general(l, size), lines[1])
lines0 = map(lambda l: to_general(l, size), lines[0])
+ lines1 = map(lambda l: to_general(l, size), lines[1])
intersections = []
for l1 in lines1:
line = []