X-Git-Url: http://git.tomasm.cz/imago.git/blobdiff_plain/2fbf55c60d081e31a445334ea65703136a12c8d8..9e65c8f01fda8f2ad1895c39b80dd081bd87a1b5:/src/manual.py?ds=inline diff --git a/src/manual.py b/src/manual.py index 8e246d4..fb7f832 100644 --- a/src/manual.py +++ b/src/manual.py @@ -1,7 +1,6 @@ """Manual grid selection module""" -import pygame -import ImageDraw +from PIL import ImageDraw from math import sqrt, acos, copysign from geometry import l2ad, line, intersection @@ -24,6 +23,7 @@ class Screen: def find_lines(im_orig): # TODO rename, refactor, comment + import pygame im = im_orig.copy() @@ -76,6 +76,8 @@ def find_lines(im_orig): def lines(corners): # TODO Error on triangle + corners.sort() # TODO does this help? + # TODO refactor this vvv cor_d = [(corners[0], (c[0] - corners[0][0], c[1] - corners[0][1]), c) for c in corners[1:]] cor_d = [(float(a[0] * b[0] + a[1] * b[1]) / (sqrt(a[0] ** 2 + a[1] ** 2) *