if verbose:
print >> sys.stderr, "edge detection"
im_edges = filters.edge_detection(im_l)
if verbose:
print >> sys.stderr, "edge detection"
im_edges = filters.edge_detection(im_l)
-def find_lines(image, show_all, do_something, verbose):
+def find_lines(image, show_image, verbose):
"""Find lines in the *image*."""
# TODO refactor into smaller functions
if verbose:
print >> sys.stderr, "preprocessing"
"""Find lines in the *image*."""
# TODO refactor into smaller functions
if verbose:
print >> sys.stderr, "preprocessing"
- im_h = prepare(image, show_all, do_something, verbose)
+ im_h = prepare(image, show_image, verbose)
hough = Hough.default(im_h)
if verbose:
print >> sys.stderr, "hough transform"
hough = Hough.default(im_h)
if verbose:
print >> sys.stderr, "hough transform"
- im_h2 = transform(im_h, hough, show_all, do_something)
+ im_h2 = transform(im_h, hough, show_image)
# mechanism (which is not very robust yet)
hough2 = Hough.default(im_h2)
im_hough2 = hough2.transform(im_h2)
# mechanism (which is not very robust yet)
hough2 = Hough.default(im_h2)
im_hough2 = hough2.transform(im_h2)
image_g = image.copy()
draw = ImageDraw.Draw(image_g)
for line in [l for s in lines for l in s]:
draw.line(line_from_angl_dist(line, image.size), fill=(120, 255, 120))
image_g = image.copy()
draw = ImageDraw.Draw(image_g)
for line in [l for s in lines for l in s]:
draw.line(line_from_angl_dist(line, image.size), fill=(120, 255, 120))
return lines, lines_m[0][0], lines_m[1][0], bounds, hough
return lines, lines_m[0][0], lines_m[1][0], bounds, hough