def __init__(self, res):
pygame.init()
pygame.display.set_mode(res)
- pygame.display.set_caption("Go image capture")
+ pygame.display.set_caption("Imago manual mode")
self._screen = pygame.display.get_surface()
def display_picture(self, im):
fill=(255, 64, 64))
corners = []
color=(64, 64, 255)
- line_width = 2
+ line_width = 1
lines_r = []
while not done:
(corners[1], corners[2])]
l_hor += [(corners[0], corners[1]),
(corners[2], corners[3])]
- l_vert = sorted(l_vert)
- l_hor = sorted(l_hor)
- for i in [3, 8, 14]:
- for j in [3, 8, 14]:
+ l_vert.sort()
+ l_hor.sort()
+ for i in [3, 9, 15]:
+ for j in [3, 9, 15]:
hoshi(intersection(line(l_vert[i][0], l_vert[i][1]),
line(l_hor[j][0], l_hor[j][1])))
lines_r = [[l2ad(l[0], l[1], im.size) for l in l_vert],
q = float(a[1] - b[1]) / (a[0] - b[0])
angle = atan(q)
+ if angle < 0:
+ angle += pi
+ if angle > pi:
+ angle -= pi
+
distance = (((a[0] - (size[0] / 2)) * sin(angle)) +
((a[1] - (size[1] / 2)) * - cos(angle)))
return (angle, distance)