diff --git a/EyeTrackApp/camera.py b/EyeTrackApp/camera.py index dd85008..3fea0c4 100644 --- a/EyeTrackApp/camera.py +++ b/EyeTrackApp/camera.py @@ -5,6 +5,9 @@ import queue import cv2 import serial import time + +import numpy as np + WAIT_TIME = 0.1 @@ -34,6 +37,12 @@ class Camera: self.cancellation_event = cancellation_event self.current_capture_source = config.capture_source self.wired_camera: "cv2.VideoCapture" = None + + self.serial_connection = None + self.frame_number = 0 + self.start = True + self.serialByteBuffer = b'' + self.error_message = "\033[93m[WARN] Capture source {} not found, retrying...\033[0m" def set_output_queue(self, camera_output_outgoing: "queue.Queue"): diff --git a/EyeTrackApp/hsrac.py b/EyeTrackApp/hsrac.py index 3a53e17..5cde140 100644 --- a/EyeTrackApp/hsrac.py +++ b/EyeTrackApp/hsrac.py @@ -443,16 +443,10 @@ class HSRAC_cls(object): # crop_start_time = timeit.default_timer() cx, cy, w, h, theta = ransac_data - # print(cx, cy) - if w >= 2.1 * h: # new blink detection algo lmao this works pretty good actually - print("RAN BLINK") - # return center_x, center_y, frame, frame, True - # cx = center_x - (csx - cx) # we find the difference between the crop size and ransac point, and subtract from the center point from HSF - # cy = center_y - (csy - cy) + # if w >= 2.1 * h: # new blink detection algo lmao this works pretty good actually + #print("RAN BLINK") - # csy = frame.shape[0] - # csx = frame.shape[1] csy = gray_frame.shape[0] csx = gray_frame.shape[1]