fix linedraw
This commit is contained in:
parent
0d0fd3e638
commit
7f66638003
|
@ -38,7 +38,7 @@ F_SobelX = {
|
||||||
(1,0): -2,
|
(1,0): -2,
|
||||||
(-1,1): 1,
|
(-1,1): 1,
|
||||||
(0,1): 0,
|
(0,1): 0,
|
||||||
(1,1) -1}
|
(1,1): -1}
|
||||||
|
|
||||||
F_SobelY = {
|
F_SobelY = {
|
||||||
(-1,-1): 1,
|
(-1,-1): 1,
|
||||||
|
@ -76,7 +76,7 @@ def distsum(*args):
|
||||||
pair, and returns the sum of all distances.
|
pair, and returns the sum of all distances.
|
||||||
"""
|
"""
|
||||||
dists = []
|
dists = []
|
||||||
for i in range(1, len(args):
|
for i in range(1, len(args)):
|
||||||
a = args[i][0] - args[i-1][0]
|
a = args[i][0] - args[i-1][0]
|
||||||
b = args[i][1] - args[i-1][1]
|
b = args[i][1] - args[i-1][1]
|
||||||
dist = (a**2 + b**2)**0.5
|
dist = (a**2 + b**2)**0.5
|
||||||
|
@ -187,7 +187,7 @@ def connectdots(dots):
|
||||||
def getcontours(image, sc=2):
|
def getcontours(image, sc=2):
|
||||||
print("generating contours...")
|
print("generating contours...")
|
||||||
image = find_edges(image)
|
image = find_edges(image)
|
||||||
image1 = IM.copy()
|
image1 = image.copy()
|
||||||
image2 = image.rotate(-90, expand=True).transpose(Image.FLIP_LEFT_RIGHT)
|
image2 = image.rotate(-90, expand=True).transpose(Image.FLIP_LEFT_RIGHT)
|
||||||
dots1 = getdots(image1)
|
dots1 = getdots(image1)
|
||||||
contours1 = connectdots(dots1)
|
contours1 = connectdots(dots1)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user