From 7f66638003fb3cfb4439c33e9d68c68c031ea62b Mon Sep 17 00:00:00 2001 From: iou1name Date: Thu, 22 Mar 2018 11:44:51 -0400 Subject: [PATCH] fix linedraw --- linedraw.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/linedraw.py b/linedraw.py index 9826357..1b3d269 100644 --- a/linedraw.py +++ b/linedraw.py @@ -38,7 +38,7 @@ F_SobelX = { (1,0): -2, (-1,1): 1, (0,1): 0, - (1,1) -1} + (1,1): -1} F_SobelY = { (-1,-1): 1, @@ -76,7 +76,7 @@ def distsum(*args): pair, and returns the sum of all distances. """ dists = [] - for i in range(1, len(args): + for i in range(1, len(args)): a = args[i][0] - args[i-1][0] b = args[i][1] - args[i-1][1] dist = (a**2 + b**2)**0.5 @@ -187,7 +187,7 @@ def connectdots(dots): def getcontours(image, sc=2): print("generating contours...") image = find_edges(image) - image1 = IM.copy() + image1 = image.copy() image2 = image.rotate(-90, expand=True).transpose(Image.FLIP_LEFT_RIGHT) dots1 = getdots(image1) contours1 = connectdots(dots1)