avoid resizing

This commit is contained in:
Lincoln-LM 2022-01-07 10:14:16 -07:00
parent 8af665dd60
commit 0ad16dbbcc
3 changed files with 29 additions and 2 deletions

View File

@ -0,0 +1,21 @@
{
"MonitorWindow": false,
"WindowPrefix": "",
"image": "./images/phone_turnback/eye.png",
"view": [
286,
231,
37,
36
],
"thresh": 0.9,
"white_delay": 0.0,
"advance_delay": 0,
"crop": [
0,
0,
0,
0
],
"camera": 3
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 896 B

View File

@ -65,7 +65,10 @@ def tracking_blink(img, roi_x, roi_y, roi_w, roi_h, th = 0.9, size = 40, Monitor
exit()
_, frame = video.read()
if not MonitorWindow:
frame = cv2.resize(frame,(960,540))
size = frame.shape[::-1]
_, fw, fh = size
if fw >= 1920:
frame = cv2.resize(frame,(960,round(fh/fw*960)))
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():
@ -214,7 +217,10 @@ 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))
size = frame.shape[::-1]
_, fw, fh = size
if fw >= 1920:
frame = cv2.resize(frame,(960,round(fh/fw*960)))
time_counter = time.perf_counter()
roi = cv2.cvtColor(frame[roi_y:roi_y+roi_h,roi_x:roi_x+roi_w],cv2.COLOR_RGB2GRAY)