diff --git a/EyeTrackApp/eye_processor.py b/EyeTrackApp/eye_processor.py index 630eec6..6937dc1 100644 --- a/EyeTrackApp/eye_processor.py +++ b/EyeTrackApp/eye_processor.py @@ -208,6 +208,7 @@ class EyeProcessor: self.previous_image = self.current_image self.previous_rotation = self.config.rotation_angle except: # If this fails it likely means that the images are not the same size for some reason. + print(self.current_image_gray.shape, threshold_image.shape) print('\033[91m[ERROR] Size of frames to display are of unequal sizes.\033[0m') pass @@ -242,12 +243,15 @@ class EyeProcessor: rotation_matrix = cv2.getRotationMatrix2D( img_center, self.config.rotation_angle, 1 ) + avg_color_per_row = np.average(self.current_image, axis=0) + avg_color = np.average(avg_color_per_row, axis=0) + ar, ag, ab = avg_color self.current_image = cv2.warpAffine( self.current_image, rotation_matrix, (cols, rows), borderMode=cv2.BORDER_CONSTANT, - borderValue=(64, 64, 64),#(255, 255, 255), + borderValue=(ar + 10, ag + 10, ab + 10),#(255, 255, 255), ) return True except: diff --git a/EyeTrackApp/eyetrackapp.py b/EyeTrackApp/eyetrackapp.py index c248934..d11b449 100644 --- a/EyeTrackApp/eyetrackapp.py +++ b/EyeTrackApp/eyetrackapp.py @@ -31,7 +31,7 @@ SETTINGS_RADIO_NAME = "-SETTINGSRADIO-" page_url = "https://github.com/RedHawk989/EyeTrackVR/releases/latest" -appversion = "EyeTrackApp 0.2.0 BETA 2" +appversion = "EyeTrackApp 0.2.0 BETA 3" def main(): diff --git a/EyeTrackApp/hsrac.py b/EyeTrackApp/hsrac.py index 1a45133..ae50bf2 100644 --- a/EyeTrackApp/hsrac.py +++ b/EyeTrackApp/hsrac.py @@ -243,8 +243,8 @@ class HSRAC_cls(object): def single_run(self): # Temporary implementation to run - if imshow_enable: - ori_frame = self.current_image_gray.copy() # debug code + # if imshow_enable: + ori_frame = self.current_image_gray.copy() # debug code blink_bd = False if self.now_modeo == self.cv_modeo[1]: @@ -422,6 +422,8 @@ class HSRAC_cls(object): if not contours: # If empty, go to next loop + y, x = ori_frame.shape + th_frame = cv2.resize(th_frame, (x, y)) return int(center_x), int(center_y), th_frame, frame, blink_bd cnt_ind = None max_area = -1 @@ -439,7 +441,9 @@ class HSRAC_cls(object): # ransac_data is None==maxcnt.shape[0]