mirror of
https://github.com/EyeTrackVR/EyeTrackVR.git
synced 2025-11-04 14:39:42 +08:00
Expose IBO settings, Fix UVC cameras
This commit is contained in:
parent
7081723ac0
commit
41b11fe134
@ -45,6 +45,9 @@ class AlgoSettingsWidget:
|
||||
self.gui_threshold_slider = f"-BLOBTHRESHOLD{widget_id}-"
|
||||
self.gui_HSF_radius_left = f"-HSFRADIUSLEFT{widget_id}-"
|
||||
self.gui_HSF_radius_right = f"-HSFRADIUSRIGHT{widget_id}-"
|
||||
self.ibo_filter_samples = f"-IBOFILTERSAMPLE{widget_id}-"
|
||||
self.calibration_samples = f"-CALIBRATIONSAMPLES{widget_id}-"
|
||||
self.ibo_fully_close_eye_threshold = f"-CLOSETHRESH{widget_id}-"
|
||||
self.main_config = main_config
|
||||
self.config = main_config.settings
|
||||
self.osc_queue = osc_queue
|
||||
@ -146,6 +149,9 @@ class AlgoSettingsWidget:
|
||||
),
|
||||
sg.Text("Blob", background_color='#424042'),
|
||||
],
|
||||
[
|
||||
sg.Text("Blink Algo Settings:", background_color='#242224')
|
||||
],
|
||||
[
|
||||
sg.Checkbox(
|
||||
"Intensity Based Openness",
|
||||
@ -159,6 +165,29 @@ class AlgoSettingsWidget:
|
||||
key=self.gui_BLINK,
|
||||
background_color='#424042',
|
||||
),
|
||||
|
||||
|
||||
],
|
||||
[
|
||||
sg.Text("IBO Filter Sample Size", background_color='#424042'),
|
||||
sg.InputText(
|
||||
self.config.ibo_filter_samples,
|
||||
key=self.ibo_filter_samples,
|
||||
size=(0,10),
|
||||
),
|
||||
sg.Text("Calibration Samples", background_color='#424042'),
|
||||
sg.InputText(
|
||||
self.config.calibration_samples,
|
||||
key=self.calibration_samples,
|
||||
size=(0,10),
|
||||
),
|
||||
|
||||
sg.Text("IBO Close Threshold", background_color='#424042'),
|
||||
sg.InputText(
|
||||
self.config.ibo_fully_close_eye_threshold,
|
||||
key=self.ibo_fully_close_eye_threshold,
|
||||
size=(0,10),
|
||||
),
|
||||
],
|
||||
[
|
||||
sg.Checkbox(
|
||||
@ -174,7 +203,9 @@ class AlgoSettingsWidget:
|
||||
background_color='#424042',
|
||||
),
|
||||
],
|
||||
|
||||
[
|
||||
sg.Text("Advanced Tracking Algorithim Settings:", background_color='#242224')
|
||||
],
|
||||
[sg.Checkbox(
|
||||
"HSF: Skip Auto Radius",
|
||||
default=self.config.gui_skip_autoradius,
|
||||
@ -255,7 +286,7 @@ class AlgoSettingsWidget:
|
||||
|
||||
self.widget_layout = [
|
||||
[
|
||||
sg.Text("Tracking Algorithm Settings:", background_color='#242224'),
|
||||
sg.Text("Tracking Algorithm Order Settings:", background_color='#242224'),
|
||||
],
|
||||
[
|
||||
sg.Column(self.general_settings_layout, key=self.gui_general_settings_layout, background_color='#424042' ),
|
||||
@ -366,6 +397,18 @@ class AlgoSettingsWidget:
|
||||
self.config.gui_blob_maxsize = values[self.gui_blob_maxsize]
|
||||
changed = True
|
||||
|
||||
if self.config.ibo_filter_samples != int(values[self.ibo_filter_samples]):
|
||||
self.config.ibo_filter_samples = int(values[self.ibo_filter_samples])
|
||||
changed = True
|
||||
|
||||
if self.config.ibo_fully_close_eye_threshold != float(values[self.ibo_fully_close_eye_threshold]):
|
||||
self.config.ibo_fully_close_eye_threshold = float(values[self.ibo_fully_close_eye_threshold])
|
||||
changed = True
|
||||
|
||||
if self.config.calibration_samples != int(values[self.calibration_samples]):
|
||||
self.config.calibration_samples = int(values[self.calibration_samples])
|
||||
changed = True
|
||||
|
||||
if changed:
|
||||
self.main_config.save()
|
||||
#print(self.main_config)
|
||||
|
||||
@ -82,7 +82,7 @@ class Camera:
|
||||
self.config.capture_source != None and self.config.capture_source != ""
|
||||
):
|
||||
|
||||
if (self.config.capture_source[:3] == "COM"):
|
||||
if "COM" in str(self.current_capture_source):
|
||||
if (
|
||||
self.serial_connection is None
|
||||
or self.camera_status == CameraState.DISCONNECTED
|
||||
@ -117,7 +117,7 @@ class Camera:
|
||||
if should_push and not self.capture_event.wait(timeout=0.02):
|
||||
continue
|
||||
if self.config.capture_source != None:
|
||||
if (self.current_capture_source[:3] == "COM"):
|
||||
if "COM" in str(self.current_capture_source):
|
||||
self.get_serial_camera_picture(should_push)
|
||||
else:
|
||||
self.get_cv2_camera_picture(should_push)
|
||||
|
||||
@ -74,7 +74,6 @@ class EyeTrackSettingsConfig(BaseModel):
|
||||
osc_invert_eye_close: bool = False
|
||||
|
||||
|
||||
|
||||
class EyeTrackConfig(BaseModel):
|
||||
version: int = 1
|
||||
right_eye: EyeTrackCameraConfig = EyeTrackCameraConfig()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user