-"""Go image recognition lines-finding module"""
+"""Lines finding module."""
from functools import partial
import sys
from hough import Hough
def find_lines(image, show_all, do_something, verbose):
+ """Find lines in the *image*."""
+ # TODO refactor into smaller functions
if verbose:
print >> sys.stderr, "preprocessing"
return lines, lines_m[0][0], lines_m[1][0], bounds, im_hough
def combine(image1, image2):
+ """Return a list of points that are present in both images."""
im_l1 = image1.load()
im_l2 = image2.load()
return on_both
def line_from_angl_dist((angle, distance), size):
+ """Take *angle* and *distance* (from the center of the image) of a line and
+ size of the image. Return the line represented by two points."""
if pi / 4 < angle < 3 * pi / 4:
y1 = - size[1] / 2
x1 = int(round((y1 * cos(angle) + distance) / sin(angle))) + size[0] / 2