mirror of
https://github.com/jjaldridge2009/Project_Xs.git
synced 2024-10-03 22:07:09 +02:00
resize properly
This commit is contained in:
parent
f046e3bb9e
commit
a7a37eca31
@ -426,7 +426,8 @@ class Application(tk.Frame):
|
||||
w, h = eye.shape[::-1]
|
||||
roi_x, roi_y, roi_w, roi_h = self.config_json["view"]
|
||||
_, frame = video.read()
|
||||
frame = cv2.resize(frame,(960,540))
|
||||
if not self.config_json["MonitorWindow"]:
|
||||
frame = cv2.resize(frame,(960,540))
|
||||
roi = cv2.cvtColor(frame[roi_y:roi_y+roi_h,roi_x:roi_x+roi_w],cv2.COLOR_RGB2GRAY)
|
||||
res = cv2.matchTemplate(roi,eye,cv2.TM_CCOEFF_NORMED)
|
||||
_, match, _, max_loc = cv2.minMaxLoc(res)
|
||||
|
@ -55,6 +55,8 @@ def tracking_blink(img, roi_x, roi_y, roi_w, roi_h, th = 0.9, size = 40, Monitor
|
||||
tk_window.monitor_tk = None
|
||||
exit()
|
||||
_, frame = video.read()
|
||||
if not MonitorWindow:
|
||||
frame = cv2.resize(frame,(960,540))
|
||||
time_counter = time.perf_counter()
|
||||
roi = cv2.cvtColor(frame[roi_y:roi_y+roi_h,roi_x:roi_x+roi_w],cv2.COLOR_RGB2GRAY)
|
||||
if (roi==prev_roi).all():
|
||||
@ -194,6 +196,8 @@ def tracking_poke_blink(img, roi_x, roi_y, roi_w, roi_h, size = 60, MonitorWindo
|
||||
# 瞬きの観測
|
||||
while len(intervals)<size:
|
||||
_, frame = video.read()
|
||||
if not MonitorWindow:
|
||||
frame = cv2.resize(frame,(960,540))
|
||||
time_counter = time.perf_counter()
|
||||
|
||||
roi = cv2.cvtColor(frame[roi_y:roi_y+roi_h,roi_x:roi_x+roi_w],cv2.COLOR_RGB2GRAY)
|
||||
|
Loading…
Reference in New Issue
Block a user