diff --git a/EyeTrackApp/eye_processor.py b/EyeTrackApp/eye_processor.py index bcb0742..7097159 100644 --- a/EyeTrackApp/eye_processor.py +++ b/EyeTrackApp/eye_processor.py @@ -177,7 +177,7 @@ class EyeProcessor: self.prev_x = None self.prev_y = None - + self.bd_blink = False self.current_algo = InformationOrigin.HSRAC @@ -262,6 +262,8 @@ class EyeProcessor: 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? self.eyeopen = 0.0 + if self.bd_blink == True: + self.eyeopen = 0.0 if self.settings.gui_IBO and self.settings.gui_BLINK: ibo = self.ibo.intense(self.rawx, self.rawy, self.current_image) @@ -289,7 +291,7 @@ class EyeProcessor: def HSRACM(self): # 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 if self.prev_x is None: self.prev_x = self.rawx diff --git a/EyeTrackApp/hsrac.py b/EyeTrackApp/hsrac.py index 5cde140..1a45133 100644 --- a/EyeTrackApp/hsrac.py +++ b/EyeTrackApp/hsrac.py @@ -320,7 +320,7 @@ class HSRAC_cls(object): # If the average value of cropped_image is greater than response_max # (i.e., if the cropimage is whitish # blink - # print("BLINK BD") + # print("BLINK BD") blink_bd = True # if imshow_enable or save_video: @@ -422,7 +422,7 @@ class HSRAC_cls(object): if not contours: # 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 max_area = -1 for i, cnt in enumerate(contours): @@ -439,7 +439,7 @@ class HSRAC_cls(object): # ransac_data is None==maxcnt.shape[0]