mirror of
https://github.com/jjaldridge2009/Project_Xs.git
synced 2024-10-05 14:57:12 +02:00
update configs
This commit is contained in:
parent
ba5bd0f7c5
commit
278f89f96c
@ -10,5 +10,6 @@
|
|||||||
],
|
],
|
||||||
"thresh": 0.9,
|
"thresh": 0.9,
|
||||||
"white_delay": 0,
|
"white_delay": 0,
|
||||||
"advance_delay": 0
|
"advance_delay": 0,
|
||||||
|
"crop": [0,0,0,0]
|
||||||
}
|
}
|
@ -10,5 +10,6 @@
|
|||||||
],
|
],
|
||||||
"thresh": 0.75,
|
"thresh": 0.75,
|
||||||
"white_delay": 2,
|
"white_delay": 2,
|
||||||
"advance_delay": 0
|
"advance_delay": 0,
|
||||||
|
"crop": [0,0,0,0]
|
||||||
}
|
}
|
@ -10,5 +10,6 @@
|
|||||||
],
|
],
|
||||||
"thresh": 0.9,
|
"thresh": 0.9,
|
||||||
"white_delay": 0,
|
"white_delay": 0,
|
||||||
"advance_delay": 0
|
"advance_delay": 0,
|
||||||
|
"crop": [0,0,0,0]
|
||||||
}
|
}
|
@ -3,13 +3,19 @@
|
|||||||
"WindowPrefix": "LM-Q",
|
"WindowPrefix": "LM-Q",
|
||||||
"image": "images\\phone\\eye.png",
|
"image": "images\\phone\\eye.png",
|
||||||
"view": [
|
"view": [
|
||||||
392,
|
213,
|
||||||
150,
|
102,
|
||||||
45,
|
45,
|
||||||
55
|
55
|
||||||
],
|
],
|
||||||
"thresh": 0.8,
|
"thresh": 0.8,
|
||||||
"white_delay": 0.0,
|
"white_delay": 0.0,
|
||||||
"advance_delay": 0,
|
"advance_delay": 0,
|
||||||
"advance_del": 0
|
"advance_del": 0,
|
||||||
|
"crop": [
|
||||||
|
173,
|
||||||
|
91,
|
||||||
|
530,
|
||||||
|
300
|
||||||
|
]
|
||||||
}
|
}
|
@ -11,5 +11,6 @@
|
|||||||
"thresh": 0.75,
|
"thresh": 0.75,
|
||||||
"white_delay": 3.0,
|
"white_delay": 3.0,
|
||||||
"advance_delay": 1,
|
"advance_delay": 1,
|
||||||
"advance_del": 3
|
"advance_del": 3,
|
||||||
|
"crop": [0,0,0,0]
|
||||||
}
|
}
|
@ -10,5 +10,6 @@
|
|||||||
],
|
],
|
||||||
"thresh": 0.9,
|
"thresh": 0.9,
|
||||||
"white_delay": 0,
|
"white_delay": 0,
|
||||||
"advance_delay": 0
|
"advance_delay": 0,
|
||||||
|
"crop": [0,0,0,0]
|
||||||
}
|
}
|
@ -5,5 +5,6 @@
|
|||||||
"view": [610, 330, 30, 30],
|
"view": [610, 330, 30, 30],
|
||||||
"thresh": 0.9,
|
"thresh": 0.9,
|
||||||
"white_delay": 0,
|
"white_delay": 0,
|
||||||
"advance_delay": 0
|
"advance_delay": 0,
|
||||||
|
"crop": [0,0,0,0]
|
||||||
}
|
}
|
@ -224,7 +224,7 @@ class Application(tk.Frame):
|
|||||||
|
|
||||||
def monitoring_work(self):
|
def monitoring_work(self):
|
||||||
self.tracking = False
|
self.tracking = False
|
||||||
blinks, intervals, offset_time = rngtool.tracking_blink(self.player_eye, *self.config_json["view"], MonitorWindow=self.config_json["MonitorWindow"], WindowPrefix=self.config_json["WindowPrefix"], tk_window=self, th=self.config_json["thresh"])
|
blinks, intervals, offset_time = rngtool.tracking_blink(self.player_eye, *self.config_json["view"], MonitorWindow=self.config_json["MonitorWindow"], WindowPrefix=self.config_json["WindowPrefix"], crop=self.config_json["crop"], tk_window=self, th=self.config_json["thresh"])
|
||||||
prng = rngtool.recov(blinks, intervals)
|
prng = rngtool.recov(blinks, intervals)
|
||||||
|
|
||||||
self.monitor_blink_button['text'] = "Monitor Blinks"
|
self.monitor_blink_button['text'] = "Monitor Blinks"
|
||||||
@ -407,7 +407,7 @@ class Application(tk.Frame):
|
|||||||
|
|
||||||
if self.config_json["MonitorWindow"]:
|
if self.config_json["MonitorWindow"]:
|
||||||
from windowcapture import WindowCapture
|
from windowcapture import WindowCapture
|
||||||
video = WindowCapture(self.config_json["WindowPrefix"])
|
video = WindowCapture(self.config_json["WindowPrefix"],self.config_json["crop"])
|
||||||
else:
|
else:
|
||||||
video = cv2.VideoCapture(0,cv2.CAP_DSHOW)
|
video = cv2.VideoCapture(0,cv2.CAP_DSHOW)
|
||||||
video.set(cv2.CAP_PROP_FRAME_WIDTH,1920)
|
video.set(cv2.CAP_PROP_FRAME_WIDTH,1920)
|
||||||
|
@ -16,7 +16,7 @@ def randrange(r,mi,ma):
|
|||||||
t = (r & 0x7fffff) / 8388607.0
|
t = (r & 0x7fffff) / 8388607.0
|
||||||
return t * mi + (1.0 - t) * ma
|
return t * mi + (1.0 - t) * ma
|
||||||
|
|
||||||
def tracking_blink(img, roi_x, roi_y, roi_w, roi_h, th = 0.9, size = 40, MonitorWindow = False, WindowPrefix = "SysDVR-Client [PID ", tk_window = None)->Tuple[List[int],List[int],float]:
|
def tracking_blink(img, roi_x, roi_y, roi_w, roi_h, th = 0.9, size = 40, MonitorWindow = False, WindowPrefix = "SysDVR-Client [PID ", crop = None, tk_window = None)->Tuple[List[int],List[int],float]:
|
||||||
"""measuring the type and interval of player's blinks
|
"""measuring the type and interval of player's blinks
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
@ -28,7 +28,7 @@ def tracking_blink(img, roi_x, roi_y, roi_w, roi_h, th = 0.9, size = 40, Monitor
|
|||||||
|
|
||||||
if MonitorWindow:
|
if MonitorWindow:
|
||||||
from windowcapture import WindowCapture
|
from windowcapture import WindowCapture
|
||||||
video = WindowCapture(WindowPrefix)
|
video = WindowCapture(WindowPrefix,crop)
|
||||||
else:
|
else:
|
||||||
video = cv2.VideoCapture(0,cv2.CAP_DSHOW)
|
video = cv2.VideoCapture(0,cv2.CAP_DSHOW)
|
||||||
video.set(cv2.CAP_PROP_FRAME_WIDTH,1920)
|
video.set(cv2.CAP_PROP_FRAME_WIDTH,1920)
|
||||||
@ -165,7 +165,7 @@ def tracking_blink_manual(size = 40, reidentify = False)->Tuple[List[int],List[i
|
|||||||
|
|
||||||
return (blinks, intervals, offset_time)
|
return (blinks, intervals, offset_time)
|
||||||
|
|
||||||
def tracking_poke_blink(img, roi_x, roi_y, roi_w, roi_h, size = 60, MonitorWindow = False, WindowPrefix = "SysDVR-Client [PID ")->Tuple[List[int],List[int],float]:
|
def tracking_poke_blink(img, roi_x, roi_y, roi_w, roi_h, size = 60, MonitorWindow = False, WindowPrefix = "SysDVR-Client [PID ", crop = None)->Tuple[List[int],List[int],float]:
|
||||||
"""measuring the type and interval of pokemon's blinks
|
"""measuring the type and interval of pokemon's blinks
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
@ -176,7 +176,7 @@ def tracking_poke_blink(img, roi_x, roi_y, roi_w, roi_h, size = 60, MonitorWindo
|
|||||||
|
|
||||||
if MonitorWindow:
|
if MonitorWindow:
|
||||||
from windowcapture import WindowCapture
|
from windowcapture import WindowCapture
|
||||||
video = WindowCapture(WindowPrefix)
|
video = WindowCapture(WindowPrefix, crop)
|
||||||
else:
|
else:
|
||||||
video = cv2.VideoCapture(0,cv2.CAP_DSHOW)
|
video = cv2.VideoCapture(0,cv2.CAP_DSHOW)
|
||||||
video.set(cv2.CAP_PROP_FRAME_WIDTH,1920)
|
video.set(cv2.CAP_PROP_FRAME_WIDTH,1920)
|
||||||
|
@ -33,7 +33,7 @@ def reidentify():
|
|||||||
print("path is wrong")
|
print("path is wrong")
|
||||||
return
|
return
|
||||||
|
|
||||||
observed_blinks, _, offset_time = rngtool.tracking_blink(player_eye, *config["view"], MonitorWindow=config["MonitorWindow"], WindowPrefix=config["WindowPrefix"],size=20)
|
observed_blinks, _, offset_time = rngtool.tracking_blink(player_eye, *config["view"], MonitorWindow=config["MonitorWindow"], WindowPrefix=config["WindowPrefix"], crop=config["crop"], size=20)
|
||||||
reidentified_rng = rngtool.reidentifyByBlinks(Xorshift(*state), observed_blinks)
|
reidentified_rng = rngtool.reidentifyByBlinks(Xorshift(*state), observed_blinks)
|
||||||
if reidentified_rng is None:
|
if reidentified_rng is None:
|
||||||
print("couldn't reidentify state.")
|
print("couldn't reidentify state.")
|
||||||
@ -80,7 +80,7 @@ def stationary_timeline():
|
|||||||
print("path is wrong")
|
print("path is wrong")
|
||||||
return
|
return
|
||||||
|
|
||||||
observed_blinks, _, offset_time = rngtool.tracking_blink(player_eye, *config["view"], MonitorWindow=config["MonitorWindow"], WindowPrefix=config["WindowPrefix"],th=config["thresh"],size=20)
|
observed_blinks, _, offset_time = rngtool.tracking_blink(player_eye, *config["view"], MonitorWindow=config["MonitorWindow"], WindowPrefix=config["WindowPrefix"], crop=config["crop"], th=config["thresh"],size=20)
|
||||||
reidentified_rng = rngtool.reidentifyByBlinks(Xorshift(*state), observed_blinks)
|
reidentified_rng = rngtool.reidentifyByBlinks(Xorshift(*state), observed_blinks)
|
||||||
if reidentified_rng is None:
|
if reidentified_rng is None:
|
||||||
print("couldn't reidentify state.")
|
print("couldn't reidentify state.")
|
||||||
|
@ -11,7 +11,7 @@ def expr():
|
|||||||
if player_eye is None:
|
if player_eye is None:
|
||||||
print("path is wrong")
|
print("path is wrong")
|
||||||
return
|
return
|
||||||
blinks, intervals, offset_time = rngtool.tracking_blink(player_eye, *config["view"], MonitorWindow=config["MonitorWindow"], WindowPrefix=config["WindowPrefix"])
|
blinks, intervals, offset_time = rngtool.tracking_blink(player_eye, *config["view"], MonitorWindow=config["MonitorWindow"], WindowPrefix=config["WindowPrefix"], crop=config["crop"])
|
||||||
prng = rngtool.recov(blinks, intervals)
|
prng = rngtool.recov(blinks, intervals)
|
||||||
|
|
||||||
waituntil = time.perf_counter()
|
waituntil = time.perf_counter()
|
||||||
@ -44,7 +44,7 @@ def reidentify():
|
|||||||
print("path is wrong")
|
print("path is wrong")
|
||||||
return
|
return
|
||||||
|
|
||||||
observed_blinks, _, offset_time = rngtool.tracking_blink(player_eye, *config["view"], MonitorWindow=config["MonitorWindow"], WindowPrefix=config["WindowPrefix"], size=20)
|
observed_blinks, _, offset_time = rngtool.tracking_blink(player_eye, *config["view"], MonitorWindow=config["MonitorWindow"], WindowPrefix=config["WindowPrefix"], crop=config["crop"], size=20)
|
||||||
reidentified_rng = rngtool.reidentifyByBlinks(Xorshift(*state), observed_blinks)
|
reidentified_rng = rngtool.reidentifyByBlinks(Xorshift(*state), observed_blinks)
|
||||||
|
|
||||||
waituntil = time.perf_counter()
|
waituntil = time.perf_counter()
|
||||||
|
@ -3,7 +3,7 @@ import win32gui, win32ui, win32con
|
|||||||
|
|
||||||
# Class to monitor a window
|
# Class to monitor a window
|
||||||
class WindowCapture:
|
class WindowCapture:
|
||||||
def __init__(self, partial_window_title):
|
def __init__(self, partial_window_title, crop):
|
||||||
# set up variables
|
# set up variables
|
||||||
self.w = 0
|
self.w = 0
|
||||||
self.h = 0
|
self.h = 0
|
||||||
@ -34,6 +34,8 @@ class WindowCapture:
|
|||||||
self.h = self.h - titlebar_pixels - border_pixels
|
self.h = self.h - titlebar_pixels - border_pixels
|
||||||
self.cropped_x = border_pixels
|
self.cropped_x = border_pixels
|
||||||
self.cropped_y = titlebar_pixels
|
self.cropped_y = titlebar_pixels
|
||||||
|
if crop is not None and crop != [0,0,0,0]:
|
||||||
|
self.cropped_x,self.cropped_y,self.w,self.h = crop
|
||||||
|
|
||||||
# set the cropped coordinates offset so we can translate screenshot images into actual screen positions
|
# set the cropped coordinates offset so we can translate screenshot images into actual screen positions
|
||||||
self.offset_x = window_rect[0] + self.cropped_x
|
self.offset_x = window_rect[0] + self.cropped_x
|
||||||
|
Loading…
Reference in New Issue
Block a user