X-Git-Url: http://git.tomasm.cz/imago.git/blobdiff_plain/3e32918236becad76325560355eadf3ac0ea2a0c..b91b0e43b25e64b3516b9156ca42e7309665628b:/imago.py diff --git a/imago.py b/imago.py index c053a7f..fcba0a4 100755 --- a/imago.py +++ b/imago.py @@ -17,6 +17,7 @@ import im_debug import linef import manual import intrsc +import gridf def main(): """Main function of the program.""" @@ -52,7 +53,7 @@ def main(): image.size[1])), Image.ANTIALIAS) do_something = im_debug.show if args.saving: - do_something = imsave("saved/" + args.file[0][:-4] + "_" + + do_something = imsave("saved/" + args.files[0][:-4] + "_" + str(image.size[0]) + "/").save if args.manual_mode: @@ -62,7 +63,15 @@ def main(): #TODO ask user to try again return 1 else: - lines = linef.find_lines(image, show_all, do_something, verbose) + lines, l1, l2, bounds, hough, im_h = linef.find_lines(image, show_all, do_something, verbose) + grid, lines = gridf.find(lines, image.size, l1, l2, bounds, hough, + do_something, im_h) + if show_all: + im_g = image.copy() + draw = ImageDraw.Draw(im_g) + for l in grid[0] + grid[1]: + draw.line(l, fill=(64, 255, 64), width=1) + do_something(im_g) board = intrsc.board(image, lines, show_all, do_something)