This repository was archived by the owner on Mar 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtest.py
More file actions
53 lines (39 loc) · 1.28 KB
/
test.py
File metadata and controls
53 lines (39 loc) · 1.28 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
# used for testing
"""
get the coordinates of cards and marks
used to get the range for function mark_crd()
check whether the calculation is correct
change some parameters in "card.py" "anti.py" if necessary
Check line 40 and 41, annotate line 37 if you would like test the
image from your phone, if you only want to test local images,
annotate line 36 and set the directory of your image
"""
from init import *
def cards(sh):
global quick, arts, buster
threshold = 0.95
quick = get_crd(sh, 'res/quick.png', threshold)
arts = get_crd(sh, 'res/arts.png', threshold)
buster = get_crd(sh, 'res/buster.png', threshold)
all_cards = quick + arts + buster
all_cards.sort()
print("cards: ", all_cards)
print("quick:", quick)
print("arts: ", arts)
print("buster: ", buster)
def marks(sh,):
restraint = get_restraint(sh)
resistance = get_resistance(sh)
print("restraint: ", restraint)
print("resistance: ", resistance)
def test():
# sh = screenshot()
sh = 'test/t1.jpeg'
print('-------------')
cards(sh) # show coordinates of cards
print('-------------')
marks(sh) # show coordinates of marks
print('-------------')
print("result: ", init_main(sh)) # show the result of calculation
print('-------------')
test()