-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcollect_wave.py
40 lines (32 loc) · 1 KB
/
collect_wave.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
import cv2
import numpy as np
import sys
from mss import mss
from constants import *
from utils import *
character = sys.argv[1]
print("Gathering data for {}".format(character))
wave_boundaries = []
Y_DEVIATION = 3
X_DEVIATION = 5
for r in np.arange(-Y_DEVIATION, Y_DEVIATION):
for c in np.arange(-X_DEVIATION, X_DEVIATION):
wave_boundary = {
'top': WAVE_BOUNDARY['top'] + r,
'left': WAVE_BOUNDARY['left'] + c,
'width': WAVE_BOUNDARY['width'],
'height': WAVE_BOUNDARY['height']
}
wave_boundaries.append(wave_boundary)
boundary_index = 0
with mss() as sct:
# Part of the screen to capture
while "Screen capturing":
capture_wave(sct, WAVE_BOUNDARY)
grab_wave(sct, character, wave_boundaries[boundary_index])
boundary_index += 1
boundary_index %= len(wave_boundaries)
# Press "q" to quit
if cv2.waitKey(25) & 0xFF == ord("q"):
cv2.destroyAllWindows()
break