X-Git-Url: http://git.tomasm.cz/imago.git/blobdiff_plain/1e417ec51105662e1d1d7a7e2350dbe724f76a2d..666ac3553431948203df831afe240beb3fcaec32:/src/linef.py diff --git a/src/linef.py b/src/linef.py index 2b2b86b..8de87a6 100644 --- a/src/linef.py +++ b/src/linef.py @@ -5,7 +5,7 @@ import sys from math import sin, cos, pi try: - import Image, ImageDraw + from PIL import Image, ImageDraw except ImportError, msg: print >> sys.stderr, msg sys.exit(1) @@ -33,10 +33,10 @@ def transform(image, hough, show_image): im_hough = hough.transform(image) show_image(im_hough, "hough transform") - # im_hough.image = filters.peaks(im_hough.image) - # show_image(im_hough.image, "peak extraction") + # im_hough = filters.peaks(im_hough) + # show_image(im_hough, "peak extraction") - im_h2 = filters.high_pass(im_hough, 96) + im_h2 = filters.high_pass(im_hough, 128) show_image(im_h2, "second high pass filters") im_h2 = filters.components(im_h2, 2) @@ -56,6 +56,8 @@ def run_ransac(image): for x in xrange(0, width): if image_l[x, y] > 128: data.append((x, y)) + if y < 30: + data.append((width - x, y + height)) dist = 3 [(line, points), (line2, points2)] = ransac.ransac_multi(2, data, dist, 250)