mirror of
https://github.com/EyeTrackVR/EyeTrackVR.git
synced 2025-11-04 14:39:42 +08:00
fix config calibration saves
This commit is contained in:
parent
bbe1629ebd
commit
338591617e
@ -61,6 +61,7 @@ class CameraWidget:
|
||||
self.ransac = EyeProcessor(
|
||||
self.config,
|
||||
self.settings_config,
|
||||
main_config,
|
||||
self.cancellation_event,
|
||||
self.capture_event,
|
||||
self.capture_queue,
|
||||
|
||||
@ -83,6 +83,7 @@ class EyeProcessor:
|
||||
self,
|
||||
config: "EyeTrackCameraConfig",
|
||||
settings: "EyeTrackSettingsConfig",
|
||||
baseconfig: "EyetrackConfig",
|
||||
cancellation_event: "threading.Event",
|
||||
capture_event: "threading.Event",
|
||||
capture_queue_incoming: "queue.Queue",
|
||||
@ -99,6 +100,7 @@ class EyeProcessor:
|
||||
self.cancellation_event = cancellation_event
|
||||
self.capture_event = capture_event
|
||||
self.eye_id = eye_id
|
||||
self.baseconfig = baseconfig
|
||||
|
||||
# Cross algo state
|
||||
self.lkg_projected_sphere = None
|
||||
@ -120,6 +122,7 @@ class EyeProcessor:
|
||||
# Keep large in order to recenter correctly
|
||||
self.calibration_frame_counter = None
|
||||
self.eyeoffx = 1
|
||||
self.printcal = True
|
||||
|
||||
self.xmax = -69420
|
||||
self.xmin = 69420
|
||||
|
||||
@ -18,7 +18,6 @@ class cal():
|
||||
cx = 1
|
||||
if cy == 0:
|
||||
cy = 1
|
||||
|
||||
if self.eye_id == EyeId.RIGHT:
|
||||
flipx = self.settings.gui_flip_x_axis_right
|
||||
else:
|
||||
@ -27,6 +26,7 @@ class cal():
|
||||
self.calibration_frame_counter = None
|
||||
self.config.calib_XOFF = cx
|
||||
self.config.calib_YOFF = cy
|
||||
self.baseconfig.save()
|
||||
PlaySound('Audio/completed.wav', SND_FILENAME | SND_ASYNC)
|
||||
if self.calibration_frame_counter == self.settings.calibration_samples:
|
||||
self.config.calib_XMAX = -69420
|
||||
@ -63,8 +63,8 @@ class cal():
|
||||
out_x = 0.5
|
||||
out_y = 0.5
|
||||
|
||||
|
||||
if self.config.calib_XMAX != None and self.config.calib_XOFF != None:
|
||||
|
||||
calib_diff_x_MAX = self.config.calib_XMAX - self.config.calib_XOFF
|
||||
if calib_diff_x_MAX == 0:
|
||||
calib_diff_x_MAX = 1
|
||||
@ -125,5 +125,7 @@ class cal():
|
||||
pass
|
||||
return out_x, out_y
|
||||
else:
|
||||
print("[INFO] Please Calibrate Eyes")
|
||||
if self.printcal:
|
||||
print("\033[91m[ERROR] Please Calibrate Eye(s).\033[0m")
|
||||
self.printcal = False
|
||||
return 0, 0
|
||||
Loading…
Reference in New Issue
Block a user