-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunner.py
43 lines (34 loc) · 919 Bytes
/
runner.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env python
import cv2
import camera
import worker
import time
import coordinates
import network
#to be removed after deployment
class PictureStorage:
picture = None
def __init__(self):
return
#end
print("Launched!")
camera = camera.Camera()
storage = PictureStorage()
network = network.Network()
coordinates = coordinates.Coordinates()
def click_get_hsv(event, x, y, flags, param):
if event == cv2.EVENT_LBUTTONDOWN:
hsv = worker.converttohsv(storage.picture)
print("("+str(x)+","+str(y)+"): "+str(hsv[y][x]))
def run():
picture = camera.tomat()
storage.picture = picture
cv2.imshow("Original", picture)
cv2.setMouseCallback("Original", click_get_hsv)
coordinates = worker.process2(picture)
if (coordinates.found()):
network.send(coordinates)
while 1==1:
run()
time.sleep(0.02)
cv2.destroyAllWindows()