-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathartt.py
More file actions
59 lines (43 loc) · 1.37 KB
/
artt.py
File metadata and controls
59 lines (43 loc) · 1.37 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
import cv2
from numpy import *
import arena
if __name__ == '__main__':
###############
## SETUP
###############
print "SWiT's Augmented Reality Table Top";
print "**********************************";
cv2.namedWindow("ArenaScanner")
cv2.namedWindow("ArenaControlPanel")
cv2.startWindowThread()
Arena = arena.Arena() # Initialize the arena.
cv2.setMouseCallback("ArenaControlPanel", Arena.ui.onMouse, Arena)
###############
## LOOP
###############
while True:
# Scan the arena for symbols.
Arena.scan()
# Render the output of the arena.
outputimg = Arena.render()
# Display the image or frame of video
if size(outputimg,0) > 0 and size(outputimg,1) > 0:
outputimg = Arena.ui.resize(outputimg)
cv2.imshow("ArenaScanner", outputimg)
# Display the control panel
controlPanelImg = Arena.ui.drawControlPanel(Arena)
cv2.imshow("ArenaControlPanel", controlPanelImg)
for z in Arena.zones:
# Display the projector
cv2.imshow("ZoneProjector"+str(z.id), z.projector.outputimg)
Arena.ui.calcFPS()
#Exit
if Arena.ui.exit:
break
###############
## END LOOP
###############
for z in Arena.zones:
z.close()
cv2.destroyAllWindows()
print "Exiting."