mirror of
https://github.com/jjaldridge2009/Project_Xs.git
synced 2024-10-02 13:27:13 +02:00
avoid resizing
This commit is contained in:
parent
8af665dd60
commit
0ad16dbbcc
21
configs/config_phone_turnback.json
Normal file
21
configs/config_phone_turnback.json
Normal 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
|
||||
}
|
BIN
images/phone_turnback/eye.png
Normal file
BIN
images/phone_turnback/eye.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 896 B |
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user