line2 = [line_to_points(line2, 0), line_to_points(line2, width - 1)]
return [sorted(points), sorted(points2)], line, line2
-
-
def find_lines(image, show_image, logger):
"""Find lines in the *image*."""
- # TODO refactor into smaller functions
logger("preprocessing")
show_image(image, "original image")
draw.line(line_from_angl_dist(line, image.size), fill=(120, 255, 120))
show_image(image_g, "lines")
- return lines, l1, l2, bounds, hough # TODO
-
-def combine(image1, image2):
- """Return a list of points that are present in both images."""
- im_l1 = image1.load()
- im_l2 = image2.load()
-
- on_both = []
- for x in xrange(image1.size[0]):
- for y in xrange(image1.size[1]):
- if im_l1[x, y] and im_l2[x, y]:
- on_both.append((x, y))
- return on_both
+ return lines, l1, l2, bounds, hough # TODO
def line_from_angl_dist((angle, distance), size):
"""Take *angle* and *distance* (from the center of the image) of a line and