mirror of
https://github.com/EyeTrackVR/EyeTrackVR.git
synced 2025-11-04 14:39:42 +08:00
remove debug print, fix IBO eye saves
This commit is contained in:
parent
d5252124a4
commit
5fa9b3a07c
@ -136,7 +136,7 @@ class EyeProcessor:
|
|||||||
self.er_hsf = None
|
self.er_hsf = None
|
||||||
self.er_hsrac = None
|
self.er_hsrac = None
|
||||||
self.er_daddy = None
|
self.er_daddy = None
|
||||||
self.ibo = IntensityBasedOpeness(eyeside=EyeLR.LEFT if self.eye_id is EyeId.LEFT else EyeLR.RIGHT if eye_id is EyeId.RIGHT else -1)
|
self.ibo = IntensityBasedOpeness(self.eye_id)
|
||||||
self.roi_include_set = {"rotation_angle", "roi_window_x", "roi_window_y"}
|
self.roi_include_set = {"rotation_angle", "roi_window_x", "roi_window_y"}
|
||||||
|
|
||||||
self.failed = 0
|
self.failed = 0
|
||||||
|
|||||||
@ -32,7 +32,13 @@ import cv2
|
|||||||
from enums import EyeLR
|
from enums import EyeLR
|
||||||
from one_euro_filter import OneEuroFilter
|
from one_euro_filter import OneEuroFilter
|
||||||
from utils.img_utils import safe_crop
|
from utils.img_utils import safe_crop
|
||||||
|
from enum import IntEnum
|
||||||
|
|
||||||
|
class EyeId(IntEnum):
|
||||||
|
RIGHT = 0
|
||||||
|
LEFT = 1
|
||||||
|
BOTH = 2
|
||||||
|
SETTINGS = 3
|
||||||
|
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
#higher intensity means more closed/ more white/less pupil
|
#higher intensity means more closed/ more white/less pupil
|
||||||
@ -105,9 +111,17 @@ def newdata(frameshape):
|
|||||||
|
|
||||||
|
|
||||||
class IntensityBasedOpeness:
|
class IntensityBasedOpeness:
|
||||||
def __init__(self, eyeside: EyeLR):
|
def __init__(self, eye_id):
|
||||||
# todo: It is necessary to consider whether the filename can be changed in the configuration file, etc.
|
# todo: It is necessary to consider whether the filename can be changed in the configuration file, etc.
|
||||||
self.imgfile = "IBO_LEFT.png" if eyeside is EyeLR.LEFT else "IBO_RIGHT.png"
|
if eye_id in [EyeId.LEFT]:
|
||||||
|
self.imgfile = "IBO_LEFT.png"
|
||||||
|
else:
|
||||||
|
pass
|
||||||
|
if eye_id in [EyeId.RIGHT]:
|
||||||
|
self.imgfile = "IBO_RIGHT.png"
|
||||||
|
else:
|
||||||
|
pass
|
||||||
|
# self.imgfile = "IBO_LEFT.png" if eyeside is EyeLR.LEFT else "IBO_RIGHT.png"
|
||||||
# self.data[0, -1] = maxval, [1, -1] = rotation, [2, -1] = x, [3, -1] = y
|
# self.data[0, -1] = maxval, [1, -1] = rotation, [2, -1] = x, [3, -1] = y
|
||||||
self.data = None
|
self.data = None
|
||||||
self.lct = None
|
self.lct = None
|
||||||
@ -230,7 +244,7 @@ class IntensityBasedOpeness:
|
|||||||
self.filterlist.append(intensity)
|
self.filterlist.append(intensity)
|
||||||
|
|
||||||
if intensity >= np.percentile(self.filterlist, 99): # filter abnormally high values
|
if intensity >= np.percentile(self.filterlist, 99): # filter abnormally high values
|
||||||
print('filter, assume blink')
|
# print('filter, assume blink')
|
||||||
intensity = self.maxval
|
intensity = self.maxval
|
||||||
|
|
||||||
#self.tri_filter.append(intensity)
|
#self.tri_filter.append(intensity)
|
||||||
|
|||||||
@ -246,7 +246,6 @@ def RANSAC3D(self, hsrac_en):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
cx, cy, w, h, theta = ransac_data
|
cx, cy, w, h, theta = ransac_data
|
||||||
print(int(cx), int(cy))
|
|
||||||
# print(cx, cy)
|
# print(cx, cy)
|
||||||
#cxi, cyi, wi, hi = int(cx), int(cy), int(w), int(h)
|
#cxi, cyi, wi, hi = int(cx), int(cy), int(w), int(h)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user