mirror of
https://github.com/EyeTrackVR/EyeTrackVR.git
synced 2025-11-04 14:39:42 +08:00
bd_blink from HSRAC aid IBO
This commit is contained in:
parent
68a0a291d3
commit
c90517b6c0
@ -177,7 +177,7 @@ class EyeProcessor:
|
|||||||
|
|
||||||
self.prev_x = None
|
self.prev_x = None
|
||||||
self.prev_y = None
|
self.prev_y = None
|
||||||
|
self.bd_blink = False
|
||||||
self.current_algo = InformationOrigin.HSRAC
|
self.current_algo = InformationOrigin.HSRAC
|
||||||
|
|
||||||
|
|
||||||
@ -262,6 +262,8 @@ class EyeProcessor:
|
|||||||
self.eyeopen = self.ibo.intense(self.rawx, self.rawy, self.current_image)
|
self.eyeopen = self.ibo.intense(self.rawx, self.rawy, self.current_image)
|
||||||
if self.eyeopen < 0.35: #threshold so the eye fully closes #todo: make this a setting?
|
if self.eyeopen < 0.35: #threshold so the eye fully closes #todo: make this a setting?
|
||||||
self.eyeopen = 0.0
|
self.eyeopen = 0.0
|
||||||
|
if self.bd_blink == True:
|
||||||
|
self.eyeopen = 0.0
|
||||||
|
|
||||||
if self.settings.gui_IBO and self.settings.gui_BLINK:
|
if self.settings.gui_IBO and self.settings.gui_BLINK:
|
||||||
ibo = self.ibo.intense(self.rawx, self.rawy, self.current_image)
|
ibo = self.ibo.intense(self.rawx, self.rawy, self.current_image)
|
||||||
@ -289,7 +291,7 @@ class EyeProcessor:
|
|||||||
|
|
||||||
def HSRACM(self):
|
def HSRACM(self):
|
||||||
# todo: added process to initialise er_hsrac when resolution changes
|
# todo: added process to initialise er_hsrac when resolution changes
|
||||||
self.rawx, self.rawy, self.thresh, gray_frame = self.er_hsrac.run(self.current_image_gray)
|
self.rawx, self.rawy, self.thresh, gray_frame, self.bd_blink = self.er_hsrac.run(self.current_image_gray)
|
||||||
self.current_image_gray = gray_frame
|
self.current_image_gray = gray_frame
|
||||||
if self.prev_x is None:
|
if self.prev_x is None:
|
||||||
self.prev_x = self.rawx
|
self.prev_x = self.rawx
|
||||||
|
|||||||
@ -422,7 +422,7 @@ class HSRAC_cls(object):
|
|||||||
|
|
||||||
if not contours:
|
if not contours:
|
||||||
# If empty, go to next loop
|
# If empty, go to next loop
|
||||||
return int(center_x), int(center_y), th_frame, frame
|
return int(center_x), int(center_y), th_frame, frame, blink_bd
|
||||||
cnt_ind = None
|
cnt_ind = None
|
||||||
max_area = -1
|
max_area = -1
|
||||||
for i, cnt in enumerate(contours):
|
for i, cnt in enumerate(contours):
|
||||||
@ -439,7 +439,7 @@ class HSRAC_cls(object):
|
|||||||
# ransac_data is None==maxcnt.shape[0]<sample_num
|
# ransac_data is None==maxcnt.shape[0]<sample_num
|
||||||
# go to next loop
|
# go to next loop
|
||||||
# pass
|
# pass
|
||||||
return int(center_x), int(center_y), th_frame, frame
|
return int(center_x), int(center_y), th_frame, frame, blink_bd
|
||||||
|
|
||||||
# crop_start_time = timeit.default_timer()
|
# crop_start_time = timeit.default_timer()
|
||||||
cx, cy, w, h, theta = ransac_data
|
cx, cy, w, h, theta = ransac_data
|
||||||
@ -484,9 +484,9 @@ class HSRAC_cls(object):
|
|||||||
# self.timedict["total_cv"].append(cv_end_time - cv_start_time)
|
# self.timedict["total_cv"].append(cv_end_time - cv_start_time)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return int(cx), int(cy), th_frame, frame
|
return int(cx), int(cy), th_frame, frame, blink_bd
|
||||||
except:
|
except:
|
||||||
return int(center_x), int(center_y), th_frame, frame
|
return int(center_x), int(center_y), th_frame, frame, blink_bd
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -507,8 +507,8 @@ class External_Run_HSRACS(object):
|
|||||||
#debug code
|
#debug code
|
||||||
# center_x, center_y,cropbox,ori_frame, thresh, frame, gray_frame = self.algo.single_run()
|
# center_x, center_y,cropbox,ori_frame, thresh, frame, gray_frame = self.algo.single_run()
|
||||||
# return center_x, center_y,cropbox,ori_frame, thresh, frame, gray_frame
|
# return center_x, center_y,cropbox,ori_frame, thresh, frame, gray_frame
|
||||||
center_x, center_y, thresh, frame = self.algo.single_run()
|
center_x, center_y, thresh, frame, bd_blink = self.algo.single_run()
|
||||||
return center_x, center_y, thresh, frame
|
return center_x, center_y, thresh, frame, bd_blink
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user